public class AsyncHttpClientConfig extends Object
AsyncHttpClient
. System property can be also used to configure this
object default behavior by doing:
-Dcom.ning.http.client.AsyncHttpClientConfig.nameOfTheProperty
ex:
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxTotalConnections
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxTotalConnections
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxConnectionsPerHost
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultConnectionTimeoutInMS
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultIdleConnectionInPoolTimeoutInMS
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultRequestTimeoutInMS
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultRedirectsEnabled
-Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxRedirectsModifier and Type | Class and Description |
---|---|
static class |
AsyncHttpClientConfig.Builder
Builder for an
AsyncHttpClient |
Modifier and Type | Method and Description |
---|---|
ExecutorService |
executorService()
Return the
ExecutorService an AsyncHttpClient use for handling
asynchronous response. |
boolean |
getAllowPoolingConnection()
Is the
ConnectionsPool support enabled. |
AsyncHttpProviderConfig<?,?> |
getAsyncHttpProviderConfig()
Return the
AsyncHttpProviderConfig |
ConnectionsPool<?,?> |
getConnectionsPool()
Return an instance of
ConnectionsPool |
int |
getConnectionTimeoutInMs()
Return the maximum time in millisecond an
AsyncHttpClient can wait when connecting to a remote host |
int |
getIdleConnectionInPoolTimeoutInMs()
Return the maximum time in millisecond an
AsyncHttpClient will keep connection
in pool. |
int |
getIdleConnectionTimeoutInMs()
Deprecated.
Please use
getIdleConnectionInPoolTimeoutInMs() |
List<IOExceptionFilter> |
getIOExceptionFilters()
Return the list of
IOException |
boolean |
getKeepAlive()
Deprecated.
|
int |
getMaxConnectionPerHost()
Return the maximum number of connections per hosts an
AsyncHttpClient can handle. |
int |
getMaxRedirects()
Get the maximum number of HTTP redirect
|
int |
getMaxRequestRetry()
Return the number of time the library will retry when an
IOException is throw by the remote server |
int |
getMaxTotalConnections()
Return the maximum number of connections an
AsyncHttpClient can handle. |
ProxyServer |
getProxyServer()
An instance of
ProxyServer used by an AsyncHttpClient |
Realm |
getRealm()
Return the current
Realm } |
int |
getRequestCompressionLevel()
Return the compression level, or -1 if no compression is used.
|
List<RequestFilter> |
getRequestFilters()
Return the list of
RequestFilter |
int |
getRequestTimeoutInMs()
Return the maximum time in millisecond an
AsyncHttpClient wait for a response |
List<ResponseFilter> |
getResponseFilters()
Return the list of
ResponseFilter |
SSLContext |
getSSLContext()
Return an instance of
SSLContext used for SSL connection. |
SSLEngineFactory |
getSSLEngineFactory()
Return an instance of
SSLEngineFactory used for SSL connection. |
String |
getUserAgent()
Return the USER_AGENT header value
|
boolean |
isCompressionEnabled()
Is HTTP compression enabled.
|
boolean |
isRedirectEnabled()
Is HTTP redirect enabled
|
boolean |
isSslConnectionPoolEnabled()
Return true is SSL connection polling is enabled.
|
ScheduledExecutorService |
reaper()
A
ScheduledExecutorService used to expire idle connections. |
public ScheduledExecutorService reaper()
ScheduledExecutorService
used to expire idle connections.ScheduledExecutorService
public int getMaxTotalConnections()
AsyncHttpClient
can handle.AsyncHttpClient
can handle.public int getMaxConnectionPerHost()
AsyncHttpClient
can handle.AsyncHttpClient
can handle.public int getConnectionTimeoutInMs()
AsyncHttpClient
can wait when connecting to a remote hostAsyncHttpClient
can wait when connecting to a remote hostpublic int getIdleConnectionTimeoutInMs()
getIdleConnectionInPoolTimeoutInMs()
AsyncHttpClient
can stay idle.AsyncHttpClient
can stay idle.public int getIdleConnectionInPoolTimeoutInMs()
AsyncHttpClient
will keep connection
in pool.AsyncHttpClient
will keep connection
in pool.public int getRequestTimeoutInMs()
AsyncHttpClient
wait for a responseAsyncHttpClient
wait for a responsepublic boolean isRedirectEnabled()
public int getMaxRedirects()
public boolean getAllowPoolingConnection()
ConnectionsPool
support enabled.public boolean getKeepAlive()
getAllowPoolingConnection()
ConnectionsPool
support enabled.public String getUserAgent()
public boolean isCompressionEnabled()
public ExecutorService executorService()
ExecutorService
an AsyncHttpClient
use for handling
asynchronous response.ExecutorService
an AsyncHttpClient
use for handling
asynchronous response.public ProxyServer getProxyServer()
ProxyServer
used by an AsyncHttpClient
ProxyServer
public SSLContext getSSLContext()
SSLContext
used for SSL connection.SSLContext
used for SSL connection.public ConnectionsPool<?,?> getConnectionsPool()
ConnectionsPool
ConnectionsPool
public SSLEngineFactory getSSLEngineFactory()
SSLEngineFactory
used for SSL connection.SSLEngineFactory
used for SSL connection.public AsyncHttpProviderConfig<?,?> getAsyncHttpProviderConfig()
AsyncHttpProviderConfig
AsyncHttpProviderConfig
public List<RequestFilter> getRequestFilters()
RequestFilter
ResponseFilter
public List<ResponseFilter> getResponseFilters()
ResponseFilter
ResponseFilter
public List<IOExceptionFilter> getIOExceptionFilters()
IOException
IOException
public int getRequestCompressionLevel()
public int getMaxRequestRetry()
IOException
is throw by the remote serverIOException
is throw by the remote serverpublic boolean isSslConnectionPoolEnabled()
Copyright © 2012. All Rights Reserved.