Class AsyncHttpClientConfig

java.lang.Object
com.ning.http.client.AsyncHttpClientConfig
Direct Known Subclasses:
AsyncHttpClientConfigBean

public class AsyncHttpClientConfig extends Object
Configuration class to use with a AsyncHttpClient. System property can be also used to configure this object default behavior by doing:

-Dcom.ning.http.client.AsyncHttpClientConfig.nameOfTheProperty

  • Field Details

    • connectTimeout

      protected int connectTimeout
    • maxConnections

      protected int maxConnections
    • maxConnectionsPerHost

      protected int maxConnectionsPerHost
    • requestTimeout

      protected int requestTimeout
    • readTimeout

      protected int readTimeout
    • webSocketTimeout

      protected int webSocketTimeout
    • allowPoolingConnections

      protected boolean allowPoolingConnections
    • allowPoolingSslConnections

      protected boolean allowPoolingSslConnections
    • pooledConnectionIdleTimeout

      protected int pooledConnectionIdleTimeout
    • connectionTTL

      protected int connectionTTL
    • sslContext

      protected SSLContext sslContext
    • hostnameVerifier

      protected HostnameVerifier hostnameVerifier
    • acceptAnyCertificate

      protected boolean acceptAnyCertificate
    • followRedirect

      protected boolean followRedirect
    • maxRedirects

      protected int maxRedirects
    • strict302Handling

      protected boolean strict302Handling
    • proxyServerSelector

      protected ProxyServerSelector proxyServerSelector
    • useRelativeURIsWithConnectProxies

      protected boolean useRelativeURIsWithConnectProxies
    • compressionEnforced

      protected boolean compressionEnforced
    • userAgent

      protected String userAgent
    • applicationThreadPool

      protected ExecutorService applicationThreadPool
    • realm

      protected Realm realm
    • requestFilters

      protected List<RequestFilter> requestFilters
    • responseFilters

      protected List<ResponseFilter> responseFilters
    • ioExceptionFilters

      protected List<IOExceptionFilter> ioExceptionFilters
    • maxRequestRetry

      protected int maxRequestRetry
    • disableUrlEncodingForBoundRequests

      protected boolean disableUrlEncodingForBoundRequests
    • ioThreadMultiplier

      protected int ioThreadMultiplier
    • enabledProtocols

      protected String[] enabledProtocols
    • enabledCipherSuites

      protected String[] enabledCipherSuites
    • sslSessionCacheSize

      protected Integer sslSessionCacheSize
    • sslSessionTimeout

      protected Integer sslSessionTimeout
    • providerConfig

      protected AsyncHttpProviderConfig<?,?> providerConfig
    • maxRequestHeaders

      protected int maxRequestHeaders
    • ntlmAvoidSendPayloadOnType1

      protected boolean ntlmAvoidSendPayloadOnType1
  • Constructor Details

    • AsyncHttpClientConfig

      protected AsyncHttpClientConfig()
  • Method Details

    • getMaxConnections

      public int getMaxConnections()
      Return the maximum number of connections an AsyncHttpClient can handle.
      Returns:
      the maximum number of connections an AsyncHttpClient can handle.
    • getMaxConnectionsPerHost

      public int getMaxConnectionsPerHost()
      Return the maximum number of connections per hosts an AsyncHttpClient can handle.
      Returns:
      the maximum number of connections per host an AsyncHttpClient can handle.
    • getConnectTimeout

      public int getConnectTimeout()
      Return the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host
      Returns:
      the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host
    • getWebSocketTimeout

      public int getWebSocketTimeout()
      Return the maximum time, in milliseconds, a WebSocket may be idle before being timed out.
      Returns:
      the maximum time, in milliseconds, a WebSocket may be idle before being timed out.
    • getReadTimeout

      public int getReadTimeout()
      Return the maximum time in millisecond an AsyncHttpClient can stay idle.
      Returns:
      the maximum time in millisecond an AsyncHttpClient can stay idle.
    • getPooledConnectionIdleTimeout

      public int getPooledConnectionIdleTimeout()
      Return the maximum time in millisecond an AsyncHttpClient will keep connection in pool.
      Returns:
      the maximum time in millisecond an AsyncHttpClient will keep connection in pool.
    • getRequestTimeout

      public int getRequestTimeout()
      Return the maximum time in millisecond an AsyncHttpClient waits until the response is completed.
      Returns:
      the maximum time in millisecond an AsyncHttpClient waits until the response is completed.
    • isFollowRedirect

      public boolean isFollowRedirect()
      Is HTTP redirect enabled
      Returns:
      true if enabled.
    • getMaxRedirects

      public int getMaxRedirects()
      Get the maximum number of HTTP redirect
      Returns:
      the maximum number of HTTP redirect
    • isAllowPoolingConnections

      public boolean isAllowPoolingConnections()
      Is pooling connections enabled.
      Returns:
      if polling connections is enabled
    • getUserAgent

      public String getUserAgent()
      Return the USER_AGENT header value
      Returns:
      the USER_AGENT header value
    • isCompressionEnforced

      public boolean isCompressionEnforced()
      Is HTTP compression enforced.
      Returns:
      true if compression is enforced
    • executorService

      public ExecutorService executorService()
      Return the ExecutorService an AsyncHttpClient use for handling asynchronous response.
      Returns:
      the ExecutorService an AsyncHttpClient use for handling asynchronous response.
    • getProxyServerSelector

      public ProxyServerSelector getProxyServerSelector()
      An instance of ProxyServer used by an AsyncHttpClient
      Returns:
      instance of ProxyServer
    • getSSLContext

      public SSLContext getSSLContext()
      Return an instance of SSLContext used for SSL connection.
      Returns:
      an instance of SSLContext used for SSL connection.
    • getAsyncHttpProviderConfig

      public AsyncHttpProviderConfig<?,?> getAsyncHttpProviderConfig()
      Returns:
      the AsyncHttpProviderConfig
    • getRealm

      public Realm getRealm()
      Return the current Realm}
      Returns:
      the current Realm}
    • getRequestFilters

      public List<RequestFilter> getRequestFilters()
      Return the list of RequestFilter
      Returns:
      Unmodifiable list of ResponseFilter
    • getResponseFilters

      public List<ResponseFilter> getResponseFilters()
      Return the list of ResponseFilter
      Returns:
      Unmodifiable list of ResponseFilter
    • getIOExceptionFilters

      public List<IOExceptionFilter> getIOExceptionFilters()
      Return the list of IOException
      Returns:
      Unmodifiable list of IOException
    • getMaxRequestRetry

      public int getMaxRequestRetry()
      Return the number of time the library will retry when an IOException is throw by the remote server
      Returns:
      the number of time the library will retry when an IOException is throw by the remote server
    • isAllowPoolingSslConnections

      public boolean isAllowPoolingSslConnections()
      Return true is SSL connection polling is enabled. Default is true.
      Returns:
      true is enabled.
    • isDisableUrlEncodingForBoundedRequests

      public boolean isDisableUrlEncodingForBoundedRequests()
      Returns:
      the disableUrlEncodingForBoundedRequests
    • isValid

      public boolean isValid()
      Returns:
      true if both the application and reaper thread pools haven't yet been shutdown.
      Since:
      1.7.21
    • getHostnameVerifier

      public HostnameVerifier getHostnameVerifier()
      Return the HostnameVerifier
      Returns:
      the HostnameVerifier
    • getIoThreadMultiplier

      public int getIoThreadMultiplier()
      Returns:
      number to multiply by availableProcessors() that will determine # of NioWorkers to use
    • isStrict302Handling

      public boolean isStrict302Handling()

      In the case of a POST/Redirect/Get scenario where the server uses a 302 for the redirect, should AHC respond to the redirect with a GET or whatever the original method was. Unless configured otherwise, for a 302, AHC, will use a GET for this case.

      Returns:
      true if string 302 handling is to be used, otherwise false.
      Since:
      1.7.2
    • isUseRelativeURIsWithConnectProxies

      public boolean isUseRelativeURIsWithConnectProxies()
      Returns:
      true if AHC should use relative URIs instead of absolute ones when talking with a SSL proxy or WebSocket proxy, otherwise false.
      Since:
      1.8.13
    • getConnectionTTL

      public int getConnectionTTL()
      Return the maximum time in millisecond an AsyncHttpClient will keep connection in the pool, or -1 to keep connection while possible.
      Returns:
      the maximum time in millisecond an AsyncHttpClient will keep connection in the pool, or -1 to keep connection while possible.
    • isAcceptAnyCertificate

      public boolean isAcceptAnyCertificate()
      since 1.9.0
    • getEnabledProtocols

      public String[] getEnabledProtocols()
      since 1.9.0
    • getEnabledCipherSuites

      public String[] getEnabledCipherSuites()
      since 1.9.0
    • getSslSessionCacheSize

      public Integer getSslSessionCacheSize()
      since 1.9.13
    • getSslSessionTimeout

      public Integer getSslSessionTimeout()
      since 1.9.13
    • getMaxRequestHeaders

      public int getMaxRequestHeaders()
      since 1.14-MULE-021
    • getNtlmAvoidSendPayloadOnType1

      public boolean getNtlmAvoidSendPayloadOnType1()
      since 1.14-MULE-029