JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.793

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws

Class ClientConfiguration

    • 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_REQUEST_TIMEOUT

        public static final int DEFAULT_REQUEST_TIMEOUT
        The default timeout for a request. This is disabled by default.
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_EXECUTION_TIMEOUT

        public static final int DEFAULT_CLIENT_EXECUTION_TIMEOUT
        The default timeout for a request. This is disabled by default.
        See Also:
        Constant Field Values
      • DEFAULT_DISABLE_SOCKET_PROXY

        public static final boolean DEFAULT_DISABLE_SOCKET_PROXY
        The default on whether to disable Socket proxies.
        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_USE_EXPECT_CONTINUE

        public static final boolean DEFAULT_USE_EXPECT_CONTINUE
        The default on whether to utilize the USE_EXPECT_CONTINUE handshake for operations. Currently only honored for PUT operations.
        See Also:
        Constant Field Values
      • DEFAULT_USER_AGENT

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

        public static final boolean DEFAULT_USE_GZIP
        The default on whether to use gzip decompression.
        See Also:
        Constant Field Values
      • DEFAULT_CONNECTION_TTL

        public static final long DEFAULT_CONNECTION_TTL
        The default expiration time (in milliseconds) for a connection in the connection pool.
        See Also:
        Constant Field Values
      • DEFAULT_CONNECTION_MAX_IDLE_MILLIS

        public static final long DEFAULT_CONNECTION_MAX_IDLE_MILLIS
        The default maximum idle time (in milliseconds) for a connection in the connection pool.
        See Also:
        Constant Field Values
      • DEFAULT_VALIDATE_AFTER_INACTIVITY_MILLIS

        public static final int DEFAULT_VALIDATE_AFTER_INACTIVITY_MILLIS
        The default time a connection can be idle in the connection pool before it must be validated that it's still open.
        See Also:
        Constant Field Values
      • DEFAULT_TCP_KEEP_ALIVE

        public static final boolean DEFAULT_TCP_KEEP_ALIVE
        The default on whether to use TCP KeepAlive.
        See Also:
        Constant Field Values
      • DEFAULT_THROTTLE_RETRIES

        public static final boolean DEFAULT_THROTTLE_RETRIES
        The default on whether to throttle retries.
        See Also:
        Constant Field Values
      • DEFAULT_CACHE_RESPONSE_METADATA

        public static final boolean DEFAULT_CACHE_RESPONSE_METADATA
        The default on whether to cache response metadata.
        See Also:
        Constant Field Values
      • DEFAULT_RESPONSE_METADATA_CACHE_SIZE

        public static final int DEFAULT_RESPONSE_METADATA_CACHE_SIZE
        The default response metadata cache size.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING

        public static final int DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClientConfiguration

        public ClientConfiguration()
    • 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.
      • getUserAgentPrefix

        public String getUserAgentPrefix()
        Returns the HTTP user agent header prefix to send with all requests.
        Returns:
        The user agent string prefix to use when sending requests.
      • setUserAgentPrefix

        public void setUserAgentPrefix(String prefix)
        Sets the HTTP user agent prefix to send with all requests.
        Parameters:
        prefix - The string to prefix to user agent to use when sending requests.
      • withUserAgentPrefix

        public ClientConfiguration withUserAgentPrefix(String prefix)
        Sets the HTTP user agent prefix header used in requests and returns the updated ClientConfiguration object.
        Parameters:
        prefix - The string to prefix to user agent to use when sending requests.
        Returns:
        The updated ClientConfiguration object.
      • getUserAgentSuffix

        public String getUserAgentSuffix()
        Returns the HTTP user agent header suffix to add to the end of the user agent header on all requests.
        Returns:
        The user agent string suffix to use when sending requests.
      • setUserAgentSuffix

        public void setUserAgentSuffix(String suffix)
        Sets the HTTP user agent suffix to send with all requests.
        Parameters:
        suffix - The string to suffix to user agent to use when sending requests.
      • withUserAgentSuffix

        public ClientConfiguration withUserAgentSuffix(String suffix)
        Sets the HTTP user agent suffix header used in requests and returns the updated ClientConfiguration object.
        Parameters:
        suffix - The string to suffix to user agent to use when sending requests.
        Returns:
        The updated ClientConfiguration object.
      • getLocalAddress

        public 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(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(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.
      • getProxyProtocol

        public Protocol getProxyProtocol()
        Returns:
        The Protocol to use for connecting to the proxy.
      • withProxyProtocol

        public ClientConfiguration withProxyProtocol(Protocol proxyProtocol)
        Set the Protocol to use for connecting to the proxy.
        Parameters:
        proxyProtocol - The protocol.
        Returns:
        The updated ClientConfiguration object.
      • setProxyProtocol

        public void setProxyProtocol(Protocol proxyProtocol)
        Set the Protocol to use for connecting to the proxy.
        Parameters:
        proxyProtocol - The protocol.
      • getProxyHost

        public String getProxyHost()
        Returns the optional proxy host the client will connect through. Returns either the proxyHost set on this object, or if not provided, checks the value of the Java system property for proxy host according to getProtocol(): i.e. if protocol is https, returns the value of the system property https.proxyHost, otherwise returns value of http.proxyHost. If neither are set, checks the value of the environment variable according to getProtocol(): i.e. if protocol is https, returns the host in the value of the HTTPS_PROXY/https_proxy environment variable, otherwise returns the host in the value of the HTTP_PROXY/http_proxy environment variable.
        Returns:
        The proxy host the client will connect through.
      • setProxyHost

        public void setProxyHost(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(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 either the proxyPort set on this object, or if not provided, checks the value of the Java system property for proxy port according to getProtocol(): i.e. if protocol is https, returns the value of the system property https.proxyPort, otherwise returns value of http.proxyPort. If neither are set, checks the value of the environment variable according to getProtocol(): i.e. if protocol is https, returns the port in the value of the HTTPS_PROXY/https_proxy environment variable, otherwise returns the port in the value of the HTTP_PROXY/http_proxy environment variable.
        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.
      • withDisableSocketProxy

        public ClientConfiguration withDisableSocketProxy(boolean disableSocketProxy)
        Set whether to disable proxies at the socket level.
        Parameters:
        disableSocketProxy - Whether to disable proxies at the socket level.
        Returns:
        The updated ClientConfiguration object.
      • setDisableSocketProxy

        public void setDisableSocketProxy(boolean disableSocketProxy)
        Set whether to disable proxies at the socket level.
        Parameters:
        disableSocketProxy - Whether to disable proxies at the socket level.
      • disableSocketProxy

        public boolean disableSocketProxy()
        Returns:
        Whether to disable proxies at the socket level.
      • getProxyUsername

        public String getProxyUsername()
        Returns the optional proxy user name to use if connecting through a proxy. Returns either the proxyUsername set on this object, or if not provided, checks the value of the Java system property for proxy user name according to getProtocol(): i.e. if protocol is https, returns the value of the system property https.proxyUser, otherwise returns value of http.proxyUser. If neither are set, checks the value of the environment variable according to getProtocol(): i.e. if protocol is https, returns the user name in the value of the HTTPS_PROXY/https_proxy environment variable, otherwise returns the user name in the value of the HTTP_PROXY/http_proxy environment variable.
        Returns:
        The optional proxy user name the configured client will use if connecting through a proxy.
      • setProxyUsername

        public void setProxyUsername(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(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 String getProxyPassword()
        Returns the optional proxy password to use if connecting through a proxy. Returns either the proxyPassword set on this object, or if not provided, checks the value of the Java system property for proxy password according to getProtocol(): i.e. if protocol is https, returns the value of the system property https.proxyPassword, otherwise returns value of http.proxyPassword. If neither are set, checks the value of the environment variable according to getProtocol(): i.e. if protocol is https, returns the password in the value of the HTTPS_PROXY/https_proxy environment variable, otherwise returns the password in the value of the HTTP_PROXY/http_proxy environment variable.
        Returns:
        The password to use when connecting through a proxy.
      • setProxyPassword

        public void setProxyPassword(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(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 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(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(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 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(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(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.
      • getNonProxyHosts

        public String getNonProxyHosts()
        Returns the optional hosts the client will access without going through the proxy. Returns either the nonProxyHosts set on this object, or if not provided, returns the value of the Java system property http.nonProxyHosts. We still honor this property even when getProtocol() is https, see http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html. This property is expected to be set as a pipe separated list. If neither are set, returns the value of the environment variable NO_PROXY/no_proxy. This environment variable is expected to be set as a comma separated list.
        Returns:
        The hosts the client will connect through bypassing the proxy.
      • setNonProxyHosts

        public void setNonProxyHosts(String nonProxyHosts)
        Set the optional hosts the client will access without going through the proxy.
        Parameters:
        nonProxyHosts - The hosts the client will access without going through the proxy.
      • withNonProxyHosts

        public ClientConfiguration withNonProxyHosts(String nonProxyHosts)
        Set the optional hosts the client will access without going through the proxy.
        Parameters:
        nonProxyHosts - The hosts the client will access without going through the proxy.
        Returns:
        The updated ClientConfiguration object.
      • getProxyAuthenticationMethods

        public List<ProxyAuthenticationMethod> getProxyAuthenticationMethods()
        Returns the list of authentication methods that should be used when authenticating against an HTTP proxy, in the order they should be attempted.
        Returns:
        An unmodifiable view of the proxy authentication methods that should be attempted, in order.
      • setProxyAuthenticationMethods

        public void setProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods)
        Configure the list of authentication methods that should be used when authenticating against an HTTP proxy, in the order they should be attempted. Any methods not included in this list will not be attempted. If one authentication method fails, the next method will be attempted, until a working method is found (or all methods have been attempted).

        Setting this value to null indicates using the default behavior, which is to try all authentication methods in an unspecified order.

        Parameters:
        proxyAuthenticationMethods - The proxy authentication methods to be attempted, in the order they should be attempted.
      • withProxyAuthenticationMethods

        public ClientConfiguration withProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods)
        Configure the list of authentication methods that should be used when authenticating against an HTTP proxy, in the order they should be attempted. Any methods not included in this list will not be attempted. If one authentication method fails, the next method will be attempted, until a working method is found (or all methods have been attempted).

        Setting this value to null indicates using the default behavior, which is to try all authentication methods in an unspecified order.

        Parameters:
        proxyAuthenticationMethods - The proxy authentication methods to be attempted, in the order they should be attempted.
        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.
      • withRetryMode

        public ClientConfiguration withRetryMode(RetryMode retryMode)
        Sets the RetryMode to use
        Parameters:
        retryMode - the retryMode
        Returns:
        The updated ClientConfiguration object.
      • withAccountIdEndpointMode

        public ClientConfiguration withAccountIdEndpointMode(AccountIdEndpointMode accountIdEndpointMode)
        Sets the AccountIdEndpointMode to use
        Parameters:
        accountIdEndpointMode - the accountIdEndpointMode
        Returns:
        The updated ClientConfiguration object.
      • setRetryMode

        public void setRetryMode(RetryMode retryMode)
        Sets the RetryMode to use
        Parameters:
        retryMode - the retryMode
      • setAccountIdEndpointMode

        public void setAccountIdEndpointMode(AccountIdEndpointMode accountIdEndpointMode)
        Sets the AccountIdEndpointMode to use
        Parameters:
        accountIdEndpointMode - the accountIdEndpointMode
      • getRetryMode

        public RetryMode getRetryMode()
        Returns:
        the retryMode
      • getAccountIdEndpointMode

        public AccountIdEndpointMode getAccountIdEndpointMode()
        Returns:
        the accountIdEndpointMode
      • getSocketTimeout

        public int getSocketTimeout()
        Returns the amount of time to wait (in milliseconds) for data to be transferred 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 transferred 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 transferred 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 transferred over an established, open connection before the connection times out and is closed.
      • withSocketTimeout

        public ClientConfiguration withSocketTimeout(int socketTimeout)
        Sets the amount of time to wait (in milliseconds) for data to be transferred 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 transferred over an established, open connection before the connection 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.
      • getRequestTimeout

        public int getRequestTimeout()
        Returns the amount of time to wait (in milliseconds) for the request to complete before giving up and timing out. A non-positive value disables this feature.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the request timeout feature should not be used when absolute precision is needed.

        Note: This feature is not compatible with Java 1.6.

        Returns:
        The amount of time to wait (in milliseconds) for the request to complete before giving up and timing out.
        See Also:
        ClientConfiguration#setClientExecutionTimeout(int)} to enforce a timeout across all retries
      • setRequestTimeout

        public void setRequestTimeout(int requestTimeout)
        Sets the amount of time to wait (in milliseconds) for the request to complete before giving up and timing out. A non-positive value disables this feature.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the request timeout feature should not be used when absolute precision is needed.

        Note: This feature is not compatible with Java 1.6.

        Parameters:
        requestTimeout - The amount of time to wait (in milliseconds) for the request to complete before giving up and timing out.
        See Also:
        ClientConfiguration#setClientExecutionTimeout(int)} to enforce a timeout across all retries
      • withRequestTimeout

        public ClientConfiguration withRequestTimeout(int requestTimeout)
        Sets the amount of time to wait (in milliseconds) for the request to complete before giving up and timing out. A non-positive value disables this feature. Returns the updated ClientConfiguration object so that additional method calls may be chained together.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the request timeout feature should not be used when absolute precision is needed.

        Note: This feature is not compatible with Java 1.6.

        Parameters:
        requestTimeout - The amount of time to wait (in milliseconds) for the request to complete before giving up and timing out.
        Returns:
        The updated ClientConfiguration object.
        See Also:
        ClientConfiguration#setClientExecutionTimeout(int)} to enforce a timeout across all retries
      • getClientExecutionTimeout

        public int getClientExecutionTimeout()
        Returns the amount of time (in milliseconds) to allow the client to complete the execution of an API call. This timeout covers the entire client execution except for marshalling. This includes request handler execution, all HTTP request including retries, unmarshalling, etc.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout feature should not be used when absolute precision is needed.

        This may be used together with setRequestTimeout(int) to enforce both a timeout on each individual HTTP request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time). A non-positive value disables this feature.

        Note: This feature is not compatible with Java 1.6.

        Returns:
        The amount of time (in milliseconds) to allow the client to complete the execution of an API call.
        See Also:
        ClientConfiguration#setRequestTimeout(int)} to enforce a timeout per HTTP request
      • setClientExecutionTimeout

        public void setClientExecutionTimeout(int clientExecutionTimeout)
        Sets the amount of time (in milliseconds) to allow the client to complete the execution of an API call. This timeout covers the entire client execution except for marshalling. This includes request handler execution, all HTTP request including retries, unmarshalling, etc.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout feature should not be used when absolute precision is needed.

        This may be used together with setRequestTimeout(int) to enforce both a timeout on each individual HTTP request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time). A non-positive value disables this feature.

        Note: This feature is not compatible with Java 1.6.

        Parameters:
        clientExecutionTimeout - The amount of time (in milliseconds) to allow the client to complete the execution of an API call. A value of '0' disables this feature.
        See Also:
        ClientConfiguration#setRequestTimeout(int)} to enforce a timeout per HTTP request
      • withClientExecutionTimeout

        public ClientConfiguration withClientExecutionTimeout(int clientExecutionTimeout)
        Sets the amount of time (in milliseconds) to allow the client to complete the execution of an API call. This timeout covers the entire client execution except for marshalling. This includes request handler execution, all HTTP request including retries, unmarshalling, etc.

        This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.

        The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout feature should not be used when absolute precision is needed.

        This may be used together with setRequestTimeout(int) to enforce both a timeout on each individual HTTP request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time). A non-positive value disables this feature.

        Note: This feature is not compatible with Java 1.6.

        Parameters:
        clientExecutionTimeout - The amount of time (in milliseconds) to allow the client to complete the execution of an API call. A value of '0' disables this feature.
        Returns:
        The updated ClientConfiguration object for method chaining
        See Also:
        ClientConfiguration#setRequestTimeout(int)} to enforce a timeout per HTTP request
      • useThrottledRetries

        public boolean useThrottledRetries()
        Returns whether retry throttling will be used.

        Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.

        In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.

        Returns:
        true if retry throttling will be used
      • setUseThrottleRetries

        public void setUseThrottleRetries(boolean use)
        Sets whether throttled retries should be used

        Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.

        In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.

        Parameters:
        use - true if throttled retries should be used
      • withThrottledRetries

        public ClientConfiguration withThrottledRetries(boolean use)
        Sets whether throttled retries should be used

        Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.

        In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.

        Parameters:
        use - true if throttled retries should be used
        Returns:
        The updated ClientConfiguration object.
      • setMaxConsecutiveRetriesBeforeThrottling

        public void setMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling)
        Set the maximum number of consecutive failed retries that the client will permit before throttling all subsequent retries of failed requests.

        Note: This does not guarantee that each failed request will be retried up to this many times. Depending on the configured RetryPolicy and the number of past failed and successful requests, the actual number of retries attempted may be less.

        This has a default value of DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING.

        Parameters:
        maxConsecutiveRetriesBeforeThrottling - The maximum number of consecutive retries.
      • withMaxConsecutiveRetriesBeforeThrottling

        public ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling)
        Set the maximum number of consecutive failed retries that the client will permit before throttling all subsequent retries of failed requests.

        Note: This does not guarantee that each failed request will be retried up to this many times. Depending on the configured RetryPolicy and the number of past failed and successful requests, the actual number of retries attempted may be less.

        This has a default value of DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING.

        Parameters:
        maxConsecutiveRetriesBeforeThrottling - The maximum number of consecutive retries.
        Returns:
        This object for chaining.
      • getMaxConsecutiveRetriesBeforeThrottling

        public int getMaxConsecutiveRetriesBeforeThrottling()
        Returns:
        Set the maximum number of consecutive failed retries that the client will permit before throttling all subsequent retries of failed requests.
      • useGzip

        public boolean useGzip()
        Checks if gzip decompression is used when receiving HTTP responses.
        Returns:
        if gzip decompression is used
      • setUseGzip

        public void setUseGzip(boolean use)
        Sets whether gzip decompression should be used when receiving HTTP responses.

        Note useGzip should only be enabled if the HTTP response is gzipped

        Parameters:
        use - whether gzip decompression should be used
      • withGzip

        public ClientConfiguration withGzip(boolean use)
        Sets whether gzip decompression should be used when receiving HTTP responses.

        Note useGzip should only be enabled if the HTTP response is gzipped

        Parameters:
        use - whether gzip decompression should be used
        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:

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

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

        • 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.
      • getSignerOverride

        public 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(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(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(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 object.
      • getConnectionTTL

        public long getConnectionTTL()
        Returns the expiration time (in milliseconds) for a connection in the connection pool. When retrieving a connection from the pool to make a request, the total time that the connection has been open is compared against this value. Connections which have been open for longer are discarded, and if needed a new connection is created.

        Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.

        Returns:
        the connection TTL, in milliseconds
      • setConnectionTTL

        public void setConnectionTTL(long connectionTTL)
        Sets the expiration time (in milliseconds) for a connection in the connection pool. When retrieving a connection from the pool to make a request, the total time that the connection has been open is compared against this value. Connections which have been open for longer are discarded, and if needed a new connection is created.

        Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.

        By default, it is set to {@code -1], i.e. connections do not expire.

        Parameters:
        connectionTTL - the connection TTL, in milliseconds
      • withConnectionTTL

        public ClientConfiguration withConnectionTTL(long connectionTTL)
        Sets the expiration time (in milliseconds) for a connection in the connection pool. When retrieving a connection from the pool to make a request, the total time that the connection has been open is compared against this value. Connections which have been open for longer are discarded, and if needed a new connection is created.

        Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.

        By default, it is set to -1, i.e. connections do not expire.

        Parameters:
        connectionTTL - the connection TTL, in milliseconds
        Returns:
        the updated ClientConfiguration object
      • getConnectionMaxIdleMillis

        public long getConnectionMaxIdleMillis()
        Returns the maximum amount of time that an idle connection may sit in the connection pool and still be eligible for reuse. When retrieving a connection from the pool to make a request, the amount of time the connection has been idle is compared against this value. Connections which have been idle for longer are discarded, and if needed a new connection is created.

        Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.

        Returns:
        the connection maximum idle time, in milliseconds
      • setConnectionMaxIdleMillis

        public void setConnectionMaxIdleMillis(long connectionMaxIdleMillis)
        Sets the maximum amount of time that an idle connection may sit in the connection pool and still be eligible for reuse. When retrieving a connection from the pool to make a request, the amount of time the connection has been idle is compared against this value. Connections which have been idle for longer are discarded, and if needed a new connection is created.

        Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.

        By default, it is set to one minute (60000ms).

        Parameters:
        connectionMaxIdleMillis - the connection maximum idle time, in milliseconds
      • withConnectionMaxIdleMillis

        public ClientConfiguration withConnectionMaxIdleMillis(long connectionMaxIdleMillis)
        Sets the maximum amount of time that an idle connection may sit in the connection pool and still be eligible for reuse. When retrieving a connection from the pool to make a request, the amount of time the connection has been idle is compared against this value. Connections which have been idle for longer are discarded, and if needed a new connection is created.

        Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.

        By default, it is set to one minute (60000ms).

        Parameters:
        connectionMaxIdleMillis - the connection maximum idle time, in milliseconds
        Returns:
        the updated ClientConfiguration object
      • getValidateAfterInactivityMillis

        public int getValidateAfterInactivityMillis()
        Returns the amount of time (in milliseconds) that a connection can be idle in the connection pool before it must be validated to ensure it's still open. This "stale connection check" adds a small bit of overhead to validate the connection. Setting this value to larger values may increase the likelihood that the connection is not usable, potentially resulting in a NoHttpResponseException. Lowering this setting increases the overhead when leasing connections from the connection pool. It is recommended to tune this setting based on how long a service allows a connection to be idle before closing.

        A non positive value disables validation of connections.

        The default value is 5000 milliseconds.

      • setValidateAfterInactivityMillis

        public void setValidateAfterInactivityMillis(int validateAfterInactivityMillis)
        Sets the amount of time (in milliseconds) that a connection can be idle in the connection pool before it must be validated to ensure it's still open. This "stale connection check" adds a small bit of overhead to validate the connection. Setting this value to larger values may increase the likelihood that the connection is not usable, potentially resulting in a NoHttpResponseException. Lowering this setting increases the overhead when leasing connections from the connection pool. It is recommended to tune this setting based on how long a service allows a connection to be idle before closing.

        A non positive value disables validation of connections.

        The default value is 5000 milliseconds.

        Parameters:
        validateAfterInactivityMillis - The allowed time, in milliseconds, a connection can be idle before it must be re-validated.
      • withValidateAfterInactivityMillis

        public ClientConfiguration withValidateAfterInactivityMillis(int validateAfterInactivityMillis)
        Sets the amount of time (in milliseconds) that a connection can be idle in the connection pool before it must be validated to ensure it's still open. This "stale connection check" adds a small bit of overhead to validate the connection. Setting this value to larger values may increase the likelihood that the connection is not usable, potentially resulting in a NoHttpResponseException. Lowering this setting increases the overhead when leasing connections from the connection pool. It is recommended to tune this setting based on how long a service allows a connection to be idle before closing.

        A non positive value disables validation of connections.

        The default value is 5000 milliseconds.

        Parameters:
        validateAfterInactivityMillis - The allowed time, in milliseconds, a connection can be idle before it must be re-validated.
        Returns:
        The updated ClientConfiguration object.
      • useTcpKeepAlive

        public boolean useTcpKeepAlive()
        Returns whether or not TCP KeepAlive support is enabled.
      • setUseTcpKeepAlive

        public void setUseTcpKeepAlive(boolean use)
        Sets whether or not to enable TCP KeepAlive support at the socket level.
      • withTcpKeepAlive

        public ClientConfiguration withTcpKeepAlive(boolean use)
        Sets whether or not to enable TCP KeepAlive support at the socket level.
        Returns:
        The updated ClientConfiguration object.
      • getDnsResolver

        public DnsResolver getDnsResolver()
        Returns the DnsResolver for resolving AWS IP addresses. Returns the SystemDefaultDnsResolver by default if not explicitly configured by the user.
      • setDnsResolver

        public void setDnsResolver(DnsResolver resolver)
        Sets the DNS Resolver that should be used to for resolving AWS IP addresses.
      • withDnsResolver

        public ClientConfiguration withDnsResolver(DnsResolver resolver)
        Sets the DNS Resolver that should be used to for resolving AWS IP addresses.
        Returns:
        The updated ClientConfiguration object.
      • getCacheResponseMetadata

        public boolean getCacheResponseMetadata()
        Returns whether or not to cache response metadata.

        Response metadata is typically used for troubleshooting issues with AWS support staff when services aren't acting as expected.

        While this feature is useful for debugging it adds overhead and disabling it may be desired in high throughput applications.

        Returns:
        true if response metadata will be cached
      • setCacheResponseMetadata

        public void setCacheResponseMetadata(boolean shouldCache)
        Sets whether or not to cache response metadata.

        Response metadata is typically used for troubleshooting issues with AWS support staff when services aren't acting as expected.

        While this feature is useful for debugging it adds overhead and disabling it may be desired in high throughput applications.

        Parameters:
        shouldCache - true if response metadata should be cached
      • withCacheResponseMetadata

        public ClientConfiguration withCacheResponseMetadata(boolean shouldCache)
        Sets whether or not to cache response metadata.

        Response metadata is typically used for troubleshooting issues with AWS support staff when services aren't acting as expected.

        While this feature is useful for debugging it adds overhead and disabling it may be desired in high throughput applications.

        Parameters:
        shouldCache - true if response metadata should be cached
        Returns:
        The updated ClientConfiguration object.
      • getResponseMetadataCacheSize

        public int getResponseMetadataCacheSize()
        Returns the response metadata cache size.
      • setResponseMetadataCacheSize

        public void setResponseMetadataCacheSize(int responseMetadataCacheSize)
        Sets the response metadata cache size. By default, it is set to 50.
        Parameters:
        responseMetadataCacheSize - maximum cache size.
      • withResponseMetadataCacheSize

        public ClientConfiguration withResponseMetadataCacheSize(int responseMetadataCacheSize)
        Sets the response metadata cache size. By default, it is set to 50.
        Parameters:
        responseMetadataCacheSize - maximum cache size.
        Returns:
        The updated ClientConfiguration object.
      • getApacheHttpClientConfig

        public ApacheHttpClientConfig getApacheHttpClientConfig()
        Returns a non-null object that can be used to specify Apache HTTP client specific custom configurations.
      • getSecureRandom

        public SecureRandom getSecureRandom()
        Returns the instance of SecureRandom configured by the user; or the JDK default if it is null.
        Returns:
        a non-null instance of SecureRandom.
      • setSecureRandom

        public void setSecureRandom(SecureRandom secureRandom)
        Sets an instance of SecureRandom to be used by the SDK.
      • isUseExpectContinue

        public boolean isUseExpectContinue()
        Returns the use expect continue flag
      • setUseExpectContinue

        public void setUseExpectContinue(boolean useExpectContinue)
        Sets if use expect continue should be enabled. By default, it is set to true.
        Parameters:
        useExpectContinue - use expect continue HTTP/1.1 header.
      • withUseExpectContinue

        public ClientConfiguration withUseExpectContinue(boolean useExpectContinue)
        Sets if use expect continue should be enabled. By default, it is set to true.
        Parameters:
        useExpectContinue - use expect continue HTTP/1.1 header.
        Returns:
        The updated ClientConfiguration object.
      • withHeader

        public ClientConfiguration withHeader(String name,
         String value)
        Adds a header to be added on all requests and returns the ClientConfiguration object
        Parameters:
        name - the name of the header
        value - the value of the header
        Returns:
        The updated ClientConfiguration object.
      • addHeader

        public void addHeader(String name,
         String value)
        Adds a header to be added on all requests
        Parameters:
        name - the name of the header
        value - the value of the header
      • getHeaders

        public Map<String,String> getHeaders()
        Returns headers to be added to all requests
        Returns:
        headers to be added to all requests
      • isDisableHostPrefixInjection

        public boolean isDisableHostPrefixInjection()
        Returns the boolean value to indicate if the host prefix injection is disabled or not. The hostPrefix template is specified in the service model and is used by the SDK to modify the endpoint the request is sent to. Host prefix injection is enabled by default. This option can be set to disable the behavior.
      • setDisableHostPrefixInjection

        public void setDisableHostPrefixInjection(boolean disableHostPrefixInjection)
        Sets the configuration option to disable the host prefix injection. The hostPrefix template is specified in the service model and is used by the SDK to modify the endpoint the request is sent to. Host prefix injection is enabled by default. This option can be set to disable the behavior.
      • withDisableHostPrefixInjection

        public ClientConfiguration withDisableHostPrefixInjection(boolean disableHostPrefixInjection)
        Sets the configuration option to disable the host prefix injection. The hostPrefix template is specified in the service model and is used by the SDK to modify the endpoint the request is sent to. Host prefix injection is enabled by default. This option can be set to disable the behavior.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /