public class ClientConfiguration extends PropertyContainer implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_CONNECTIONS
the default max connection pool size.
|
static int |
DEFAULT_MAX_RETRIES
The default maximum number of retries for error responses.
|
static int |
DEFAULT_SOCKET_TIMEOUT
the default timeout for a connection socket.
|
static java.lang.String |
DEFAULT_USER_AGENT
The default HTTP user agent headers.
|
NL, properties, RESERVED_NAME| Constructor and Description |
|---|
ClientConfiguration()
Create the client configuration.
|
ClientConfiguration(ClientConfiguration other)
Creates the client configuration from the given another
client configuration |
| Modifier and Type | Method and Description |
|---|---|
ClientConfiguration |
clone() |
int |
getConnectionTimeout() |
int |
getMaxConnections() |
int |
getMaxErrorRetry() |
Protocol |
getProtocol() |
java.lang.String |
getProxyDomain() |
java.lang.String |
getProxyHost() |
java.lang.String |
getProxyPassword() |
int |
getProxyPort() |
java.lang.String |
getProxyUsername() |
java.lang.String |
getProxyWorkstation() |
int[] |
getSocketBufferSizeHints() |
int |
getSocketTimeout() |
java.lang.String |
getUserAgent() |
void |
setConnectionTimeout(int connectionTimeout)
Sets the amount of to wait (in milliseconds) when initially establishing a
connection before giving up and timing out.
|
void |
setMaxConnections(int maxConnections)
Sets the maximum number of allowed open HTTP connections.
|
void |
setMaxErrorRetry(int maxErrorRetry)
Sets the maximum number of retry attempts for failed retryable requests.
|
void |
setProtocol(Protocol protocol)
Sets the protocol (i.e.
|
void |
setProxyDomain(java.lang.String proxyDomain)
Sets the optional Windows domain name for configuration an NTLM proxy.
|
void |
setProxyHost(java.lang.String proxyHost)
Sets the optional proxy host the client will connect through.
|
void |
setProxyPassword(java.lang.String password)
Sets the optional proxy password if connecting through a proxy.
|
void |
setProxyPort(int proxyPort)
Sets the optional proxy port the client will connect through.
|
void |
setProxyUsername(java.lang.String username)
Sets the proxy username to use if connecting through a proxy.
|
void |
setProxyWorkstation(java.lang.String proxyWorkstation)
Sets the optional Windows workstation name for configuring NTLM proxy
support.
|
void |
setSocketBufferSizeHints(int socketSendBufferSizeHint,
int socketReceiveBufferSizeHint)
Sets the optional size hints (in bytes) for the low level TCP send and
receive buffers.
|
void |
setSocketTimeout(int socketTimeout)
Sets the amount of time wait (in milliseconds) for data to be transferred
over an established, open connection before the connection timeout and is
closed.
|
void |
setUserAgent(java.lang.String userAgent)
Sets the HTTP user agent header to send with all request.
|
java.lang.String |
toString() |
ClientConfiguration |
withConnectionTimeout(int connectionTimeout)
Sets the amount of to wait (in milliseconds) when initially establishing a
connection before giving up and timing out and returns
ClientConfiguration object. |
ClientConfiguration |
withMaxConnections(int maxConnections)
Sets the maximum number of allowed open HTTP connections and return
the updated
ClientConfiguration object. |
ClientConfiguration |
withMaxErrorRetry(int maxErrorRetry)
Sets the maximum number of retry attempts for failed retryable requests
and returns the updated
ClientConfiguration object. |
ClientConfiguration |
withProperty(java.lang.String name,
java.lang.Object value)
Sets the property name and value.
|
ClientConfiguration |
withProtocol(Protocol protocol)
Sets the protocol (i.e.
|
ClientConfiguration |
withProxyDomain(java.lang.String proxyDomain)
Sets the optional Windows domain nam for configuration an NTLM proxy and
return the updated
ClientConfiguration object. |
ClientConfiguration |
withProxyHost(java.lang.String proxyHost)
Sets the optioanl proxy host the client will connect through and returns
the updated
ClientConfiguration object. |
ClientConfiguration |
withProxyPassword(java.lang.String password)
Sets the optional proxy password if connecting through a proxy and return
the updated
ClientConfiguration object. |
ClientConfiguration |
withProxyPort(int proxyPort)
Sets the optional proxy port the client will connect through and return
the updated
ClientConfiguration object. |
ClientConfiguration |
withProxyUsername(java.lang.String username)
Sets the optional proxy username if connecting through a proxy and return
the updated
ClientConfiguration object. |
ClientConfiguration |
withProxyWorkstation(java.lang.String proxyWorkstation)
Sets the optional Windows workstation name for configuring NTLM proxy
support and returns the updated
ClientConfiguration object. |
ClientConfiguration |
withSocketBufferSizeHints(int socketSendBufferSizeHint,
int socketReceiveBufferSizeHint)
Sets the optional size hints (in bytes) for the low level TCP send and
receive buffers.
|
ClientConfiguration |
withSocketTimeout(int socketTimeout)
Sets the amount of time wait (in milliseconds) for data to be transferred
over an established, open connection before the connection timeout and is
closed and returns the updated
ClientConfiguration object. |
ClientConfiguration |
withUserAgent(java.lang.String userAgent)
Sets the HTTP user agent header to send with all request and return the
updated
ClientConfiguration object. |
appendPropertiesTo, appendPropertiesTo, asDate, asDate, asInteger, asInteger, asLong, asLong, asString, asString, elementName, getProperties, getProperty, getPropertyMap, hasProperties, hasProperty, isVisible, jsonElementName, removeProperty, setPropertiesFrom, setProperty, toJsonpublic static final int DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_MAX_CONNECTIONS
public static final java.lang.String DEFAULT_USER_AGENT
public static final int DEFAULT_MAX_RETRIES
public ClientConfiguration()
public ClientConfiguration(ClientConfiguration other)
client configurationother - the given client configuration
to copy data.public Protocol getProtocol()
public void setProtocol(Protocol protocol)
The default configuration is to use HTTPS for all requests for increased security.
protocol - the protocol to use when connecting to the target service.public ClientConfiguration withProtocol(Protocol protocol)
ClientConfiguration
object so that additional calls may be chained together.protocol - the protocol to use when connecting to the target service.ClientConfiguration object with the new
protocol setting.public int getMaxConnections()
public void setMaxConnections(int maxConnections)
maxConnections - the maximum number of allowed open HTTP connections.public ClientConfiguration withMaxConnections(int maxConnections)
ClientConfiguration object.maxConnections - the maximum number of allowed open HTTP connection.ClientConfiguration object with the new max
HTTP connections setting.public java.lang.String getUserAgent()
public void setUserAgent(java.lang.String userAgent)
userAgent - The user agent string to use when sending request.public ClientConfiguration withUserAgent(java.lang.String userAgent)
ClientConfiguration object.userAgent - the given user agent string to use when sending request.ClientConfiguration object with the new user
agent setting.public java.lang.String getProxyHost()
public void setProxyHost(java.lang.String proxyHost)
proxyHost - the proxy host the client will connect through.public ClientConfiguration withProxyHost(java.lang.String proxyHost)
ClientConfiguration object.proxyHost - the proxy host the client will connect through.ClientConfiguration object with the new proxy
host setting.public int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort - the proxy port the client will connect through.public ClientConfiguration withProxyPort(int proxyPort)
ClientConfiguration object.proxyPort - the proxy port the client will connect through.ClientConfiguration object with the new proxy
port setting.public java.lang.String getProxyUsername()
public void setProxyUsername(java.lang.String username)
username - the proxy username to use if connecting through a proxy.public ClientConfiguration withProxyUsername(java.lang.String username)
ClientConfiguration object.username - the proxy username to use if connecting though a proxy.ClientConfiguration object with a new proxy
username setting.public java.lang.String getProxyPassword()
public void setProxyPassword(java.lang.String password)
password - the proxy password to use if connecting through a proxy.public ClientConfiguration withProxyPassword(java.lang.String password)
ClientConfiguration object.password - the proxy password to use if connecting through a proxy.ClientConfiguration object with a new proxy
password setting.public java.lang.String getProxyDomain()
public void setProxyDomain(java.lang.String proxyDomain)
proxyDomain - the optional Windows domain name for configuring an
NTLM proxy.public ClientConfiguration withProxyDomain(java.lang.String proxyDomain)
ClientConfiguration object.proxyDomain - the optional Windows domain name for configuring an
NTLM proxy.ClientConfiguration object with a new proxy
domain setting.public java.lang.String getProxyWorkstation()
public void setProxyWorkstation(java.lang.String proxyWorkstation)
proxyWorkstation - the optional Windows workstation name for configuring
NTLM proxy support.public ClientConfiguration withProxyWorkstation(java.lang.String proxyWorkstation)
ClientConfiguration object.proxyWorkstation - the optional Windows workstation name for configuring
NTLM proxy support.ClientConfiguration object with a new proxy
workstation setting.public int getMaxErrorRetry()
public void setMaxErrorRetry(int maxErrorRetry)
maxErrorRetry - the maximum number of retry attempts for failed
retryable requests.public ClientConfiguration withMaxErrorRetry(int maxErrorRetry)
ClientConfiguration object.maxErrorRetry - the maximum number of retry attempts for failed
retryable requests.ClientConfiguration object with a new maximum
number of retry attempts for failed retryable requests setting.public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
socketTimeout - The amount of time to wait (in milliseconds) for data
to be transferred over an established, open
connection before the connection timeout and is
closed.public ClientConfiguration withSocketTimeout(int socketTimeout)
ClientConfiguration object.socketTimeout - The amount of time to wait (in milliseconds) for data
to be transferred over an established, open
connection before the connection timeout and is
closed.ClientConfiguration object with a new socket
timeout setting.public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout - The amount of time wait (in milliseconds) when
initially establishing a connection before giving
up and timing out.public ClientConfiguration withConnectionTimeout(int connectionTimeout)
ClientConfiguration object.connectionTimeout - The amount of time wait (in milliseconds) when
initially establishing a connection before giving
up and timing out.ClientConfiguration object with a new
connection timeout setting.public int[] getSocketBufferSizeHints()
public void setSocketBufferSizeHints(int socketSendBufferSizeHint,
int socketReceiveBufferSizeHint)
socketSendBufferSizeHint - the size hint (in bytes) for the low level
TCP send buffer.socketReceiveBufferSizeHint - the size hint (in bytes) for the low
level TCP receive buffer.public ClientConfiguration withSocketBufferSizeHints(int socketSendBufferSizeHint, int socketReceiveBufferSizeHint)
ClientConfiguration object.socketSendBufferSizeHint - the size hint (in bytes) for the low level
TCP send buffer.socketReceiveBufferSizeHint - the size hint (in bytes) for the low
level TCP receive buffer.ClientConfiguration object with a new socket
buffer size hints setting.public ClientConfiguration withProperty(java.lang.String name, java.lang.Object value)
name - the property name.value - the property value.ClientConfiguration.public ClientConfiguration clone()
clone in class PropertyContainerClientConfiguration instance.public java.lang.String toString()
toString in class PropertyContainer