com.amazonaws
Class ClientConfiguration

java.lang.Object
  extended by com.amazonaws.ClientConfiguration

public class ClientConfiguration
extends java.lang.Object

Client configuration options such as proxy settings, user agent string, max retry attempts, etc.


Field Summary
static int DEFAULT_CONNECTION_TIMEOUT
          The default timeout for creating new connections.
static int DEFAULT_MAX_CONNECTIONS
          The default max connection pool size.
static RetryPolicy DEFAULT_RETRY_POLICY
          Default request retry policy, including the maximum retry count of 3, the default retry condition and the default back-off strategy.
static int DEFAULT_SOCKET_TIMEOUT
          The default timeout for reading from a connected socket.
static boolean DEFAULT_USE_REAPER
          The default on whether to use the IdleConnectionReaper to manage stale connections
static java.lang.String DEFAULT_USER_AGENT
          The default HTTP user agent header for AWS Java SDK clients.
 
Constructor Summary
ClientConfiguration()
           
ClientConfiguration(ClientConfiguration other)
           
 
Method Summary
 int getConnectionTimeout()
          Returns the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.
 java.net.InetAddress getLocalAddress()
          Returns the optional local address the client will bind to.
 int getMaxConnections()
          Returns the maximum number of allowed open HTTP connections.
 int getMaxErrorRetry()
          Returns the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from a service).
 Protocol getProtocol()
          Returns the protocol (HTTP or HTTPS) to use when connecting to Amazon Web Services.
 java.lang.String getProxyDomain()
          Returns the optional Windows domain name for configuring an NTLM proxy.
 java.lang.String getProxyHost()
          Returns the optional proxy host the client will connect through.
 java.lang.String getProxyPassword()
          Returns the optional proxy password to use when connecting through a proxy.
 int getProxyPort()
          Returns the optional proxy port the client will connect through.
 java.lang.String getProxyUsername()
          Returns the optional proxy user name to use if connecting through a proxy.
 java.lang.String getProxyWorkstation()
          Returns the optional Windows workstation name for configuring NTLM proxy support.
 RetryPolicy getRetryPolicy()
          Returns the retry policy upon failed requests.
 java.lang.String getSignerOverride()
          Returns the name of the signature algorithm to use for signing requests made by this client.
 int[] getSocketBufferSizeHints()
          Returns the optional size hints (in bytes) for the low level TCP send and receive buffers.
 int getSocketTimeout()
          Returns the amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed.
 java.lang.String getUserAgent()
          Returns the HTTP user agent header to send with all requests.
 boolean isPreemptiveBasicProxyAuth()
          Returns whether to attempt to authenticate preemptively against proxy servers using basic authentication
 void setConnectionTimeout(int connectionTimeout)
          Sets the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.
 void setLocalAddress(java.net.InetAddress localAddress)
          Sets the optional local address the client will bind to.
 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 (ex: 5xx error responses from services).
 void setPreemptiveBasicProxyAuth(java.lang.Boolean preemptiveBasicProxyAuth)
          Sets whether to attempt to authenticate preemptively against proxy servers using basic authentication
 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 proxyPassword)
          Sets the optional proxy password to use when connecting through a proxy.
 void setProxyPort(int proxyPort)
          Sets the optional proxy port the client will connect through.
 void setProxyUsername(java.lang.String proxyUsername)
          Sets the optional proxy user name 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 setRetryPolicy(RetryPolicy retryPolicy)
          Sets the retry policy upon failed requests.
 void setSignerOverride(java.lang.String value)
          Sets the name of the signature algorithm to use for signing requests made by this client.
 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 to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed.
 void setUserAgent(java.lang.String userAgent)
          Sets the HTTP user agent header to send with all requests.
 void setUseReaper(boolean use)
          Sets whether the IdleConnectionReaper is to be started as a daemon thread
 boolean useReaper()
          Checks if the IdleConnectionReaper is to be started
 ClientConfiguration withConnectionTimeout(int connectionTimeout)
          Sets the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out, and returns the updated ClientConfiguration object so that additional method calls may be chained together.
 ClientConfiguration withLocalAddress(java.net.InetAddress localAddress)
          Sets the optional local address the client will bind to and returns the updated ClientConfiguration object.
 ClientConfiguration withMaxConnections(int maxConnections)
          Sets the maximum number of allowed open HTTP connections and returns the updated ClientConfiguration object.
 ClientConfiguration withMaxErrorRetry(int maxErrorRetry)
          Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from services), and returns the updated ClientConfiguration object.
 ClientConfiguration withPreemptiveBasicProxyAuth(boolean preemptiveBasicProxyAuth)
          Sets whether to attempt to authenticate preemptively against proxy servers using basic authentication, and returns the updated ClientConfiguration object so that additional method calls may be chained together.
 ClientConfiguration withProtocol(Protocol protocol)
          Sets the protocol (i.e.
 ClientConfiguration withProxyDomain(java.lang.String proxyDomain)
          Sets the optional Windows domain name for configuration an NTLM proxy and returns a reference to this updated ClientConfiguration object so that additional method calls can be chained together.
 ClientConfiguration withProxyHost(java.lang.String proxyHost)
          Sets the optional proxy host the client will connect through and returns the updated ClientConfiguration object.
 ClientConfiguration withProxyPassword(java.lang.String proxyPassword)
          Sets the optional proxy password to use when connecting through a proxy, and returns the updated ClientConfiguration object.
 ClientConfiguration withProxyPort(int proxyPort)
          Sets the optional proxy port the client will connect through and returns the updated ClientConfiguration object.
 ClientConfiguration withProxyUsername(java.lang.String proxyUsername)
          Sets the optional proxy user name and returns 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 so that additional method calls can be chained together.
 ClientConfiguration withReaper(boolean use)
          Sets whether the IdleConnectionReaper is to be started as a daemon thread
 ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy)
          Sets the retry policy upon failed requests, and returns the updated ClientConfiguration object.
 ClientConfiguration withSignerOverride(java.lang.String value)
          Sets the name of the signature algorithm to use for signing requests made by this client.
 ClientConfiguration withSocketBufferSizeHints(int socketSendBufferSizeHint, int socketReceiveBufferSizeHint)
          Sets the optional size hints (in bytes) for the low level TCP send and receive buffers, and returns the updated ClientConfiguration object so that additional method calls may be chained together.
 ClientConfiguration withSocketTimeout(int socketTimeout)
          Sets the amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed, and returns the updated ClientConfiguration object so that additional method calls may be chained together.
 ClientConfiguration withUserAgent(java.lang.String userAgent)
          Sets the HTTP user agent header used in requests and returns the updated ClientConfiguration object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECTION_TIMEOUT

public static final int DEFAULT_CONNECTION_TIMEOUT
The default timeout for creating new connections.

See Also:
Constant Field Values

DEFAULT_SOCKET_TIMEOUT

public static final int DEFAULT_SOCKET_TIMEOUT
The default timeout for reading from a connected socket.

See Also:
Constant Field Values

DEFAULT_MAX_CONNECTIONS

public static final int DEFAULT_MAX_CONNECTIONS
The default max connection pool size.

See Also:
Constant Field Values

DEFAULT_USER_AGENT

public static final java.lang.String DEFAULT_USER_AGENT
The default HTTP user agent header for AWS Java SDK clients.


DEFAULT_RETRY_POLICY

public static final RetryPolicy DEFAULT_RETRY_POLICY
Default request retry policy, including the maximum retry count of 3, the default retry condition and the default back-off strategy.

Note this default policy might be overridden by a service-specific default policy, if the user doesn't provide a custom RetryPolicy implementation by setRetryPolicy(RetryPolicy). For example, AmazonDynamoDBClient by default uses a different retry policy PredefinedRetryPolicies.DYNAMODB_DEFAULT.

See Also:
PredefinedRetryPolicies.DEFAULT, PredefinedRetryPolicies.DYNAMODB_DEFAULT

DEFAULT_USE_REAPER

public static final boolean DEFAULT_USE_REAPER
The default on whether to use the IdleConnectionReaper to manage stale connections

See Also:
IdleConnectionReaper, Constant Field Values
Constructor Detail

ClientConfiguration

public ClientConfiguration()

ClientConfiguration

public ClientConfiguration(ClientConfiguration other)
Method Detail

getProtocol

