|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.AsyncHttpClientConfig.Builder
public static class AsyncHttpClientConfig.Builder
Builder for an AsyncHttpClient
Constructor Summary | |
---|---|
AsyncHttpClientConfig.Builder()
|
Method Summary | |
---|---|
AsyncHttpClientConfig.Builder |
addRequestFilter(RequestFilter requestFilter)
Add an RequestFilter that will be invoked before AsyncHttpClient.executeRequest(Request) |
AsyncHttpClientConfig.Builder |
addResponseFilter(ResponseFilter responseFilter)
Add an ResponseFilter that will be invoked as soon as the response is
received, and before AsyncHandler.onStatusReceived(HttpResponseStatus) . |
AsyncHttpClientConfig |
build()
Build an AsyncHttpClientConfig |
AsyncHttpClientConfig.Builder |
removeRequestFilter(RequestFilter requestFilter)
Remove an RequestFilter that will be invoked before AsyncHttpClient.executeRequest(Request) |
AsyncHttpClientConfig.Builder |
removeResponseFilter(ResponseFilter responseFilter)
Remove an ResponseFilter that will be invoked as soon as the response is
received, and before AsyncHandler.onStatusReceived(HttpResponseStatus) . |
AsyncHttpClientConfig.Builder |
setAllowPoolingConnection(boolean allowPoolingConnection)
Set true if connection can be pooled by a ConnectionsPool . |
AsyncHttpClientConfig.Builder |
setAsyncHttpClientProviderConfig(AsyncHttpProviderConfig<?,?> providerConfig)
Set the AsyncHttpProviderConfig |
AsyncHttpClientConfig.Builder |
setCompressionEnabled(boolean compressionEnabled)
Enable HTTP compression. |
AsyncHttpClientConfig.Builder |
setConnectionsPool(ConnectionsPool<?,?> connectionsPool)
Set the ConnectionsPool |
AsyncHttpClientConfig.Builder |
setConnectionTimeoutInMs(int defaultConnectionTimeOutInMs)
Set the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host |
AsyncHttpClientConfig.Builder |
setExecutorService(java.util.concurrent.ExecutorService applicationThreadPool)
Set the ExecutorService an AsyncHttpClient use for handling
asynchronous response. |
AsyncHttpClientConfig.Builder |
setFollowRedirects(boolean redirectEnabled)
Set to true to enable HTTP redirect |
AsyncHttpClientConfig.Builder |
setIdleConnectionTimeoutInMs(int defaultIdleConnectionTimeoutInMs)
Set the maximum time in millisecond an AsyncHttpClient can stay idle. |
AsyncHttpClientConfig.Builder |
setKeepAlive(boolean allowPoolingConnection)
Deprecated. - Use setAllowPoolingConnection(boolean) |
AsyncHttpClientConfig.Builder |
setMaximumConnectionsPerHost(int defaultMaxConnectionPerHost)
Set the maximum number of connections per hosts an AsyncHttpClient can handle. |
AsyncHttpClientConfig.Builder |
setMaximumConnectionsTotal(int defaultMaxTotalConnections)
Set the maximum number of connections an AsyncHttpClient can handle. |
AsyncHttpClientConfig.Builder |
setMaximumNumberOfRedirects(int maxDefaultRedirects)
Set the maximum number of HTTP redirect |
AsyncHttpClientConfig.Builder |
setProxyServer(ProxyServer proxyServer)
Set an instance of ProxyServer used by an AsyncHttpClient |
AsyncHttpClientConfig.Builder |
setRealm(Realm realm)
Set the Realm that will be used for all requests. |
AsyncHttpClientConfig.Builder |
setRequestTimeoutInMs(int defaultRequestTimeoutInMs)
Set the maximum time in millisecond an AsyncHttpClient wait for a response |
AsyncHttpClientConfig.Builder |
setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService reaper)
Set the ScheduledExecutorService used to expire idle connections. |
AsyncHttpClientConfig.Builder |
setSSLContext(javax.net.ssl.SSLContext sslContext)
Set the SSLContext for secure connection. |
AsyncHttpClientConfig.Builder |
setSSLEngineFactory(SSLEngineFactory sslEngineFactory)
Set the SSLEngineFactory for secure connection. |
AsyncHttpClientConfig.Builder |
setUserAgent(java.lang.String userAgent)
Set the USER_AGENT header value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncHttpClientConfig.Builder()
Method Detail |
---|
public AsyncHttpClientConfig.Builder setMaximumConnectionsTotal(int defaultMaxTotalConnections)
AsyncHttpClient
can handle.
defaultMaxTotalConnections
- the maximum number of connections an AsyncHttpClient
can handle.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setMaximumConnectionsPerHost(int defaultMaxConnectionPerHost)
AsyncHttpClient
can handle.
defaultMaxConnectionPerHost
- the maximum number of connections per host an AsyncHttpClient
can handle.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setConnectionTimeoutInMs(int defaultConnectionTimeOutInMs)
AsyncHttpClient
can wait when connecting to a remote host
defaultConnectionTimeOutInMs
- the maximum time in millisecond an AsyncHttpClient
can wait when connecting to a remote host
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setIdleConnectionTimeoutInMs(int defaultIdleConnectionTimeoutInMs)
AsyncHttpClient
can stay idle.
defaultIdleConnectionTimeoutInMs
- the maximum time in millisecond an AsyncHttpClient
can stay idle.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setRequestTimeoutInMs(int defaultRequestTimeoutInMs)
AsyncHttpClient
wait for a response
defaultRequestTimeoutInMs
- the maximum time in millisecond an AsyncHttpClient
wait for a response
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setFollowRedirects(boolean redirectEnabled)
redirectEnabled
- true if enabled.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setMaximumNumberOfRedirects(int maxDefaultRedirects)
maxDefaultRedirects
- the maximum number of HTTP redirect
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setCompressionEnabled(boolean compressionEnabled)
compressionEnabled
- true if compression is enabled
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setUserAgent(java.lang.String userAgent)
userAgent
- the USER_AGENT header value
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setAllowPoolingConnection(boolean allowPoolingConnection)
ConnectionsPool
. Default is true.
allowPoolingConnection
- true if connection can be pooled by a ConnectionsPool
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setKeepAlive(boolean allowPoolingConnection)
setAllowPoolingConnection(boolean)
ConnectionsPool
. Default is true.
allowPoolingConnection
- true if connection can be pooled by a ConnectionsPool
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService reaper)
ScheduledExecutorService
used to expire idle connections.
reaper
- theScheduledExecutorService
used to expire idle connections.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setExecutorService(java.util.concurrent.ExecutorService applicationThreadPool)
ExecutorService
an AsyncHttpClient
use for handling
asynchronous response.
applicationThreadPool
- the ExecutorService
an AsyncHttpClient
use for handling
asynchronous response.
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setProxyServer(ProxyServer proxyServer)
ProxyServer
used by an AsyncHttpClient
proxyServer
- instance of ProxyServer
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setSSLEngineFactory(SSLEngineFactory sslEngineFactory)
SSLEngineFactory
for secure connection.
sslEngineFactory
- the SSLEngineFactory
for secure connection
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setSSLContext(javax.net.ssl.SSLContext sslContext)
SSLContext
for secure connection.
sslContext
- the SSLContext
for secure connection
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setAsyncHttpClientProviderConfig(AsyncHttpProviderConfig<?,?> providerConfig)
AsyncHttpProviderConfig
providerConfig
- the AsyncHttpProviderConfig
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setConnectionsPool(ConnectionsPool<?,?> connectionsPool)
ConnectionsPool
connectionsPool
- the ConnectionsPool
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder setRealm(Realm realm)
Realm
that will be used for all requests.
realm
- the Realm
AsyncHttpClientConfig.Builder
public AsyncHttpClientConfig.Builder addRequestFilter(RequestFilter requestFilter)
RequestFilter
that will be invoked before AsyncHttpClient.executeRequest(Request)
requestFilter
- RequestFilter
public AsyncHttpClientConfig.Builder removeRequestFilter(RequestFilter requestFilter)
RequestFilter
that will be invoked before AsyncHttpClient.executeRequest(Request)
requestFilter
- RequestFilter
public AsyncHttpClientConfig.Builder addResponseFilter(ResponseFilter responseFilter)
ResponseFilter
that will be invoked as soon as the response is
received, and before AsyncHandler.onStatusReceived(HttpResponseStatus)
.
responseFilter
- an ResponseFilter
public AsyncHttpClientConfig.Builder removeResponseFilter(ResponseFilter responseFilter)
ResponseFilter
that will be invoked as soon as the response is
received, and before AsyncHandler.onStatusReceived(HttpResponseStatus)
.
responseFilter
- an ResponseFilter
public AsyncHttpClientConfig build()
AsyncHttpClientConfig
AsyncHttpClientConfig
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |