|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.ClientConfiguration
public class ClientConfiguration
Client configuration options such as proxy settings, user agent string, max retry attempts, etc.
Field Summary | |
---|---|
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 connected socket. |
static 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. |
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. |
String |
getProxyDomain()
Returns the optional Windows domain name for configuring an NTLM proxy. |
String |
getProxyHost()
Returns the optional proxy host the client will connect through. |
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. |
String |
getProxyUsername()
Returns the optional proxy user name to use if connecting through a proxy. |
String |
getProxyWorkstation()
Returns the optional Windows workstation name for configuring NTLM proxy support. |
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. |
String |
getUserAgent()
Returns the HTTP user agent header to send with all requests. |
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 |
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 |
setProtocol(Protocol protocol)
Sets the protocol (i.e. |
void |
setProxyDomain(String proxyDomain)
Sets the optional Windows domain name for configuration an NTML proxy. |
void |
setProxyHost(String proxyHost)
Sets the optional proxy host the client will connect through. |
void |
setProxyPassword(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(String proxyUsername)
Sets the optional proxy user name to use if connecting through a proxy. |
void |
setProxyWorkstation(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 to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed. |
void |
setUserAgent(String userAgent)
Sets the HTTP user agent header to send with all requests. |
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 |
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 |
withProtocol(Protocol protocol)
Sets the protocol (i.e. |
ClientConfiguration |
withProxyDomain(String proxyDomain)
Sets the optional Windows domain name for configuration an NTML proxy and returns a reference to this updated ClientConfiguration object so that additional method calls can be chained together. |
ClientConfiguration |
withProxyHost(String proxyHost)
Sets the optional proxy host the client will connect through and returns the updated ClientConfiguration object. |
ClientConfiguration |
withProxyPassword(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(String proxyUsername)
Sets the optional proxy user name and returns the updated ClientConfiguration object. |
ClientConfiguration |
withProxyWorkstation(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 |
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(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 |
---|
public static final int DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_MAX_CONNECTIONS
public static final String DEFAULT_USER_AGENT
public static final int DEFAULT_MAX_RETRIES
Constructor Detail |
---|
public ClientConfiguration()
public ClientConfiguration(ClientConfiguration other)
Method Detail |
---|
public Protocol getProtocol()
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)
.
public void setProtocol(Protocol protocol)
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)
.
protocol
- The protocol to use when connecting to Amazon Web Services.public ClientConfiguration withProtocol(Protocol protocol)
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)
.
protocol
- The protocol to use when connecting to Amazon Web Services.
public int getMaxConnections()
public void setMaxConnections(int maxConnections)
maxConnections
- The maximum number of allowed open HTTP connections.public ClientConfiguration withMaxConnections(int maxConnections)
maxConnections
- The maximum number of allowed open HTTP connections.
public String getUserAgent()
public void setUserAgent(String userAgent)
userAgent
- The user agent string to use when sending requests.public ClientConfiguration withUserAgent(String userAgent)
userAgent
- The user agent string to use when sending requests.
public String getProxyHost()
public void setProxyHost(String proxyHost)
proxyHost
- The proxy host the client will connect through.public ClientConfiguration withProxyHost(String proxyHost)
proxyHost
- The proxy host the client will connect through.
public int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort
- The proxy port the client will connect through.public ClientConfiguration withProxyPort(int proxyPort)
proxyPort
- The proxy port the client will connect through.
public String getProxyUsername()
public void setProxyUsername(String proxyUsername)
proxyUsername
- The proxy user name to use if connecting through a proxy.public ClientConfiguration withProxyUsername(String proxyUsername)
proxyUsername
- The proxy user name to use if connecting through a proxy.
public String getProxyPassword()
public void setProxyPassword(String proxyPassword)
proxyPassword
- The password to use when connecting through a proxy.public ClientConfiguration withProxyPassword(String proxyPassword)
proxyPassword
- The password to use when connecting through a proxy.
public String getProxyDomain()
public void setProxyDomain(String proxyDomain)
proxyDomain
- The optional Windows domain name for configuring an NTLM
proxy.public ClientConfiguration withProxyDomain(String proxyDomain)
proxyDomain
- The optional Windows domain name for configuring an NTLM
proxy.
public String getProxyWorkstation()
public void setProxyWorkstation(String proxyWorkstation)
proxyWorkstation
- The optional Windows workstation name for configuring NTLM
proxy support.public ClientConfiguration withProxyWorkstation(String proxyWorkstation)
proxyWorkstation
- The optional Windows workstation name for configuring NTLM
proxy support.
public int getMaxErrorRetry()
public void setMaxErrorRetry(int maxErrorRetry)
maxErrorRetry
- The maximum number of retry attempts for failed retryable
requests.public ClientConfiguration withMaxErrorRetry(int maxErrorRetry)
maxErrorRetry
- The maximum number of retry attempts for failed retryable
requests.
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
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.public ClientConfiguration withSocketTimeout(int socketTimeout)
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.
public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout
- The amount of time to wait (in milliseconds) when initially
establishing a connection before giving up and timing out.public ClientConfiguration withConnectionTimeout(int connectionTimeout)
connectionTimeout
- the amount of time to wait (in milliseconds) when initially
establishing a connection before giving up and timing out.
public int[] getSocketBufferSizeHints()
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:
public void setSocketBufferSizeHints(int socketSendBufferSizeHint, int socketReceiveBufferSizeHint)
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:
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)
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:
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.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |