@NotThreadSafe 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() |
public static HttpAsyncClientBuilder create()
public final HttpAsyncClientBuilder setPublicSuffixMatcher(PublicSuffixMatcher publicSuffixMatcher)
PublicSuffixMatcherLoader
.PublicSuffixMatcher
,
PublicSuffixMatcherLoader
public 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(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(ConnectionReuseStrategy reuseStrategy)
ConnectionReuseStrategy
instance.public final HttpAsyncClientBuilder setKeepAliveStrategy(ConnectionKeepAliveStrategy keepAliveStrategy)
ConnectionKeepAliveStrategy
instance.public final HttpAsyncClientBuilder setUserTokenHandler(UserTokenHandler userTokenHandler)
UserTokenHandler
instance.
Please note this value can be overridden by the disableConnectionState()
method.
public final HttpAsyncClientBuilder setTargetAuthenticationStrategy(AuthenticationStrategy targetAuthStrategy)
AuthenticationStrategy
instance for proxy
authentication.public final HttpAsyncClientBuilder setProxyAuthenticationStrategy(AuthenticationStrategy proxyAuthStrategy)
AuthenticationStrategy
instance for target
host authentication.public final HttpAsyncClientBuilder setHttpProcessor(HttpProcessor httpprocessor)
HttpProcessor
instance.public final HttpAsyncClientBuilder addInterceptorFirst(HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final HttpAsyncClientBuilder addInterceptorLast(HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final HttpAsyncClientBuilder addInterceptorFirst(HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final HttpAsyncClientBuilder addInterceptorLast(HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final HttpAsyncClientBuilder setRoutePlanner(HttpRoutePlanner routePlanner)
HttpRoutePlanner
instance.public final HttpAsyncClientBuilder setRedirectStrategy(RedirectStrategy redirectStrategy)
RedirectStrategy
instance.public final HttpAsyncClientBuilder setDefaultCookieStore(CookieStore cookieStore)
CookieStore
instance which will be used for
request execution if not explicitly set in the client execution context.public final HttpAsyncClientBuilder setDefaultCredentialsProvider(CredentialsProvider credentialsProvider)
CredentialsProvider
instance which will be used
for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setDefaultAuthSchemeRegistry(Lookup<AuthSchemeProvider> authSchemeRegistry)
AuthScheme
registry which will
be used for request execution if not explicitly set in the client execution
context.public final HttpAsyncClientBuilder setDefaultCookieSpecRegistry(Lookup<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(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(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 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(ConnectionConfig config)
ConnectionConfig
.
Please note this value can be overridden by the setConnectionManager(
org.apache.http.nio.conn.NHttpClientConnectionManager)
method.
public final HttpAsyncClientBuilder setDefaultRequestConfig(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–2015 The Apache Software Foundation. All rights reserved.