public Protocol getProtocol()
Returns the protocol (HTTP or HTTPS) to use when connecting to Amazon Web Services.

The default configuration is to use HTTPS for all requests for increased security.

Individual clients can also override this setting by explicitly including the protocol as part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String).

Returns:
The protocol to use when connecting to Amazon Web Services.

setProtocol

public void setProtocol(Protocol protocol)
Sets the protocol (i.e. HTTP or HTTPS) to use when connecting to Amazon Web Services.

The default configuration is to use HTTPS for all requests for increased security.

Individual clients can also override this setting by explicitly including the protocol as part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String).

Parameters:
protocol - The protocol to use when connecting to Amazon Web Services.

withProtocol

public ClientConfiguration withProtocol(Protocol protocol)
Sets the protocol (i.e. HTTP or HTTPS) to use when connecting to Amazon Web Services, and returns the updated ClientConfiguration object so that additional calls may be chained together.

The default configuration is to use HTTPS for all requests for increased security.

Individual clients can also override this setting by explicitly including the protocol as part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String).

Parameters:
protocol - The protocol to use when connecting to Amazon Web Services.
Returns:
The updated ClientConfiguration object with the new max HTTP connections setting.

getMaxConnections

public int getMaxConnections()
Returns the maximum number of allowed open HTTP connections.

Returns:
The maximum number of allowed open HTTP connections.

setMaxConnections

public void setMaxConnections(int maxConnections)
Sets the maximum number of allowed open HTTP connections.

Parameters:
maxConnections - The maximum number of allowed open HTTP connections.

withMaxConnections

public ClientConfiguration withMaxConnections(int maxConnections)
Sets the maximum number of allowed open HTTP connections and returns the updated ClientConfiguration object.

Parameters:
maxConnections - The maximum number of allowed open HTTP connections.
Returns:
The updated ClientConfiguration object with the new max HTTP connections setting.

getUserAgent

public java.lang.String getUserAgent()
Returns the HTTP user agent header to send with all requests.

Returns:
The user agent string to use when sending requests.

setUserAgent

public void setUserAgent(java.lang.String userAgent)
Sets the HTTP user agent header to send with all requests.

Parameters:
userAgent - The user agent string to use when sending requests.

withUserAgent

public ClientConfiguration withUserAgent(java.lang.String userAgent)
Sets the HTTP user agent header used in requests and returns the updated ClientConfiguration object.

Parameters:
userAgent - The user agent string to use when sending requests.
Returns:
The updated ClientConfiguration object.

getLocalAddress

public java.net.InetAddress getLocalAddress()
Returns the optional local address the client will bind to.

Returns:
The local address the client will bind to.

setLocalAddress

public void setLocalAddress(java.net.InetAddress localAddress)
Sets the optional local address the client will bind to.

Parameters:
localAddress - The local address the client will bind to.

withLocalAddress

public ClientConfiguration withLocalAddress(java.net.InetAddress localAddress)
Sets the optional local address the client will bind to and returns the updated ClientConfiguration object.

Parameters:
localAddress - The local address the client will bind to.
Returns:
The updated ClientConfiguration object.

getProxyHost

public java.lang.String getProxyHost()
Returns the optional proxy host the client will connect through.

Returns:
The proxy host the client will connect through.

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Sets the optional proxy host the client will connect through.

Parameters:
proxyHost - The proxy host the client will connect through.

withProxyHost

public ClientConfiguration withProxyHost(java.lang.String proxyHost)
Sets the optional proxy host the client will connect through and returns the updated ClientConfiguration object.

Parameters:
proxyHost - The proxy host the client will connect through.
Returns:
The updated ClientConfiguration object.

getProxyPort

public int getProxyPort()
Returns the optional proxy port the client will connect through.

Returns:
The proxy port the client will connect through.

setProxyPort

public void setProxyPort(int proxyPort)
Sets the optional proxy port the client will connect through.

Parameters:
proxyPort - The proxy port the client will connect through.

withProxyPort

public ClientConfiguration withProxyPort(int proxyPort)
Sets the optional proxy port the client will connect through and returns the updated ClientConfiguration object.

Parameters:
proxyPort - The proxy port the client will connect through.
Returns:
The updated ClientConfiguration object.

getProxyUsername

public java.lang.String getProxyUsername()
Returns the optional proxy user name to use if connecting through a proxy.

Returns:
The optional proxy user name the configured client will use if connecting through a proxy.

setProxyUsername

public void setProxyUsername(java.lang.String proxyUsername)
Sets the optional proxy user name to use if connecting through a proxy.

Parameters:
proxyUsername - The proxy user name to use if connecting through a proxy.

withProxyUsername

public ClientConfiguration withProxyUsername(java.lang.String proxyUsername)
Sets the optional proxy user name and returns the updated ClientConfiguration object.

Parameters:
proxyUsername - The proxy user name to use if connecting through a proxy.
Returns:
The updated ClientConfiguration object.

getProxyPassword

public java.lang.String getProxyPassword()
Returns the optional proxy password to use when connecting through a proxy.

Returns:
The password to use when connecting through a proxy.

setProxyPassword

public void setProxyPassword(java.lang.String proxyPassword)
Sets the optional proxy password to use when connecting through a proxy.

Parameters:
proxyPassword - The password to use when connecting through a proxy.

withProxyPassword

public ClientConfiguration withProxyPassword(java.lang.String proxyPassword)
Sets the optional proxy password to use when connecting through a proxy, and returns the updated ClientConfiguration object.

Parameters:
proxyPassword - The password to use when connecting through a proxy.
Returns:
The updated ClientConfiguration object.

getProxyDomain

public java.lang.String getProxyDomain()
Returns the optional Windows domain name for configuring an NTLM proxy. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Returns:
The optional Windows domain name for configuring an NTLM proxy.

setProxyDomain

public void setProxyDomain(java.lang.String proxyDomain)
Sets the optional Windows domain name for configuration an NTLM proxy. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Parameters:
proxyDomain - The optional Windows domain name for configuring an NTLM proxy.

withProxyDomain

public ClientConfiguration withProxyDomain(java.lang.String proxyDomain)
Sets the optional Windows domain name for configuration an NTLM proxy and returns a reference to this updated ClientConfiguration object so that additional method calls can be chained together. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Parameters:
proxyDomain - The optional Windows domain name for configuring an NTLM proxy.
Returns:
The updated ClientConfiguration object.

getProxyWorkstation

public java.lang.String getProxyWorkstation()
Returns the optional Windows workstation name for configuring NTLM proxy support. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Returns:
The optional Windows workstation name for configuring NTLM proxy support.

setProxyWorkstation

public void setProxyWorkstation(java.lang.String proxyWorkstation)
Sets the optional Windows workstation name for configuring NTLM proxy support. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Parameters:
proxyWorkstation - The optional Windows workstation name for configuring NTLM proxy support.

withProxyWorkstation

public ClientConfiguration withProxyWorkstation(java.lang.String proxyWorkstation)
Sets the optional Windows workstation name for configuring NTLM proxy support, and returns the updated ClientConfiguration object so that additional method calls can be chained together. If you aren't using a Windows NTLM proxy, you do not need to set this field.

Parameters:
proxyWorkstation - The optional Windows workstation name for configuring NTLM proxy support.
Returns:
The updated ClientConfiguration object.

getRetryPolicy

public RetryPolicy getRetryPolicy()
Returns the retry policy upon failed requests.

Returns:
The retry policy upon failed requests.

setRetryPolicy

public void setRetryPolicy(RetryPolicy retryPolicy)
Sets the retry policy upon failed requests. User could specify whether the RetryPolicy should honor maxErrorRetry set by setMaxErrorRetry(int).

Parameters:
retryPolicy - The retry policy upon failed requests.

withRetryPolicy

public ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy)
Sets the retry policy upon failed requests, and returns the updated ClientConfiguration object. User could specify whether the RetryPolicy should honor maxErrorRetry set by setMaxErrorRetry(int)

Parameters:
retryPolicy - The retry policy upon failed requests.

getMaxErrorRetry

public int getMaxErrorRetry()
Returns the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from a service). This method returns -1 before a maxErrorRetry value is explicitly set by setMaxErrorRetry(int), in which case the configured RetryPolicy will be used to control the retry count.

