Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
    *
    * Licensed under the Apache License, Version 2.0 (the "License").
    * You may not use this file except in compliance with the License.
    * A copy of the License is located at
    *
    *  http://aws.amazon.com/apache2.0
    *
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  package com.amazonaws;
  
  
  
Client configuration options such as proxy settings, user agent string, max retry attempts, etc.
  
  public class ClientConfiguration {

    
The default timeout for creating new connections.
  
      public static final int DEFAULT_CONNECTION_TIMEOUT = 50 * 1000;

    
The default timeout for reading from a connected socket.
  
      public static final int DEFAULT_SOCKET_TIMEOUT = 50 * 1000;

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

    
The default HTTP user agent header for AWS Java SDK clients.
  
      public static final String DEFAULT_USER_AGENT = VersionInfoUtils.getUserAgent();

    
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(com.amazonaws.retry.RetryPolicy). For example, AmazonDynamoDBClient by default uses a different retry policy com.amazonaws.retry.PredefinedRetryPolicies.DYNAMODB_DEFAULT.

  
      public static final RetryPolicy DEFAULT_RETRY_POLICY = .;

    
The default on whether to use the com.amazonaws.http.IdleConnectionReaper to manage stale connections

  
      public static final boolean DEFAULT_USE_REAPER = true;

    
The default on whether to use gzip compression.
  
      public static final boolean DEFAULT_USE_GZIP = false;

    
The default expiration time (in milliseconds) for a connection in the connection pool.
  
      public static final long DEFAULT_CONNECTION_TTL = -1;

    
The default on whether to use TCP KeepAlive.
  
      public static final boolean DEFAULT_TCP_KEEP_ALIVE = false;

    
The HTTP user agent header passed with all HTTP requests.
  
      private String userAgent = ;

    
The maximum number of times that a retryable failed request (ex: a 5xx response from a service) will be retried. Or -1 if the user has not explicitly set this value, in which case the configured RetryPolicy will be used to control the retry count.
  
      private int maxErrorRetry = -1;

    
The retry policy upon failed requests.
  
      private RetryPolicy retryPolicy = ;

    
Optionally specifies the local address to bind to
  
      private InetAddress localAddress;

    
The protocol to use when connecting to Amazon Web Services.

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

 
     private Protocol protocol = .;

    
Optionally specifies the proxy host to connect through.
 
     private String proxyHost = null;

    
Optionally specifies the port on the proxy host to connect through.
 
     private int proxyPort = -1;

    
Optionally specifies the user name to use when connecting through a proxy.
 
     private String proxyUsername = null;

    
Optionally specifies the password to use when connecting through a proxy.
 
     private String proxyPassword = null;

    
Optional Windows domain name for configuring NTLM proxy support.
 
     private String proxyDomain = null;

    
Optional Windows workstation name for configuring NTLM proxy support.
 
     private String proxyWorkstation = null;

    
Whether to pre-emptively authenticate against a proxy server using basic authentication
 
     private boolean preemptiveBasicProxyAuth;

    
The maximum number of open HTTP connections.
 
     private int maxConnections = ;

    
The amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection is timed out. A value of 0 means infinity, and is not recommended.
 
     private int socketTimeout = ;

    
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.
 
     private int connectionTimeout = ;

    
Optional size hint (in bytes) for the low level TCP send buffer. This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance.
 
     private int socketSendBufferSizeHint = 0;

    
Optional size hint (in bytes) for the low level TCP receive buffer. This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance.
 
     private int socketReceiveBufferSizeHint = 0;

    
Optional whether to use the com.amazonaws.http.IdleConnectionReaper to manage stale connections. A reason for not running the com.amazonaws.http.IdleConnectionReaper can be if running in an environment where the modifyThread and modifyThreadGroup permissions are not allowed.
 
     private boolean useReaper = ;

    
Optional whether to use gzip compression when making HTTP requests.
 
     private boolean useGzip = ;

    
Optional override to control which signature algorithm should be used to sign requests to the service. If not explicitly set, the client will determine the algorithm to use by inspecting a configuration file baked in to the SDK.
 
     private String signerOverride;

    
Optional expiration time for a connection in the connection pool. When a connection is retrieved from the connection pool, this parameter is checked to see if the connection can be reused.
 
     private long connectionTTL = ;

    
Optional override to enable support for TCP KeepAlive (not to be confused with HTTP KeepAlive). TCP KeepAlive can be used to detect misbehaving routers or down servers through the use of special, empty-data keep alive packets.

Actual TCP KeepAlive values (timeout, number of packets, etc) are configured via the operating system (sysctl on Linux, and Registry values on Windows).

 
     private boolean tcpKeepAlive = ;
    
    
Can be used to specify custom specific Apache HTTP client configurations.
 
 
     public ClientConfiguration() {
     }
 
     public ClientConfiguration(ClientConfiguration other) {
         this.           = other.connectionTimeout;
         this.              = other.maxConnections;
         this.               = other.maxErrorRetry;
         this.                 = other.retryPolicy;
         this.                = other.localAddress;
         this.                    = other.protocol;
         this.                 = other.proxyDomain;
         this.                   = other.proxyHost;
         this.               = other.proxyPassword;
         this.                   = other.proxyPort;
         this.               = other.proxyUsername;
         this.            = other.proxyWorkstation;
         this.    = other.preemptiveBasicProxyAuth;
         this.               = other.socketTimeout;
         this.                   = other.userAgent;
         this.                   = other.useReaper;
         this.                     = other.useGzip;
         this. = other.socketReceiveBufferSizeHint;
         this.    = other.socketSendBufferSizeHint;
         this.              = other.signerOverride;
         this. =
             new ApacheHttpClientConfig(other.apacheHttpClientConfig);
     }

    
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(java.lang.String).

Returns:
The protocol to use when connecting to Amazon Web Services.
 
     public Protocol getProtocol() {
         return ;
     }

    
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(java.lang.String).

Parameters:
protocol The protocol to use when connecting to Amazon Web Services.
 
     public void setProtocol(Protocol protocol) {
         this. = 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(java.lang.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.
 
     public ClientConfiguration withProtocol(Protocol protocol) {
         setProtocol(protocol);
         return this;
     }

    
Returns the maximum number of allowed open HTTP connections.

Returns:
The maximum number of allowed open HTTP connections.
 
     public int getMaxConnections() {
         return ;
     }

    
Sets the maximum number of allowed open HTTP connections.

Parameters:
maxConnections The maximum number of allowed open HTTP connections.
 
     public void setMaxConnections(int maxConnections) {
         this. = 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.
 
     public ClientConfiguration withMaxConnections(int maxConnections) {
         setMaxConnections(maxConnections);
         return this;
     }

    
Returns the HTTP user agent header to send with all requests.

Returns:
The user agent string to use when sending requests.
 
     public String getUserAgent() {
         return ;
     }

    
Sets the HTTP user agent header to send with all requests.

Parameters:
userAgent The user agent string to use when sending requests.
 
     public void setUserAgent(String userAgent) {
         this. = 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.
 
     public ClientConfiguration withUserAgent(String userAgent) {
         setUserAgent(userAgent);
         return this;
     }

    
Returns the optional local address the client will bind to.

Returns:
The local address the client will bind to.
 
     public InetAddress getLocalAddress() {
         return ;
     }

    
Sets the optional local address the client will bind to.

Parameters:
localAddress The local address the client will bind to.
 
     public void setLocalAddress(InetAddress localAddress) {
         this. = 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.
 
     public ClientConfiguration withLocalAddress(InetAddress localAddress) {
       setLocalAddress(localAddress);
       return this;
     }

    
Returns the optional proxy host the client will connect through.

Returns:
The proxy host the client will connect through.
 
     public String getProxyHost() {
         return ;
     }

    
Sets the optional proxy host the client will connect through.

Parameters:
proxyHost The proxy host the client will connect through.
 
     public void setProxyHost(String proxyHost) {
         this. = 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.
 
     public ClientConfiguration withProxyHost(String proxyHost) {
         setProxyHost(proxyHost);
         return this;
     }

    
Returns the optional proxy port the client will connect through.

Returns:
The proxy port the client will connect through.
 
     public int getProxyPort() {
         return ;
     }

    
Sets the optional proxy port the client will connect through.

Parameters:
proxyPort The proxy port the client will connect through.
 
     public void setProxyPort(int proxyPort) {
         this. = 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.
 
     public ClientConfiguration withProxyPort(int proxyPort) {
         setProxyPort(proxyPort);
         return this;
     }

    
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.
 
     public String getProxyUsername() {
         return ;
     }

    
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.
 
     public void setProxyUsername(String proxyUsername) {
         this. = 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.
 
     public ClientConfiguration withProxyUsername(String proxyUsername) {
         setProxyUsername(proxyUsername);
         return this;
     }

    
Returns the optional proxy password to use when connecting through a proxy.

Returns:
The password to use when connecting through a proxy.
 
     public String getProxyPassword() {
         return ;
     }

    
Sets the optional proxy password to use when connecting through a proxy.

Parameters:
proxyPassword The password to use when connecting through a proxy.
 
     public void setProxyPassword(String proxyPassword) {
         this. = 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.
 
     public ClientConfiguration withProxyPassword(String proxyPassword) {
         setProxyPassword(proxyPassword);
         return this;
     }

    
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.
 
     public String getProxyDomain() {
         return ;
     }

    
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.
 
     public void setProxyDomain(String proxyDomain) {
         this. = 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.
 
     public ClientConfiguration withProxyDomain(String proxyDomain) {
         setProxyDomain(proxyDomain);
         return this;
     }

    
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.
 
     public String getProxyWorkstation() {
         return ;
     }

    
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.
 
     public void setProxyWorkstation(String proxyWorkstation) {
         this. = 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.
 
     public ClientConfiguration withProxyWorkstation(String proxyWorkstation) {
         setProxyWorkstation(proxyWorkstation);
         return this;
     }

    
Returns the retry policy upon failed requests.

Returns:
The retry policy upon failed requests.
 
     public RetryPolicy getRetryPolicy() {
         return ;
     }

    
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.
 
     public void setRetryPolicy(RetryPolicy retryPolicy) {
         this. = 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.
 
     public ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy) {
         setRetryPolicy(retryPolicy);
         return this;
     }

    
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).
 
     public int getMaxErrorRetry() {
         return ;
     }

    
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.
 
     public void setMaxErrorRetry(int maxErrorRetry) {
         if (maxErrorRetry < 0) {
             throw new IllegalArgumentException("maxErrorRetry shoud be non-negative");
         }
         this. = 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.
 
     public ClientConfiguration withMaxErrorRetry(int maxErrorRetry) {
         setMaxErrorRetry(maxErrorRetry);
         return this;
     }

    
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.
 
     public int getSocketTimeout() {
         return ;
     }

    
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.
 
     public void setSocketTimeout(int socketTimeout) {
         this. = 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.
 
     public ClientConfiguration withSocketTimeout(int socketTimeout) {
         setSocketTimeout(socketTimeout);
         return this;
     }

    
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.
 
     public int getConnectionTimeout() {
         return ;
     }

    
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.
 
     public void setConnectionTimeout(int connectionTimeout) {
         this. = 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.
 
     public ClientConfiguration withConnectionTimeout(int connectionTimeout) {
         setConnectionTimeout(connectionTimeout);
         return this;
     }

    
Checks if the com.amazonaws.http.IdleConnectionReaper is to be started

Returns:
if the com.amazonaws.http.IdleConnectionReaper is to be started
 
     public boolean useReaper() {
         return ;
     }

    
Sets whether the com.amazonaws.http.IdleConnectionReaper is to be started as a daemon thread

Parameters:
use whether the com.amazonaws.http.IdleConnectionReaper is to be started as a daemon thread
See also:
com.amazonaws.http.IdleConnectionReaper
 
     public void setUseReaper(boolean use) {
         this. = use;
     }

    
Sets whether the com.amazonaws.http.IdleConnectionReaper is to be started as a daemon thread

Parameters:
use the com.amazonaws.http.IdleConnectionReaper is to be started as a daemon thread
Returns:
The updated ClientConfiguration object.
 
     public ClientConfiguration withReaper(boolean use) {
         setUseReaper(use);
         return this;
     }

    
Checks if gzip compression is used

Returns:
if gzip compression is used
 
     public boolean useGzip() {
         return ;
     }

    
Sets whether gzip compression should be used

Parameters:
use whether gzip compression should be used
 
     public void setUseGzip(boolean use) {
         this. = use;
     }

    
Sets whether gzip compression should be used

Parameters:
use whether gzip compression should be used
Returns:
The updated ClientConfiguration object.
 
     public ClientConfiguration withGzip(boolean use) {
         setUseGzip(use);
         return this;
     }

    
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:

  • http://onlamp.com/pub/a/onlamp/2005/11/17/tcp_tuning.html
  • http://fasterdata.es.net/TCP-tuning/

Returns:
A two element array containing first the TCP send buffer size hint and then the TCP receive buffer size hint.
 
     public int[] getSocketBufferSizeHints() {
         return new int[] {};
     }

    
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:

  • http://onlamp.com/pub/a/onlamp/2005/11/17/tcp_tuning.html
  • http://fasterdata.es.net/TCP-tuning/

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.
 
     public void setSocketBufferSizeHints(
             int socketSendBufferSizeHintint socketReceiveBufferSizeHint) {
         this. = socketSendBufferSizeHint;
         this. = 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:

  • http://onlamp.com/pub/a/onlamp/2005/11/17/tcp_tuning.html
  • http://fasterdata.es.net/TCP-tuning/

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.
 
             int socketSendBufferSizeHintint socketReceiveBufferSizeHint) {
         setSocketBufferSizeHints(socketSendBufferSizeHintsocketReceiveBufferSizeHint);
         return this;
     }

    
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.
 
     public String getSignerOverride() {
         return ;
     }

    
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.
    public void setSignerOverride(final String value) {
         = 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.
    public ClientConfiguration withSignerOverride(final String value) {
        setSignerOverride(value);
        return this;
    }

    
Returns whether to attempt to authenticate preemptively against proxy servers using basic authentication

Returns:
Whether to authenticate preemptively against proxy server.
    public boolean isPreemptiveBasicProxyAuth() {
        return ;
    }

    
Sets whether to attempt to authenticate preemptively against proxy servers using basic authentication

Parameters:
preemptiveBasicProxyAuth Whether to authenticate preemptively against proxy server.
    public void setPreemptiveBasicProxyAuth(Boolean preemptiveBasicProxyAuth) {
        this. = 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 object.
    public ClientConfiguration withPreemptiveBasicProxyAuth(boolean preemptiveBasicProxyAuth) {
        setPreemptiveBasicProxyAuth(preemptiveBasicProxyAuth);
        return this;
    }

    
Returns the expiration time(in milliseconds) for a connection in the connection pool.
    public long getConnectionTTL() {
        return ;
    }

    
Sets the expiration time(in milliseconds) for a connection in the connection pool. By default, it is set to -1 i.e., connections don't have an expiration time.
    public void setConnectionTTL(long connectionTTL) {
        this. = connectionTTL;
    }

    
Sets the expiration time(in milliseconds) for a connection in the connection pool. By default, it is set to -1 i.e., connections don't have an expiration time.

Returns:
The updated ClientConfiguration object.
    public ClientConfiguration withConnectionTTL(long connectionTTL) {
        setConnectionTTL(connectionTTL);
        return this;
    }

    
Returns whether or not TCP KeepAlive support is enabled.
    public boolean useTcpKeepAlive() {
        return ;
    }

    
Sets whether or not to enable TCP KeepAlive support at the socket level.
    public void setUseTcpKeepAlive(final boolean use) {
        this. = use;
    }

    
Sets whether or not to enable TCP KeepAlive support at the socket level.

Returns:
The updated ClientConfiguration object.
    public ClientConfiguration withTcpKeepAlive(final boolean use) {
        setUseTcpKeepAlive(use);
        return this;
    }

    
Returns a non-null object that can be used to specify Apache HTTP client specific custom configurations.
        return ;
    }
New to GrepCode? Check out our FAQ X