public class AsyncHttpClientConfig extends Object
AsyncHttpClient
. System property
can be also used to configure this object default behavior by doing:
-Dorg.asynchttpclient.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 |
---|---|
AdvancedConfig |
getAdvancedConfig()
Return the
AdvancedConfig |
int |
getChunkedFileChunkSize() |
int |
getConnectionTTL()
Return the maximum time in millisecond an
AsyncHttpClient will
keep connection in the pool, or -1 to keep connection while possible. |
int |
getConnectTimeout()
Return the maximum time in millisecond an
AsyncHttpClient can
wait when connecting to a remote host |
String[] |
getEnabledCipherSuites()
since 1.9.0
|
String[] |
getEnabledProtocols()
since 1.9.0
|
ExecutorService |
getExecutorService()
Return the
ExecutorService an
AsyncHttpClient use for handling asynchronous response. |
long |
getHandshakeTimeout() |
int |
getHttpClientCodecMaxChunkSize() |
int |
getHttpClientCodecMaxHeaderSize() |
int |
getHttpClientCodecMaxInitialLineLength() |
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 |
String |
getName()
Return the name of
AsyncHttpClient , which is used for thread naming
and debugging. |
String |
getNameOrDefault()
Return the name of
AsyncHttpClient , or default string if name is null or empty. |
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 waits
until the response is completed. |
List<ResponseFilter> |
getResponseFilters()
Return the list of
ResponseFilter |
int |
getShutdownQuiet() |
int |
getShutdownTimeout() |
SSLContext |
getSSLContext()
Return an instance of
SSLContext used for SSL connection. |
SSLEngineFactory |
getSslEngineFactory() |
Integer |
getSslSessionCacheSize()
since 1.9.13
|
Integer |
getSslSessionTimeout()
since 1.9.13
|
String |
getUserAgent()
Return the USER_AGENT header value
|
int |
getWebSocketMaxBufferSize() |
int |
getWebSocketMaxFrameSize() |
int |
getWebSocketTimeout()
Return the maximum time, in milliseconds, a
WebSocket may be idle before being timed
out. |
boolean |
hasRequestFilters() |
boolean |
hasResponseFilters() |
boolean |
isAcceptAnyCertificate() |
boolean |
isAllowPoolingConnections()
Is the
ConnectionsPool support enabled. |
boolean |
isAllowPoolingSslConnections()
Return true is SSL connection polling is enabled.
|
boolean |
isCompressionEnforced()
Is HTTP compression enforced.
|
boolean |
isDisableUrlEncodingForBoundRequests() |
boolean |
isDisableZeroCopy() |
boolean |
isFollowRedirect()
Is HTTP redirect enabled
|
boolean |
isKeepEncodingHeader() |
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 |
isValid() |
public static final String AHC_VERSION
protected String name
protected int connectTimeout
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 boolean acceptAnyCertificate
protected boolean followRedirect
protected int maxRedirects
protected boolean strict302Handling
protected ProxyServerSelector proxyServerSelector
protected boolean compressionEnforced
protected String userAgent
protected ExecutorService executorService
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 String[] enabledProtocols
protected String[] enabledCipherSuites
protected Integer sslSessionCacheSize
protected Integer sslSessionTimeout
protected int httpClientCodecMaxInitialLineLength
protected int httpClientCodecMaxHeaderSize
protected int httpClientCodecMaxChunkSize
protected boolean disableZeroCopy
protected long handshakeTimeout
protected SSLEngineFactory sslEngineFactory
protected int chunkedFileChunkSize
protected int webSocketMaxBufferSize
protected int webSocketMaxFrameSize
protected boolean keepEncodingHeader
protected int shutdownQuiet
protected int shutdownTimeout
protected AdvancedConfig advancedConfig
public String getName()
AsyncHttpClient
, which is used for thread naming
and debugging.public String getNameOrDefault()
AsyncHttpClient
, or default string if name is null or empty.public int getMaxConnections()
AsyncHttpClient
can
handle.AsyncHttpClient
can
handle.public int getMaxConnectionsPerHost()
AsyncHttpClient
can handle.AsyncHttpClient
can handle.public int getConnectTimeout()
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
waits
until the response is completed.AsyncHttpClient
waits
until the response is completed.public boolean isFollowRedirect()
public int getMaxRedirects()
public boolean isAllowPoolingConnections()
ConnectionsPool
support enabled.public String getUserAgent()
public boolean isCompressionEnforced()
public ExecutorService getExecutorService()
ExecutorService
an
AsyncHttpClient
use for handling asynchronous response.ExecutorService
an
AsyncHttpClient
use for handling asynchronous response.
If no ExecutorService
has been explicitly provided, this
method will return null
public ProxyServerSelector getProxyServerSelector()
ProxyServer
used by an AsyncHttpClient
ProxyServer
public SSLContext getSSLContext()
SSLContext
used for SSL connection.SSLContext
used for SSL connection.public AdvancedConfig getAdvancedConfig()
AdvancedConfig
AdvancedConfig
public boolean hasRequestFilters()
true
if RequestFilter
s have been defined.public List<RequestFilter> getRequestFilters()
RequestFilter
ResponseFilter
public boolean hasResponseFilters()
true
if ResponseFilter
s have been defined.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 isDisableUrlEncodingForBoundRequests()
public boolean isValid()
true
if both the application and reaper thread pools
haven't yet been shutdown.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 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 boolean isAcceptAnyCertificate()
public String[] getEnabledProtocols()
public String[] getEnabledCipherSuites()
public Integer getSslSessionCacheSize()
public Integer getSslSessionTimeout()
public int getHttpClientCodecMaxInitialLineLength()
public int getHttpClientCodecMaxHeaderSize()
public int getHttpClientCodecMaxChunkSize()
public boolean isDisableZeroCopy()
public long getHandshakeTimeout()
public SSLEngineFactory getSslEngineFactory()
public int getChunkedFileChunkSize()
public int getWebSocketMaxBufferSize()
public int getWebSocketMaxFrameSize()
public boolean isKeepEncodingHeader()
public int getShutdownQuiet()
public int getShutdownTimeout()
Copyright © 2015. All Rights Reserved.