Returns:
The maximum number of retry attempts for failed retryable requests, or -1 if maxErrorRetry has not been set by setMaxErrorRetry(int).

setMaxErrorRetry

public void setMaxErrorRetry(int maxErrorRetry)
Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from services).

Parameters:
maxErrorRetry - The maximum number of retry attempts for failed retryable requests. This value should not be negative.

withMaxErrorRetry

public ClientConfiguration withMaxErrorRetry(int maxErrorRetry)
Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from services), and returns the updated ClientConfiguration object.

Parameters:
maxErrorRetry - The maximum number of retry attempts for failed retryable requests. This value should not be negative.
Returns:
The updated ClientConfiguration object.

getSocketTimeout

public int getSocketTimeout()
Returns the amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed. A value of 0 means infinity, and isn't recommended.

Returns:
The amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed.

setSocketTimeout

public void setSocketTimeout(int socketTimeout)
Sets the amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed. A value of 0 means infinity, and isn't recommended.

Parameters:
socketTimeout - The amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection is times out and is closed.

withSocketTimeout

public ClientConfiguration withSocketTimeout(int socketTimeout)
Sets the amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed, and returns the updated ClientConfiguration object so that additional method calls may be chained together.

Parameters:
socketTimeout - The amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection is times out and is closed.
Returns:
The updated ClientConfiguration object.

getConnectionTimeout

public int getConnectionTimeout()
Returns the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out. A value of 0 means infinity, and is not recommended.

Returns:
The amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)
Sets the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out. A value of 0 means infinity, and is not recommended.

Parameters:
connectionTimeout - The amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.

withConnectionTimeout

public ClientConfiguration withConnectionTimeout(int connectionTimeout)
Sets the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out, and returns the updated ClientConfiguration object so that additional method calls may be chained together.

Parameters:
connectionTimeout - the amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.
Returns:
The updated ClientConfiguration object.

useReaper

public boolean useReaper()
Checks if the IdleConnectionReaper is to be started

Returns:
if the IdleConnectionReaper is to be started

setUseReaper

public void setUseReaper(boolean use)
Sets whether the IdleConnectionReaper is to be started as a daemon thread

Parameters:
use - whether the IdleConnectionReaper is to be started as a daemon thread
See Also:
IdleConnectionReaper

withReaper

public ClientConfiguration withReaper(boolean use)
Sets whether the IdleConnectionReaper is to be started as a daemon thread

Parameters:
use - the IdleConnectionReaper is to be started as a daemon thread
Returns:
The updated ClientConfiguration object.

getSocketBufferSizeHints

public int[] getSocketBufferSizeHints()
Returns the optional size hints (in bytes) for the low level TCP send and receive buffers. This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance.

The optimal TCP buffer sizes for a particular application are highly dependent on network configuration and operating system configuration and capabilities. For example, most modern operating systems provide auto-tuning functionality for TCP buffer sizes, which can have a big impact on performance for TCP connections that are held open long enough for the auto-tuning to optimize buffer sizes.

Large buffer sizes (ex: 2MB) will allow the operating system to buffer more data in memory without requiring the remote server to acknowledge receipt of that information, so can be particularly useful when the network has high latency.

This is only a hint, and the operating system may choose not to honor it. When using this option, users should always check the operating system's configured limits and defaults. Most OS's have a maximum TCP buffer size limit configured, and won't let you go beyond that limit unless you explicitly raise the max TCP buffer size limit.

There are many resources available online to help with configuring TCP buffer sizes and operating system specific TCP settings, including:

Returns:
A two element array containing first the TCP send buffer size hint and then the TCP receive buffer size hint.

setSocketBufferSizeHints

public void setSocketBufferSizeHints(int socketSendBufferSizeHint,
                                     int socketReceiveBufferSizeHint)
Sets the optional size hints (in bytes) for the low level TCP send and receive buffers. This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance.

The optimal TCP buffer sizes for a particular application are highly dependent on network configuration and operating system configuration and capabilities. For example, most modern operating systems provide auto-tuning functionality for TCP buffer sizes, which can have a big impact on performance for TCP connections that are held open long enough for the auto-tuning to optimize buffer sizes.

Large buffer sizes (ex: 2MB) will allow the operating system to buffer more data in memory without requiring the remote server to acknowledge receipt of that information, so can be particularly useful when the network has high latency.

