public class HttpAsyncClientBuilder extends Object
CloseableHttpAsyncClient instances.
When a particular component is not explicitly this class will
use its default implementation. System properties will be taken
into account when configuring the default implementations when
useSystemProperties() method is called prior to calling
build().
Please note that some settings used by this class can be mutually
exclusive and may not apply when building CloseableHttpAsyncClient
instances.
| Modifier | Constructor and Description |
|---|---|
protected |
HttpAsyncClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
HttpAsyncClientBuilder |
addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.
|
HttpAsyncClientBuilder |
addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.
|
HttpAsyncClientBuilder |
addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.
|
HttpAsyncClientBuilder |
addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.
|
CloseableHttpAsyncClient |
build() |
static HttpAsyncClientBuilder |
create() |
HttpAsyncClientBuilder |
disableAuthCaching()
Disables authentication scheme caching.
|
HttpAsyncClientBuilder |
disableConnectionState()
Disables connection state tracking.
|
HttpAsyncClientBuilder |
disableCookieManagement()
Disables state (cookie) management.
|
HttpAsyncClientBuilder |
setConnectionManager(NHttpClientConnectionManager connManager)
Assigns
NHttpClientConnectionManager instance. |
HttpAsyncClientBuilder |
setConnectionManagerShared(boolean shared)
Defines the connection manager is to be shared by multiple
client instances.
|
HttpAsyncClientBuilder |
setConnectionReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
Assigns
ConnectionReuseStrategy instance. |
HttpAsyncClientBuilder |
setDefaultAuthSchemeRegistry(org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry)
Assigns default
AuthScheme registry which will
be used for request execution if not explicitly set in the client execution
context. |
HttpAsyncClientBuilder |
setDefaultConnectionConfig(org.apache.http.config.ConnectionConfig config)
Assigns default
ConnectionConfig. |
HttpAsyncClientBuilder |
setDefaultCookieSpecRegistry(org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry)
Assigns default
CookieSpec registry which will
be used for request execution if not explicitly set in the client execution
context. |
HttpAsyncClientBuilder |
setDefaultCookieStore(org.apache.http.client.CookieStore cookieStore)
Assigns default
CookieStore instance which will be used for
request execution if not explicitly set in the client execution context. |
HttpAsyncClientBuilder |
setDefaultCredentialsProvider(org.apache.http.client.CredentialsProvider credentialsProvider)
Assigns default
CredentialsProvider instance which will be used
for request execution if not explicitly set in the client execution
context. |
HttpAsyncClientBuilder |
setDefaultHeaders(Collection<? extends org.apache.http.Header> defaultHeaders)
Assigns default request header values.
|
HttpAsyncClientBuilder |
setDefaultIOReactorConfig(org.apache.http.impl.nio.reactor.IOReactorConfig config)
Assigns default
IOReactorConfig. |
HttpAsyncClientBuilder |
setDefaultRequestConfig(org.apache.http.client.config.RequestConfig config)
Assigns default
RequestConfig instance which will be used
for request execution if not explicitly set in the client execution
context. |
HttpAsyncClientBuilder |
setEventHandler(org.apache.http.nio.NHttpClientEventHandler eventHandler)
Assigns
NHttpClientEventHandler instance. |
HttpAsyncClientBuilder |
setHostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
Deprecated.
|
HttpAsyncClientBuilder |
setHttpProcessor(org.apache.http.protocol.HttpProcessor httpprocessor)
Assigns
HttpProcessor instance. |
HttpAsyncClientBuilder |
setKeepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy)
Assigns
ConnectionKeepAliveStrategy instance. |
HttpAsyncClientBuilder |
setMaxConnPerRoute(int maxConnPerRoute)
Assigns maximum connection per route value.
|
HttpAsyncClientBuilder |
setMaxConnTotal(int maxConnTotal)
Assigns maximum total connection value.
|
HttpAsyncClientBuilder |
setProxy(org.apache.http.HttpHost proxy)
Assigns default proxy value.
|
HttpAsyncClientBuilder |
setProxyAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy proxyAuthStrategy)
Assigns
AuthenticationStrategy instance for target
host authentication. |
HttpAsyncClientBuilder |
setPublicSuffixMatcher(org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher)
Assigns file containing public suffix matcher.
|
HttpAsyncClientBuilder |
setRedirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy)
Assigns
RedirectStrategy instance. |
HttpAsyncClientBuilder |
setRoutePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner)
Assigns
HttpRoutePlanner instance. |
HttpAsyncClientBuilder |
setSchemePortResolver(org.apache.http.conn.SchemePortResolver schemePortResolver)
Assigns
SchemePortResolver instance. |
HttpAsyncClientBuilder |
setSSLContext(SSLContext sslcontext)
Assigns
SSLContext instance. |
HttpAsyncClientBuilder |
setSSLHostnameVerifier(HostnameVerifier hostnameVerifier)
Assigns
HostnameVerifier instance. |
HttpAsyncClientBuilder |
setSSLStrategy(SchemeIOSessionStrategy strategy)
Assigns
SchemeIOSessionStrategy instance. |
HttpAsyncClientBuilder |
setTargetAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy targetAuthStrategy)
Assigns
AuthenticationStrategy instance for proxy
authentication. |
HttpAsyncClientBuilder |
setThreadFactory(ThreadFactory threadFactory)
Assigns
ThreadFactory instance. |
HttpAsyncClientBuilder |
setUserAgent(String userAgent)
Assigns
User-Agent value. |
HttpAsyncClientBuilder |
setUserTokenHandler(org.apache.http.client.UserTokenHandler userTokenHandler)
Assigns
UserTokenHandler instance. |
HttpAsyncClientBuilder |
useSystemProperties()
Use system properties when creating and configuring default
implementations.
|
public static HttpAsyncClientBuilder create()
public final HttpAsyncClientBuilder setPublicSuffixMatcher(org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher)
PublicSuffixMatcherLoader.PublicSuffixMatcher,
PublicSuffixMatcherLoaderpublic final HttpAsyncClientBuilder setConnectionManager(NHttpClientConnectionManager connManager)
NHttpClientConnectionManager instance.public final HttpAsyncClientBuilder setConnectionManagerShared(boolean shared)
If the connection manager is shared its life-cycle is expected to be managed by the caller and it will not be shut down if the client is closed.
shared - defines whether or not the connection manager can be shared
by multiple clients.public final HttpAsyncClientBuilder setSchemePortResolver(org.apache.http.conn.SchemePortResolver schemePortResolver)
SchemePortResolver instance.public final HttpAsyncClientBuilder setMaxConnTotal(int maxConnTotal)
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) method.
public final HttpAsyncClientBuilder setMaxConnPerRoute(int maxConnPerRoute)
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) method.
public final HttpAsyncClientBuilder setConnectionReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
ConnectionReuseStrategy instance.public final HttpAsyncClientBuilder setKeepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy)
ConnectionKeepAliveStrategy instance.public final HttpAsyncClientBuilder setUserTokenHandler(org.apache.http.client.UserTokenHandler userTokenHandler)
UserTokenHandler instance.
Please note this value can be overridden by the disableConnectionState()
method.
public final HttpAsyncClientBuilder setTargetAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy targetAuthStrategy)
AuthenticationStrategy instance for proxy
authentication.public final HttpAsyncClientBuilder setProxyAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy proxyAuthStrategy)
AuthenticationStrategy instance for target
host authentication.public final HttpAsyncClientBuilder setHttpProcessor(org.apache.http.protocol.HttpProcessor httpprocessor)
HttpProcessor instance.public final HttpAsyncClientBuilder addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder setRoutePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner)
HttpRoutePlanner instance.public final HttpAsyncClientBuilder setRedirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy)
RedirectStrategy instance.public final HttpAsyncClientBuilder setDefaultCookieStore(org.apache.http.client.CookieStore cookieStore)
CookieStore instance which will be used for
request execution if not explicitly set in the client execution context.public final HttpAsyncClientBuilder setDefaultCredentialsProvider(org.apache.http.client.CredentialsProvider credentialsProvider)
CredentialsProvider instance which will be used
for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setDefaultAuthSchemeRegistry(org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry)
AuthScheme registry which will
be used for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setDefaultCookieSpecRegistry(org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry)
CookieSpec registry which will
be used for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setUserAgent(String userAgent)
User-Agent value.
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder setProxy(org.apache.http.HttpHost proxy)
Please note this value can be overridden by the setRoutePlanner(
org.apache.http.conn.routing.HttpRoutePlanner) method.
public final HttpAsyncClientBuilder setSSLStrategy(SchemeIOSessionStrategy strategy)
SchemeIOSessionStrategy instance.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) method.
public final HttpAsyncClientBuilder setSSLContext(SSLContext sslcontext)
SSLContext instance.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) and the setSSLStrategy(
org.apache.http.nio.conn.SchemeIOSessionStrategy) methods.
@Deprecated public final HttpAsyncClientBuilder setHostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier hostnameVerifier)
setSSLHostnameVerifier(javax.net.ssl.HostnameVerifier)X509HostnameVerifier instance.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) and the setSSLStrategy(
org.apache.http.nio.conn.SchemeIOSessionStrategy) methods.
public final HttpAsyncClientBuilder setSSLHostnameVerifier(HostnameVerifier hostnameVerifier)
HostnameVerifier instance.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) and the setSSLStrategy(
org.apache.http.nio.conn.SchemeIOSessionStrategy) methods.
public final HttpAsyncClientBuilder setDefaultHeaders(Collection<? extends org.apache.http.Header> defaultHeaders)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder setDefaultIOReactorConfig(org.apache.http.impl.nio.reactor.IOReactorConfig config)
IOReactorConfig.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) method.
public final HttpAsyncClientBuilder setDefaultConnectionConfig(org.apache.http.config.ConnectionConfig config)
ConnectionConfig.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager) method.
public final HttpAsyncClientBuilder setDefaultRequestConfig(org.apache.http.client.config.RequestConfig config)
RequestConfig instance which will be used
for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setThreadFactory(ThreadFactory threadFactory)
ThreadFactory instance.public final HttpAsyncClientBuilder setEventHandler(org.apache.http.nio.NHttpClientEventHandler eventHandler)
NHttpClientEventHandler instance.public final HttpAsyncClientBuilder disableConnectionState()
public final HttpAsyncClientBuilder disableCookieManagement()
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder disableAuthCaching()
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor) method.
public final HttpAsyncClientBuilder useSystemProperties()
public CloseableHttpAsyncClient build()
Copyright © 2010–2016 The Apache Software Foundation. All rights reserved.