public static class PCloudAPIClient.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
PCloudAPIClient.Builder |
addInterceptor(RequestInterceptor interceptor)
Adds a new RequestInterceptor
|
PCloudAPIClient.Builder |
addInterceptorAtFront(RequestInterceptor interceptor)
Adds a RequestInterceptor to the front of the List of interceptors
|
PCloudAPIClient.Builder |
addInterceptors(java.util.Collection<RequestInterceptor> interceptors)
The same as addInterceptor(RequestInterceptor)
but allows adding an entire List of RequestInterceptor
|
PCloudAPIClient.Builder |
callExecutor(java.util.concurrent.ExecutorService executorService)
Sets a ExecutorService for the client
|
PCloudAPIClient.Builder |
connectionPool(ConnectionPool connectionPool)
Sets a ConnectionPool for the client
|
PCloudAPIClient |
create()
Creates the PCloudAPIClient with all the parameters set with the PCloudAPIClient.Builder
|
PCloudAPIClient.Builder |
endpointProvider(EndpointProvider endpointProvider)
Sets a EndpointProvider for the client
|
PCloudAPIClient.Builder |
setConnectTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the connection timeout duration
|
PCloudAPIClient.Builder |
setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
Sets the HostnameVerifier for the client
|
PCloudAPIClient.Builder |
setReadTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the read timeout duration
|
PCloudAPIClient.Builder |
setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the SocketFactory for the client
|
PCloudAPIClient.Builder |
setSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Sets the SSLSocketFactory for the client
|
PCloudAPIClient.Builder |
setWriteTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the write timeout duration
|
public PCloudAPIClient.Builder addInterceptor(RequestInterceptor interceptor)
interceptor
- A new RequestInterceptor to be added to the clientjava.lang.IllegalArgumentException
- on a null RequestInterceptor argumentpublic PCloudAPIClient.Builder addInterceptors(java.util.Collection<RequestInterceptor> interceptors)
interceptors
- A List of RequestInterceptor to be added to the clientjava.lang.IllegalArgumentException
- on a null Collection or one containing null elementspublic PCloudAPIClient.Builder addInterceptorAtFront(RequestInterceptor interceptor)
interceptor
- A RequestInterceptor to be added to the front of the Listjava.lang.IllegalArgumentException
- on a null RequestInterceptorpublic PCloudAPIClient.Builder setConnectTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)
timeout
- The maximum amount of time a connection should take to establish itselftimeUnit
- The unit in which you provided the duration argumentjava.lang.IllegalArgumentException
- on a null TimeUnit,
0 or a negative value for the duration argument
or a duration argument greater than Integer.MAX_VALUEpublic PCloudAPIClient.Builder setWriteTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)
timeout
- The duration for the write timeouttimeUnit
- The unit in which you specified the duration argumentjava.lang.IllegalArgumentException
- on a null TimeUnit,
0 or a negative value for the duration argument
or a duration argument greater than Integer.MAX_VALUEpublic PCloudAPIClient.Builder setReadTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)
timeout
- The duration for the read timeouttimeUnit
- The unit in which specified the duration argumentjava.lang.IllegalArgumentException
- on a null TimeUnit,
0 or a negative value for the duration argument
or a duration argument greater than Integer.MAX_VALUEpublic PCloudAPIClient.Builder connectionPool(ConnectionPool connectionPool)
connectionPool
- A ConnectionPool to be set to the clientjava.lang.IllegalArgumentException
- on a null ConnectionPool argumentpublic PCloudAPIClient.Builder endpointProvider(EndpointProvider endpointProvider)
endpointProvider
- A EndpointProvider to be set to the clientjava.lang.IllegalArgumentException
- on a null EndpointProvider argumentpublic PCloudAPIClient.Builder setSocketFactory(javax.net.SocketFactory socketFactory)
socketFactory
- The SocketFactory to be set to the clientjava.lang.IllegalArgumentException
- on a null SocketFactory argumentpublic PCloudAPIClient.Builder setSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
sslSocketFactory
- The SSLSocketFactory to be set to the clientjava.lang.IllegalArgumentException
- on a null SSLSocketFactory argumentpublic PCloudAPIClient.Builder setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
hostnameVerifier
- The HostnameVerifier to be set to the clientjava.lang.IllegalArgumentException
- on a null HostnameVerifier argumentpublic PCloudAPIClient.Builder callExecutor(java.util.concurrent.ExecutorService executorService)
If no executor is provided or this method is called with a null argument a default ExecutorService will be set
executorService
- The ExecutorService to be set to the clientpublic PCloudAPIClient create()