This is only a hint, and the operating system may choose not to honor it. When using this option, users should always check the operating system's configured limits and defaults. Most OS's have a maximum TCP buffer size limit configured, and won't let you go beyond that limit unless you explicitly raise the max TCP buffer size limit.

There are many resources available online to help with configuring TCP buffer sizes and operating system specific TCP settings, including:

Parameters:
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.

withSocketBufferSizeHints

public ClientConfiguration withSocketBufferSizeHints(int socketSendBufferSizeHint,
                                                     int socketReceiveBufferSizeHint)
Sets the optional size hints (in bytes) for the low level TCP send and receive buffers, and returns the updated ClientConfiguration object so that additional method calls may be chained together.

This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance.

The optimal TCP buffer sizes for a particular application are highly dependent on network configuration and operating system configuration and capabilities. For example, most modern operating systems provide auto-tuning functionality for TCP buffer sizes, which can have a big impact on performance for TCP connections that are held open long enough for the auto-tuning to optimize buffer sizes.

Large buffer sizes (ex: 2MB) will allow the operating system to buffer more data in memory without requiring the remote server to acknowledge receipt of that information, so can be particularly useful when the network has high latency.

This is only a hint, and the operating system may choose not to honor it. When using this option, users should always check the operating system's configured limits and defaults. Most OS's have a maximum TCP buffer size limit configured, and won't let you go beyond that limit unless you explicitly raise the max TCP buffer size limit.

There are many resources available online to help with configuring TCP buffer sizes and operating system specific TCP settings, including:

Parameters:
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.
Returns:
The updated ClientConfiguration object.

getSignerOverride

public java.lang.String getSignerOverride()
Returns the name of the signature algorithm to use for signing requests made by this client. If not set or explicitly set to null, the client will choose a signature algorithm to use based on a configuration file of supported signature algorithms for the service and region.

Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.

Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.

If non-null, the name returned from this method is used to look up a Signer class implementing the chosen algorithm by the com.amazonaws.auth.SignerFactory class.

Returns:
The signature algorithm to use for this client, or null to use the default.

setSignerOverride

public void setSignerOverride(java.lang.String value)
Sets the name of the signature algorithm to use for signing requests made by this client. If not set or explicitly set to null, the client will choose a signature algorithm to use based on a configuration file of supported signature algorithms for the service and region.

Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.

Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.

If non-null, the name returned from this method is used to look up a Signer class implementing the chosen algorithm by the com.amazonaws.auth.SignerFactory class.

Parameters:
value - The signature algorithm to use for this client, or null to use the default.

withSignerOverride

public ClientConfiguration withSignerOverride(java.lang.String value)
Sets the name of the signature algorithm to use for signing requests made by this client. If not set or explicitly set to null, the client will choose a signature algorithm to use based on a configuration file of supported signature algorithms for the service and region.

Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.

Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.

If non-null, the name returned from this method is used to look up a Signer class implementing the chosen algorithm by the com.amazonaws.auth.SignerFactory class.

Parameters:
value - The signature algorithm to use for this client, or null to use the default.
Returns:
The updated ClientConfiguration object.

isPreemptiveBasicProxyAuth

public boolean isPreemptiveBasicProxyAuth()
Returns whether to attempt to authenticate preemptively against proxy servers using basic authentication

Returns:
Whether to authenticate preemptively against proxy server.

setPreemptiveBasicProxyAuth

public void setPreemptiveBasicProxyAuth(java.lang.Boolean preemptiveBasicProxyAuth)
Sets whether to attempt to authenticate preemptively against proxy servers using basic authentication

Parameters:
preemptiveBasicProxyAuth - Whether to authenticate preemptively against proxy server.

withPreemptiveBasicProxyAuth

public ClientConfiguration withPreemptiveBasicProxyAuth(boolean preemptiveBasicProxyAuth)
Sets whether to attempt to authenticate preemptively against proxy servers using basic authentication, and returns the updated ClientConfiguration object so that additional method calls may be chained together.

Parameters:
preemptiveBasicProxyAuth - Whether to authenticate preemptively against proxy server.
Returns:
The updated ClientConfiguration objectt=


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.