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.nameOfThePropertyModifier and Type | Class and Description |
---|---|
static class |
AsyncHttpClientConfig.Builder
Builder for an
AsyncHttpClient |
Modifier | Constructor and Description |
---|---|
protected |
AsyncHttpClientConfig() |
Modifier and Type | Method and Description |
---|---|
ExecutorService |
executorService()
Return the
ExecutorService an AsyncHttpClient use for handling
asynchronous response. |
AsyncHttpProviderConfig<?,?> |
getAsyncHttpProviderConfig()
Return the
AsyncHttpProviderConfig |
int |
getConnectionTimeout()
Return the maximum time in millisecond an
AsyncHttpClient can wait when connecting to a remote host |
int |
getConnectionTTL()
Return the maximum time in millisecond an
AsyncHttpClient will keep connection in the pool, or -1 to keep connection while possible. |
HostnameVerifier |
getHostnameVerifier()
Return the
HostnameVerifier |
List<IOExceptionFilter> |
getIOExceptionFilters()
Return the list of
IOException |
int |
getIoThreadMultiplier() |
int |
getMaxConnections()
Return the maximum number of connections an
AsyncHttpClient can handle. |
int |
getMaxConnectionsPerHost()
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 |
getPooledConnectionIdleTimeout()
Return the maximum time in millisecond an
AsyncHttpClient will keep connection
in pool. |
ProxyServerSelector |
getProxyServerSelector()
An instance of
ProxyServer used by an AsyncHttpClient |
int |
getReadTimeout()
Return the maximum time in millisecond an
AsyncHttpClient can stay idle. |
Realm |
getRealm()
Return the current
Realm } |
List<RequestFilter> |
getRequestFilters()
Return the list of
RequestFilter |
int |
getRequestTimeout()
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. |
TimeConverter |
getTimeConverter()
since 1.8.2
|
String |
getUserAgent()
Return the USER_AGENT header value
|
int |
getWebSocketTimeout()
Return the maximum time, in milliseconds, a
WebSocket may be idle before being timed out. |
boolean |
isAcceptAnyCertificate()
since 1.9.0
|
boolean |
isAllowPoolingConnections()
Is pooling connections enabled.
|
boolean |
isAllowPoolingSslConnections()
Return true is SSL connection polling is enabled.
|
boolean |
isCompressionEnabled()
Is HTTP compression enabled.
|
boolean |
isDisableUrlEncodingForBoundedRequests() |
boolean |
isFollowRedirect()
Is HTTP redirect enabled
|
boolean |
isRemoveQueryParamOnRedirect()
Return true if the query parameters will be stripped from the request when a redirect is requested.
|
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.
|
boolean |
isUseRelativeURIsWithConnectProxies() |
boolean |
isValid() |
protected int connectionTimeout
protected int maxConnections
protected int maxConnectionsPerHost
protected int requestTimeout
protected int readTimeout
protected int webSocketTimeout
protected boolean allowPoolingConnections
protected boolean allowPoolingSslConnections
protected int pooledConnectionIdleTimeout
protected int connectionTTL
protected SSLContext sslContext
protected HostnameVerifier hostnameVerifier
protected boolean acceptAnyCertificate
protected boolean followRedirect
protected int maxRedirects
protected boolean removeQueryParamOnRedirect
protected boolean strict302Handling
protected ProxyServerSelector proxyServerSelector
protected boolean useRelativeURIsWithConnectProxies
protected boolean compressionEnabled
protected String userAgent
protected ExecutorService applicationThreadPool
protected Realm realm
protected List<RequestFilter> requestFilters
protected List<ResponseFilter> responseFilters
protected List<IOExceptionFilter> ioExceptionFilters
protected int maxRequestRetry
protected boolean disableUrlEncodingForBoundRequests
protected int ioThreadMultiplier
protected TimeConverter timeConverter
protected AsyncHttpProviderConfig<?,?> providerConfig
public int getMaxConnections()
AsyncHttpClient
can handle.AsyncHttpClient
can handle.public int getMaxConnectionsPerHost()
AsyncHttpClient
can handle.AsyncHttpClient
can handle.public int getConnectionTimeout()
AsyncHttpClient
can wait when connecting to a remote hostAsyncHttpClient
can wait when connecting to a remote hostpublic int getWebSocketTimeout()
WebSocket
may be idle before being timed out.WebSocket
may be idle before being timed out.public int getReadTimeout()
AsyncHttpClient
can stay idle.AsyncHttpClient
can stay idle.public int getPooledConnectionIdleTimeout()
AsyncHttpClient
will keep connection
in pool.AsyncHttpClient
will keep connection
in pool.public int getRequestTimeout()
AsyncHttpClient
wait for a responseAsyncHttpClient
wait for a responsepublic boolean isFollowRedirect()
public int getMaxRedirects()
public boolean isAllowPoolingConnections()
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 ProxyServerSelector getProxyServerSelector()
ProxyServer
used by an AsyncHttpClient
ProxyServer
public SSLContext getSSLContext()
SSLContext
used for SSL connection.SSLContext
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 getMaxRequestRetry()
IOException
is throw by the remote serverIOException
is throw by the remote serverpublic boolean isAllowPoolingSslConnections()
public boolean isDisableUrlEncodingForBoundedRequests()
public boolean isRemoveQueryParamOnRedirect()
public boolean isValid()
true
if both the application and reaper thread pools
haven't yet been shutdown.public HostnameVerifier getHostnameVerifier()
HostnameVerifier
HostnameVerifier
public int getIoThreadMultiplier()
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.
true
if string 302 handling is to be used,
otherwise false
.public boolean isUseRelativeURIsWithConnectProxies()
public int getConnectionTTL()
AsyncHttpClient
will keep connection in the pool, or -1 to keep connection while possible.AsyncHttpClient
will keep connection in the pool, or -1 to keep connection while possible.public TimeConverter getTimeConverter()
public boolean isAcceptAnyCertificate()
Copyright © 2014. All Rights Reserved.