Package org.asynchttpclient
Interface AsyncHttpClientConfig
-
- All Known Implementing Classes:
DefaultAsyncHttpClientConfig
public interface AsyncHttpClientConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AsyncHttpClientConfig.ResponseBodyPartFactory
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
expiredCookieEvictionDelay()
Return the delay in milliseconds to evict expired cookies from CookieStoreint
getAcquireFreeChannelTimeout()
Return the maximum duration in milliseconds anAsyncHttpClient
can wait to acquire a free channelString
getAhcVersion()
io.netty.buffer.ByteBufAllocator
getAllocator()
Map<io.netty.channel.ChannelOption<Object>,Object>
getChannelOptions()
ChannelPool
getChannelPool()
int
getChunkedFileChunkSize()
int
getConnectionPoolCleanerPeriod()
ConnectionSemaphoreFactory
getConnectionSemaphoreFactory()
int
getConnectionTtl()
int
getConnectTimeout()
Return the maximum time in millisecond anAsyncHttpClient
can wait when connecting to a remote hostCookieStore
getCookieStore()
Return cookie store that is used to store and retrieve cookiesString[]
getEnabledCipherSuites()
String[]
getEnabledProtocols()
io.netty.channel.EventLoopGroup
getEventLoopGroup()
int
getHandshakeTimeout()
int
getHashedWheelTimerSize()
long
getHashedWheelTimerTickDuration()
Consumer<io.netty.channel.Channel>
getHttpAdditionalChannelInitializer()
int
getHttpClientCodecInitialBufferSize()
int
getHttpClientCodecMaxChunkSize()
int
getHttpClientCodecMaxHeaderSize()
int
getHttpClientCodecMaxInitialLineLength()
List<IOExceptionFilter>
getIoExceptionFilters()
Return the list ofIOException
int
getIoThreadsCount()
KeepAliveStrategy
getKeepAliveStrategy()
int
getMaxConnections()
Return the maximum number of connections anAsyncHttpClient
can handle.int
getMaxConnectionsPerHost()
Return the maximum number of connections per hosts anAsyncHttpClient
can handle.int
getMaxRedirects()
Get the maximum number of HTTP redirectint
getMaxRequestRetry()
Return the number of time the library will retry when anIOException
is throw by the remote serverio.netty.util.Timer
getNettyTimer()
int
getPooledConnectionIdleTimeout()
Return the maximum time in millisecond anAsyncHttpClient
will keep connection in pool.ProxyServerSelector
getProxyServerSelector()
An instance ofProxyServer
used by anAsyncHttpClient
int
getReadTimeout()
Return the maximum time in millisecond anAsyncHttpClient
can stay idle.Realm
getRealm()
Return the currentRealm
List<RequestFilter>
getRequestFilters()
Return the list ofRequestFilter
int
getRequestTimeout()
Return the maximum time in millisecond anAsyncHttpClient
waits until the response is completed.AsyncHttpClientConfig.ResponseBodyPartFactory
getResponseBodyPartFactory()
List<ResponseFilter>
getResponseFilters()
Return the list ofResponseFilter
int
getShutdownQuietPeriod()
int
getShutdownTimeout()
int
getSoLinger()
int
getSoRcvBuf()
int
getSoSndBuf()
io.netty.handler.ssl.SslContext
getSslContext()
Return an instance ofSslContext
used for SSL connection.SslEngineFactory
getSslEngineFactory()
int
getSslSessionCacheSize()
int
getSslSessionTimeout()
ThreadFactory
getThreadFactory()
Return theThreadFactory
anAsyncHttpClient
use for handling asynchronous response.String
getThreadPoolName()
Return the name ofAsyncHttpClient
, which is used for thread naming and debugging.String
getUserAgent()
Return the USER_AGENT header valueint
getWebSocketMaxBufferSize()
int
getWebSocketMaxFrameSize()
Consumer<io.netty.channel.Channel>
getWsAdditionalChannelInitializer()
boolean
isAggregateWebSocketFrameFragments()
boolean
isCompressionEnforced()
Is HTTP compression enforced.boolean
isDisableHttpsEndpointIdentificationAlgorithm()
boolean
isDisableUrlEncodingForBoundRequests()
boolean
isDisableZeroCopy()
boolean
isEnableWebSocketCompression()
boolean
isFilterInsecureCipherSuites()
boolean
isFollowRedirect()
Is HTTP redirect enabledboolean
isKeepAlive()
Is theChannelPool
support enabled.boolean
isKeepEncodingHeader()
boolean
isSoKeepAlive()
boolean
isSoReuseAddress()
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
isTcpNoDelay()
boolean
isUseInsecureTrustManager()
boolean
isUseLaxCookieEncoder()
boolean
isUseNativeTransport()
boolean
isUseOnlyEpollNativeTransport()
boolean
isUseOpenSsl()
boolean
isValidateResponseHeaders()
-
-
-
Method Detail
-
getAhcVersion
String getAhcVersion()
- Returns:
- the version of AHC
-
getThreadPoolName
String getThreadPoolName()
Return the name ofAsyncHttpClient
, which is used for thread naming and debugging.- Returns:
- the name.
-
getMaxConnections
int getMaxConnections()
Return the maximum number of connections anAsyncHttpClient
can handle.- Returns:
- the maximum number of connections an
AsyncHttpClient
can handle.
-
getMaxConnectionsPerHost
int getMaxConnectionsPerHost()
Return the maximum number of connections per hosts anAsyncHttpClient
can handle.- Returns:
- the maximum number of connections per host an
AsyncHttpClient
can handle.
-
getAcquireFreeChannelTimeout
int getAcquireFreeChannelTimeout()
Return the maximum duration in milliseconds anAsyncHttpClient
can wait to acquire a free channel- Returns:
- Return the maximum duration in milliseconds an
AsyncHttpClient
can wait to acquire a free channel
-
getConnectTimeout
int getConnectTimeout()
Return the maximum time in millisecond anAsyncHttpClient
can wait when connecting to a remote host- Returns:
- the maximum time in millisecond an
AsyncHttpClient
can wait when connecting to a remote host
-
getReadTimeout
int getReadTimeout()
Return the maximum time in millisecond anAsyncHttpClient
can stay idle.- Returns:
- the maximum time in millisecond an
AsyncHttpClient
can stay idle.
-
getPooledConnectionIdleTimeout
int getPooledConnectionIdleTimeout()
Return the maximum time in millisecond anAsyncHttpClient
will keep connection in pool.- Returns:
- the maximum time in millisecond an
AsyncHttpClient
will keep connection in pool.
-
getConnectionPoolCleanerPeriod
int getConnectionPoolCleanerPeriod()
- Returns:
- the period in millis to clean the pool of dead and idle connections.
-
getRequestTimeout
int getRequestTimeout()
Return the maximum time in millisecond anAsyncHttpClient
waits until the response is completed.- Returns:
- the maximum time in millisecond an
AsyncHttpClient
waits until the response is completed.
-
isFollowRedirect
boolean isFollowRedirect()
Is HTTP redirect enabled- Returns:
- true if enabled.
-
getMaxRedirects
int getMaxRedirects()
Get the maximum number of HTTP redirect- Returns:
- the maximum number of HTTP redirect
-
isKeepAlive
boolean isKeepAlive()
Is theChannelPool
support enabled.- Returns:
- true if keep-alive is enabled
-
getUserAgent
String getUserAgent()
Return the USER_AGENT header value- Returns:
- the USER_AGENT header value
-
isCompressionEnforced
boolean isCompressionEnforced()
Is HTTP compression enforced.- Returns:
- true if compression is enforced
-
getThreadFactory
ThreadFactory getThreadFactory()
Return theThreadFactory
anAsyncHttpClient
use for handling asynchronous response.- Returns:
- the
ThreadFactory
anAsyncHttpClient
use for handling asynchronous response. If noThreadFactory
has been explicitly provided, this method will returnnull
-
getProxyServerSelector
ProxyServerSelector getProxyServerSelector()
An instance ofProxyServer
used by anAsyncHttpClient
- Returns:
- instance of
ProxyServer
-
getSslContext
io.netty.handler.ssl.SslContext getSslContext()
Return an instance ofSslContext
used for SSL connection.- Returns:
- an instance of
SslContext
used for SSL connection.
-
getRequestFilters
List<RequestFilter> getRequestFilters()
Return the list ofRequestFilter
- Returns:
- Unmodifiable list of
RequestFilter
-
getResponseFilters
List<ResponseFilter> getResponseFilters()
Return the list ofResponseFilter
- Returns:
- Unmodifiable list of
ResponseFilter
-
getIoExceptionFilters
List<IOExceptionFilter> getIoExceptionFilters()
Return the list ofIOException
- Returns:
- Unmodifiable list of
IOException
-
getCookieStore
CookieStore getCookieStore()
Return cookie store that is used to store and retrieve cookies- Returns:
CookieStore
object
-
expiredCookieEvictionDelay
int expiredCookieEvictionDelay()
Return the delay in milliseconds to evict expired cookies from CookieStore- Returns:
- the delay in milliseconds to evict expired cookies from CookieStore
-
getMaxRequestRetry
int getMaxRequestRetry()
Return the number of time the library will retry when anIOException
is throw by the remote server- Returns:
- the number of time the library will retry when an
IOException
is throw by the remote server
-
isDisableUrlEncodingForBoundRequests
boolean isDisableUrlEncodingForBoundRequests()
- Returns:
- the disableUrlEncodingForBoundRequests
-
isUseLaxCookieEncoder
boolean isUseLaxCookieEncoder()
- Returns:
- true if AHC is to use a LAX cookie encoder, eg accept illegal chars in cookie value
-
isStrict302Handling
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 strict 302 handling is to be used, otherwisefalse
.
-
getConnectionTtl
int getConnectionTtl()
- Returns:
- the maximum time in millisecond an
AsyncHttpClient
will keep connection in the pool, or -1 to keep connection while possible.
-
isUseOpenSsl
boolean isUseOpenSsl()
-
isUseInsecureTrustManager
boolean isUseInsecureTrustManager()
-
isDisableHttpsEndpointIdentificationAlgorithm
boolean isDisableHttpsEndpointIdentificationAlgorithm()
- Returns:
- true to disable all HTTPS behaviors AT ONCE, such as hostname verification and SNI
-
getEnabledProtocols
String[] getEnabledProtocols()
- Returns:
- the array of enabled protocols
-
getEnabledCipherSuites
String[] getEnabledCipherSuites()
- Returns:
- the array of enabled cipher suites
-
isFilterInsecureCipherSuites
boolean isFilterInsecureCipherSuites()
- Returns:
- if insecure cipher suites must be filtered out (only used when not explicitly passing enabled cipher suites)
-
getSslSessionCacheSize
int getSslSessionCacheSize()
- Returns:
- the size of the SSL session cache, 0 means using the default value
-
getSslSessionTimeout
int getSslSessionTimeout()
- Returns:
- the SSL session timeout in seconds, 0 means using the default value
-
getHttpClientCodecMaxInitialLineLength
int getHttpClientCodecMaxInitialLineLength()
-
getHttpClientCodecMaxHeaderSize
int getHttpClientCodecMaxHeaderSize()
-
getHttpClientCodecMaxChunkSize
int getHttpClientCodecMaxChunkSize()
-
getHttpClientCodecInitialBufferSize
int getHttpClientCodecInitialBufferSize()
-
isDisableZeroCopy
boolean isDisableZeroCopy()
-
getHandshakeTimeout
int getHandshakeTimeout()
-
getSslEngineFactory
SslEngineFactory getSslEngineFactory()
-
getChunkedFileChunkSize
int getChunkedFileChunkSize()
-
getWebSocketMaxBufferSize
int getWebSocketMaxBufferSize()
-
getWebSocketMaxFrameSize
int getWebSocketMaxFrameSize()
-
isKeepEncodingHeader
boolean isKeepEncodingHeader()
-
getShutdownQuietPeriod
int getShutdownQuietPeriod()
-
getShutdownTimeout
int getShutdownTimeout()
-
getEventLoopGroup
io.netty.channel.EventLoopGroup getEventLoopGroup()
-
isUseNativeTransport
boolean isUseNativeTransport()
-
isUseOnlyEpollNativeTransport
boolean isUseOnlyEpollNativeTransport()
-
getHttpAdditionalChannelInitializer
Consumer<io.netty.channel.Channel> getHttpAdditionalChannelInitializer()
-
getWsAdditionalChannelInitializer
Consumer<io.netty.channel.Channel> getWsAdditionalChannelInitializer()
-
getResponseBodyPartFactory
AsyncHttpClientConfig.ResponseBodyPartFactory getResponseBodyPartFactory()
-
getChannelPool
ChannelPool getChannelPool()
-
getConnectionSemaphoreFactory
ConnectionSemaphoreFactory getConnectionSemaphoreFactory()
-
getNettyTimer
io.netty.util.Timer getNettyTimer()
-
getHashedWheelTimerTickDuration
long getHashedWheelTimerTickDuration()
- Returns:
- the duration between tick of
HashedWheelTimer
-
getHashedWheelTimerSize
int getHashedWheelTimerSize()
- Returns:
- the size of the hashed wheel
HashedWheelTimer
-
getKeepAliveStrategy
KeepAliveStrategy getKeepAliveStrategy()
-
isValidateResponseHeaders
boolean isValidateResponseHeaders()
-
isAggregateWebSocketFrameFragments
boolean isAggregateWebSocketFrameFragments()
-
isEnableWebSocketCompression
boolean isEnableWebSocketCompression()
-
isTcpNoDelay
boolean isTcpNoDelay()
-
isSoReuseAddress
boolean isSoReuseAddress()
-
isSoKeepAlive
boolean isSoKeepAlive()
-
getSoLinger
int getSoLinger()
-
getSoSndBuf
int getSoSndBuf()
-
getSoRcvBuf
int getSoRcvBuf()
-
getAllocator
io.netty.buffer.ByteBufAllocator getAllocator()
-
getIoThreadsCount
int getIoThreadsCount()
-
-