Package com.ning.http.client
Class AsyncHttpClientConfig
java.lang.Object
com.ning.http.client.AsyncHttpClientConfig
- Direct Known Subclasses:
AsyncHttpClientConfigBean
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-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected ExecutorServiceprotected booleanprotected intprotected intprotected booleanprotected String[]protected String[]protected booleanprotected HostnameVerifierprotected List<IOExceptionFilter>protected intprotected intprotected intprotected intprotected intprotected intprotected intprotected AsyncHttpProviderConfig<?,?> protected ProxyServerSelectorprotected intprotected Realmprotected List<RequestFilter>protected intprotected List<ResponseFilter>protected SSLContextprotected Integerprotected Integerprotected booleanprotected Stringprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn theExecutorServiceanAsyncHttpClientuse for handling asynchronous response.Return theAsyncHttpProviderConfigintReturn the maximum time in millisecond anAsyncHttpClientwill keep connection in the pool, or -1 to keep connection while possible.intReturn the maximum time in millisecond anAsyncHttpClientcan wait when connecting to a remote hostString[]since 1.9.0String[]since 1.9.0Return theHostnameVerifierReturn the list ofIOExceptionintintReturn the maximum number of connections anAsyncHttpClientcan handle.intReturn the maximum number of connections per hosts anAsyncHttpClientcan handle.intGet the maximum number of HTTP redirectintsince 1.14-MULE-021intReturn the number of time the library will retry when anIOExceptionis throw by the remote serverintReturn the maximum time in millisecond anAsyncHttpClientwill keep connection in pool.An instance ofProxyServerused by anAsyncHttpClientintReturn the maximum time in millisecond anAsyncHttpClientcan stay idle.getRealm()Return the currentRealm}Return the list ofRequestFilterintReturn the maximum time in millisecond anAsyncHttpClientwaits until the response is completed.Return the list ofResponseFilterReturn an instance ofSSLContextused for SSL connection.since 1.9.13since 1.9.13Return the USER_AGENT header valueintReturn the maximum time, in milliseconds, aWebSocketmay be idle before being timed out.booleansince 1.9.0booleanIs pooling connections enabled.booleanReturn true is SSL connection polling is enabled.booleanIs HTTP compression enforced.booleanbooleanIs HTTP redirect enabledbooleanIn 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.booleanbooleanisValid()
-
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
-
hostnameVerifier
-
acceptAnyCertificate
protected boolean acceptAnyCertificate -
followRedirect
protected boolean followRedirect -
maxRedirects
protected int maxRedirects -
strict302Handling
protected boolean strict302Handling -
proxyServerSelector
-
useRelativeURIsWithConnectProxies
protected boolean useRelativeURIsWithConnectProxies -
compressionEnforced
protected boolean compressionEnforced -
userAgent
-
applicationThreadPool
-
realm
-
requestFilters
-
responseFilters
-
ioExceptionFilters
-
maxRequestRetry
protected int maxRequestRetry -
disableUrlEncodingForBoundRequests
protected boolean disableUrlEncodingForBoundRequests -
ioThreadMultiplier
protected int ioThreadMultiplier -
enabledProtocols
-
enabledCipherSuites
-
sslSessionCacheSize
-
sslSessionTimeout
-
providerConfig
-
maxRequestHeaders
protected int maxRequestHeaders
-
-
Constructor Details
-
AsyncHttpClientConfig
protected AsyncHttpClientConfig()
-
-
Method Details
-
getMaxConnections
public int getMaxConnections()Return the maximum number of connections anAsyncHttpClientcan handle.- Returns:
- the maximum number of connections an
AsyncHttpClientcan handle.
-
getMaxConnectionsPerHost
public int getMaxConnectionsPerHost()Return the maximum number of connections per hosts anAsyncHttpClientcan handle.- Returns:
- the maximum number of connections per host an
AsyncHttpClientcan handle.
-
getConnectTimeout
public int getConnectTimeout()Return the maximum time in millisecond anAsyncHttpClientcan wait when connecting to a remote host- Returns:
- the maximum time in millisecond an
AsyncHttpClientcan wait when connecting to a remote host
-
getWebSocketTimeout
public int getWebSocketTimeout()Return the maximum time, in milliseconds, aWebSocketmay be idle before being timed out.- Returns:
- the maximum time, in milliseconds, a
WebSocketmay be idle before being timed out.
-
getReadTimeout
public int getReadTimeout()Return the maximum time in millisecond anAsyncHttpClientcan stay idle.- Returns:
- the maximum time in millisecond an
AsyncHttpClientcan stay idle.
-
getPooledConnectionIdleTimeout
public int getPooledConnectionIdleTimeout()Return the maximum time in millisecond anAsyncHttpClientwill keep connection in pool.- Returns:
- the maximum time in millisecond an
AsyncHttpClientwill keep connection in pool.
-
getRequestTimeout
public int getRequestTimeout()Return the maximum time in millisecond anAsyncHttpClientwaits until the response is completed.- Returns:
- the maximum time in millisecond an
AsyncHttpClientwaits 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
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
Return theExecutorServiceanAsyncHttpClientuse for handling asynchronous response.- Returns:
- the
ExecutorServiceanAsyncHttpClientuse for handling asynchronous response.
-
getProxyServerSelector
An instance ofProxyServerused by anAsyncHttpClient- Returns:
- instance of
ProxyServer
-
getSSLContext
Return an instance ofSSLContextused for SSL connection.- Returns:
- an instance of
SSLContextused for SSL connection.
-
getAsyncHttpProviderConfig
Return theAsyncHttpProviderConfig- Returns:
- the
AsyncHttpProviderConfig
-
getRealm
Return the currentRealm}- Returns:
- the current
Realm}
-
getRequestFilters
Return the list ofRequestFilter- Returns:
- Unmodifiable list of
ResponseFilter
-
getResponseFilters
Return the list ofResponseFilter- Returns:
- Unmodifiable list of
ResponseFilter
-
getIOExceptionFilters
Return the list ofIOException- Returns:
- Unmodifiable list of
IOException
-
getMaxRequestRetry
public int getMaxRequestRetry()Return the number of time the library will retry when anIOExceptionis throw by the remote server- Returns:
- the number of time the library will retry when an
IOExceptionis 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:
trueif both the application and reaper thread pools haven't yet been shutdown.- Since:
- 1.7.21
-
getHostnameVerifier
Return theHostnameVerifier- 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:
trueif string 302 handling is to be used, otherwisefalse.- Since:
- 1.7.2
-
isUseRelativeURIsWithConnectProxies
public boolean isUseRelativeURIsWithConnectProxies()- Returns:
trueif AHC should use relative URIs instead of absolute ones when talking with a SSL proxy or WebSocket proxy, otherwisefalse.- Since:
- 1.8.13
-
getConnectionTTL
public int getConnectionTTL()Return the maximum time in millisecond anAsyncHttpClientwill keep connection in the pool, or -1 to keep connection while possible.- Returns:
- the maximum time in millisecond an
AsyncHttpClientwill keep connection in the pool, or -1 to keep connection while possible.
-
isAcceptAnyCertificate
public boolean isAcceptAnyCertificate()since 1.9.0 -
getEnabledProtocols
since 1.9.0 -
getEnabledCipherSuites
since 1.9.0 -
getSslSessionCacheSize
since 1.9.13 -
getSslSessionTimeout
since 1.9.13 -
getMaxRequestHeaders
public int getMaxRequestHeaders()since 1.14-MULE-021
-