Class ClientConfig.Builder
- java.lang.Object
-
- com.adobe.pdfservices.operation.config.ClientConfig.Builder
-
- Enclosing class:
- ClientConfig
public static class ClientConfig.Builder extends Object
Builds aClientConfig
instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs aBuilder
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientConfig
build()
Returns a newClientConfig
instance built from the current state of this builder.ClientConfig.Builder
fromFile(String clientConfigFilePath)
Sets the connect timeout, socket timeout, processing timeout and proxy server config using the JSON client config file path.ClientConfig.Builder
setRegion(Region region)
Sets the region code.ClientConfig.Builder
withConnectTimeout(Integer connectTimeout)
Sets the connect timeout.ClientConfig.Builder
withProxyServerConfig(ProxyServerConfig proxyServerConfig)
Sets the configuration for proxy server.ClientConfig.Builder
withSocketTimeout(Integer socketTimeout)
Sets the socket timeout.
-
-
-
Method Detail
-
setRegion
public ClientConfig.Builder setRegion(Region region)
Sets the region code.- Parameters:
region
- aRegion
instance. Default value is US.- Returns:
- this Builder instance to add any additional parameters
-
withConnectTimeout
public ClientConfig.Builder withConnectTimeout(Integer connectTimeout)
Sets the connect timeout. It should be greater than zero.- Parameters:
connectTimeout
- determines the timeout in milliseconds until a connection is established in the API calls. Default value is 10000 milliseconds.- Returns:
- this Builder instance to add any additional parameters
-
withProxyServerConfig
public ClientConfig.Builder withProxyServerConfig(ProxyServerConfig proxyServerConfig)
Sets the configuration for proxy server.- Parameters:
proxyServerConfig
- aProxyServerConfig
instance for providing proxy server configuration.- Returns:
- this Builder instance to add any additional parameters
-
withSocketTimeout
public ClientConfig.Builder withSocketTimeout(Integer socketTimeout)
Sets the socket timeout. It should be greater than zero.- Parameters:
socketTimeout
- Defines the socket timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets. Default value is 2000 milliseconds- Returns:
- this Builder instance to add any additional parameters
-
fromFile
public ClientConfig.Builder fromFile(String clientConfigFilePath)
Sets the connect timeout, socket timeout, processing timeout and proxy server config using the JSON client config file path. Default value for socket timeout is 2000 milliseconds, for connect timeout is 10000 milliseconds and for processing timeout is 600000 milliseconds (10 minutes).JSON structure:
{ "connectTimeout": "4000", "socketTimeout": "20000", "proxyServerConfig": { "host": "127.0.0.1", "port": "8080", "scheme": "https", "usernamePasswordCredentials": { "username": "username", "password": "password" } }, "region": "EU" }
- Returns:
- this Builder instance to add any additional parameters
-
build
public ClientConfig build()
Returns a newClientConfig
instance built from the current state of this builder.- Returns:
- a new
ClientConfig
instance.
-
-