public class ClientConfig
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_API_PORT |
static int |
DEFAULT_BULK_SIZE |
static int |
DEFAULT_CONNECTION_TIMEOUT |
static int |
DEFAULT_ITL_BULK_SIZE |
static int |
DEFAULT_LOGGING_ENTITY_LENGTH |
static int |
DEFAULT_MAX_CONCURRENT_TASK_REQUESTS |
static int |
DEFAULT_MAX_RETRIES |
static int |
DEFAULT_PORTAL_PORT |
static java.lang.String |
DEFAULT_PROTOCOL |
static int |
DEFAULT_READ_TIMEOUT |
static int |
DEFAULT_RETRY_INTERVAL |
static int |
DEFAULT_TASK_POLLING_INTERVAL |
static int |
DEFAULT_TASKS_EXECUTION_TIMEOUT_SECONDS |
static int |
SESSION_KEY_RENEW_TIMEOUT |
Constructor and Description |
---|
ClientConfig() |
Modifier and Type | Method and Description |
---|---|
int |
getBulkSize() |
int |
getConnectionTimeout() |
java.lang.String |
getHost() |
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Returns the provided HostnameVerifier, or null
|
int |
getITLBulkSize() |
int |
getLoggingEntityLength() |
int |
getMaxConcurrentTaskRequests()
Returns the maximum concurrent task threads that this client can
spawn
|
int |
getMaxRetries() |
java.lang.String |
getMediaType() |
int |
getPort() |
int |
getPortalPort() |
java.lang.String |
getProtocol() |
int |
getReadTimeout() |
int |
getRetryInterval() |
int |
getSessionKeyRenewTimeout()
Returns session key renew timeout
|
javax.net.ssl.SSLSocketFactory |
getSocketFactory()
Returns the provided SSLSocketFactory, or null
|
int |
getTaskPollingInterval() |
int |
getTasksExecutionTimeoutSeconds()
Returns task execution timeout in seconds
|
boolean |
isRequestLoggingEnabled() |
void |
setBulkSize(int bulkSize)
Sets the number of items to retrieve per bulk request.
|
void |
setConnectionTimeout(int connectionTimeout)
Sets the connection timeout in milliseconds for API requests.
|
void |
setHost(java.lang.String host)
Sets the host of the target environment.
|
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
Provide and alternate Hostname Verifier for the clients
|
void |
setIgnoreCertificates(boolean ignoreCertificates)
Sets the SSLSocketFactory and HostnameVerifier to ignore all SSL certificates.
|
void |
setITLBulkSize(int itlBulkSize)
Sets the number of items to retrieve per ITL bulk request.
|
void |
setLoggingEntityLength(int loggingEntityLength)
Sets the maximum length of an HTTP request to be logged.
|
void |
setMaxConcurrentTaskRequests(int maxConcurrentTaskRequests)
Sets the Maximum concurrent task threads that this client can spawn
|
void |
setMaxRetries(int maxRetries)
Sets the maximum number of retries for any retryable errors.
|
void |
setMediaType(java.lang.String mediaType)
Sets the media type to be used for API requests.
|
void |
setPort(int port)
Sets the target port for HTTP requests to the API.
|
void |
setPortalPort(int portalPort)
Sets the target port for HTTP requests to the portal API.
|
void |
setProtocol(java.lang.String protocol)
Sets the protocol for HTTP requests to the API.
|
void |
setReadTimeout(int readTimeout)
Sets the read timeout in milliseconds for API requests.
|
void |
setRequestLoggingEnabled(boolean requestLoggingEnabled)
Sets if request logging should be enabled.
|
void |
setRetryInterval(int retryInterval)
Interval in milliseconds before retrying a request after recieving an error.
|
void |
setSessionKeyRenewTimeout(int sessionKeyRenewTimeout)
Sets the session key renew timeout
|
void |
setSocketFactory(javax.net.ssl.SSLSocketFactory socketFactory)
Provide an alternate socket factory for the clients
|
void |
setTaskPollingInterval(int taskPollingInterval)
Interval in milliseconds between polling requests to check task status.
|
void |
setTasksExecutionTimeoutSeconds(int tasksExecutionTimeoutSeconds)
Sets the total task execution timeout in seconds
|
ClientConfig |
withBulkSize(int bulkSize)
Sets the bulk size and returns the updated configuration.
|
ClientConfig |
withConnectionTimeout(int connectionTimeout)
Sets the connection timeout and returns the updated configuration.
|
ClientConfig |
withHost(java.lang.String host)
Sets the host and returns the updated configuration.
|
ClientConfig |
withHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
Sets the HostnameVerifier and returns the updated configuration.
|
ClientConfig |
withIgnoringCertificates(boolean ignoringCertificates)
Sets the SSLSocketFactory and HostnameVerifier to ignore all SSL certificates and returns the updated
configuration.
|
ClientConfig |
withLoggingEntityLength(int loggingEntityLength)
Sets the logging entity length and returns the updated configuration.
|
ClientConfig |
withMaxConcurrentTaskRequests(int maxConcurrentTaskRequests)
Adds maximum concurrent task request thread count
|
ClientConfig |
withMaxRetries(int maxRetries)
Sets the max retries and returns the updated configuration.
|
ClientConfig |
withMediaType(java.lang.String mediaType)
Sets the media type and returns the updated configuration.
|
ClientConfig |
withPort(int port)
Sets the port and returns the updated configuration.
|
ClientConfig |
withPortalPort(int portalPort)
Sets the portal port and returns the updated configuration.
|
ClientConfig |
withProtocol(java.lang.String protocol)
Sets the protocol and returns the updated configuration.
|
ClientConfig |
withReadTimeout(int readTimeout)
Sets the read timeout and returns the updated configuration.
|
ClientConfig |
withRequestLoggingDisabled()
Sets the request logging disabled and returns the updated configuration.
|
ClientConfig |
withRequestLoggingEnabled()
Sets the request logging enabled and returns the updated configuration.
|
ClientConfig |
withRetryInterval(int retryInterval)
Sets the retry interval and returns the updated configuration.
|
ClientConfig |
withSessionKeyRenewTimeout(int sessionKeyRenewTimeout)
Sets the session key renew timeout.
|
ClientConfig |
withSocketFactory(javax.net.ssl.SSLSocketFactory factory)
Sets the SSLSocketFactory and returns the updated configuration.
|
ClientConfig |
withTaskPollingInterval(int taskPollingInterval)
Sets the task polling interval and returns the updated configuration.
|
ClientConfig |
withTasksExecutionTimeoutSeconds(int tasksExecutionTimeoutSeconds)
Adds the total tasks execution timeout in seconds
|
public static final int DEFAULT_LOGGING_ENTITY_LENGTH
public static final int DEFAULT_MAX_RETRIES
public static final int DEFAULT_RETRY_INTERVAL
public static final int DEFAULT_TASK_POLLING_INTERVAL
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
public static final java.lang.String DEFAULT_PROTOCOL
public static final int DEFAULT_API_PORT
public static final int DEFAULT_PORTAL_PORT
public static final int DEFAULT_BULK_SIZE
public static final int DEFAULT_ITL_BULK_SIZE
public static final int DEFAULT_MAX_CONCURRENT_TASK_REQUESTS
public static final int DEFAULT_TASKS_EXECUTION_TIMEOUT_SECONDS
public static final int SESSION_KEY_RENEW_TIMEOUT
public boolean isRequestLoggingEnabled()
public void setRequestLoggingEnabled(boolean requestLoggingEnabled)
requestLoggingEnabled
- True to enable logging each request, False to disable.public int getLoggingEntityLength()
public void setLoggingEntityLength(int loggingEntityLength)
loggingEntityLength
- Maximum length of HTTP request before truncation.public int getMaxRetries()
public void setMaxRetries(int maxRetries)
maxRetries
- Maximum number of retries.public int getRetryInterval()
public void setRetryInterval(int retryInterval)
retryInterval
- Milliseconds between retry requests.public java.lang.String getMediaType()
public void setMediaType(java.lang.String mediaType)
mediaType
- Media type to use.public int getTaskPollingInterval()
public void setTaskPollingInterval(int taskPollingInterval)
taskPollingInterval
- Milliseconds between task poll requests.public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout
- Timeout in millliseconds.public int getReadTimeout()
public void setReadTimeout(int readTimeout)
readTimeout
- Timeout in millliseconds.public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- Hostname or IP address for the Virtual IP of the target environment.public int getPort()
public void setPort(int port)
port
- Target port.public java.lang.String getProtocol()
public void setProtocol(java.lang.String protocol)
protocol
- HTTP Protocol.public int getPortalPort()
public void setPortalPort(int portalPort)
portalPort
- Target port for the portal.public int getBulkSize()
public void setBulkSize(int bulkSize)
bulkSize
- Number of items to retrieve per bulk request. Maximum is 4000.public int getITLBulkSize()
public void setITLBulkSize(int itlBulkSize)
itlBulkSize
- Number of items to retrieve per bulk request. Maximum is 4000.public void setSocketFactory(javax.net.ssl.SSLSocketFactory socketFactory)
socketFactory
- custom socket factorypublic javax.net.ssl.SSLSocketFactory getSocketFactory()
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
hostnameVerifier
- custom hostname verifierpublic int getMaxConcurrentTaskRequests()
public void setMaxConcurrentTaskRequests(int maxConcurrentTaskRequests)
maxConcurrentTaskRequests
- public ClientConfig withMaxConcurrentTaskRequests(int maxConcurrentTaskRequests)
maxConcurrentTaskRequests
- public int getTasksExecutionTimeoutSeconds()
public void setTasksExecutionTimeoutSeconds(int tasksExecutionTimeoutSeconds)
tasksExecutionTimeoutSeconds
- public int getSessionKeyRenewTimeout()
public void setSessionKeyRenewTimeout(int sessionKeyRenewTimeout)
sessionKeyRenewTimeout
- public ClientConfig withTasksExecutionTimeoutSeconds(int tasksExecutionTimeoutSeconds)
tasksExecutionTimeoutSeconds
- public void setIgnoreCertificates(boolean ignoreCertificates)
ignoreCertificates
- True if SSL trust should be disabledPlease refer setSocketFactory(javax.net.ssl.SSLSocketFactory)
,
Please refer #setHostnameVerifier(javax.net.ssl.HostnameVerifier)
public ClientConfig withBulkSize(int bulkSize)
bulkSize
- Number of items to retrieve per bulk request. Maximum is 4000.public ClientConfig withHost(java.lang.String host)
host
- Hostname or IP address for the Virtual IP of the target environment.setHost(String)
public ClientConfig withPort(int port)
port
- Target port to set.setPort(int)
public ClientConfig withProtocol(java.lang.String protocol)
protocol
- HTTP Protocol to use.setProtocol(String)
public ClientConfig withConnectionTimeout(int connectionTimeout)
connectionTimeout
- Connection timeout to set.setConnectionTimeout(int)
public ClientConfig withReadTimeout(int readTimeout)
readTimeout
- Read timeout to set.setReadTimeout(int)
public ClientConfig withMediaType(java.lang.String mediaType)
mediaType
- Media type to set.setMediaType(String)
public ClientConfig withRequestLoggingEnabled()
setRequestLoggingEnabled(boolean)
public ClientConfig withRequestLoggingDisabled()
setRequestLoggingEnabled(boolean)
public ClientConfig withLoggingEntityLength(int loggingEntityLength)
loggingEntityLength
- Logging entity length to set.setLoggingEntityLength(int)
public ClientConfig withMaxRetries(int maxRetries)
maxRetries
- Max retries to set.setMaxRetries(int)
public ClientConfig withRetryInterval(int retryInterval)
retryInterval
- Retry interval to set.setRetryInterval(int)
public ClientConfig withTaskPollingInterval(int taskPollingInterval)
taskPollingInterval
- Task polling interval to setsetTaskPollingInterval(int)
public ClientConfig withPortalPort(int portalPort)
portalPort
- Target portal port to set.setPortalPort(int)
public ClientConfig withSocketFactory(javax.net.ssl.SSLSocketFactory factory)
factory
- The SSLSocketFactory to usesetSocketFactory(SSLSocketFactory)
public ClientConfig withHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
verifier
- The HostnameVerifier to usesetHostnameVerifier(HostnameVerifier)
public ClientConfig withIgnoringCertificates(boolean ignoringCertificates)
setIgnoreCertificates(boolean)
public ClientConfig withSessionKeyRenewTimeout(int sessionKeyRenewTimeout)
setSessionKeyRenewTimeout(int)