public class H2AsyncClientBuilder extends Object
CloseableHttpAsyncClient instances.
 
 Concurrent message exchanges with the same connection route executed
 with these CloseableHttpAsyncClient instances will get
 automatically multiplexed over a single physical HTTP/2 connection.
 
When a particular component is not explicitly set this class will use its default implementation.
| Modifier | Constructor and Description | 
|---|---|
| protected  | H2AsyncClientBuilder() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | addCloseable(Closeable closeable)Adds to the list of  Closeableresources to be managed by the client. | 
| H2AsyncClientBuilder | addExecInterceptorAfter(String existing,
                       String name,
                       AsyncExecChainHandler interceptor)Adds this execution interceptor after interceptor with the given name. | 
| H2AsyncClientBuilder | addExecInterceptorBefore(String existing,
                        String name,
                        AsyncExecChainHandler interceptor)Adds this execution interceptor before an existing interceptor. | 
| H2AsyncClientBuilder | addExecInterceptorFirst(String name,
                       AsyncExecChainHandler interceptor)Add an interceptor to the head of the processing list. | 
| H2AsyncClientBuilder | addExecInterceptorLast(String name,
                      AsyncExecChainHandler interceptor)Add an interceptor to the tail of the processing list. | 
| H2AsyncClientBuilder | addRequestInterceptorFirst(org.apache.hc.core5.http.HttpRequestInterceptor interceptor)Adds this protocol interceptor to the head of the protocol processing list. | 
| H2AsyncClientBuilder | addRequestInterceptorLast(org.apache.hc.core5.http.HttpRequestInterceptor interceptor)Adds this protocol interceptor to the tail of the protocol processing list. | 
| H2AsyncClientBuilder | addResponseInterceptorFirst(org.apache.hc.core5.http.HttpResponseInterceptor interceptor)Adds this protocol interceptor to the head of the protocol processing list. | 
| H2AsyncClientBuilder | addResponseInterceptorLast(org.apache.hc.core5.http.HttpResponseInterceptor interceptor)Adds this protocol interceptor to the tail of the protocol processing list. | 
| CloseableHttpAsyncClient | build() | 
| static H2AsyncClientBuilder | create() | 
| protected void | customizeExecChain(org.apache.hc.core5.http.config.NamedElementChain<AsyncExecChainHandler> execChainDefinition)Request exec chain customization and extension. | 
| H2AsyncClientBuilder | disableAuthCaching()Disables authentication scheme caching. | 
| H2AsyncClientBuilder | disableAutomaticRetries()Disables automatic request recovery and re-execution. | 
| H2AsyncClientBuilder | disableCookieManagement()Disables state (cookie) management. | 
| H2AsyncClientBuilder | disableRedirectHandling()Disables automatic redirect handling. | 
| H2AsyncClientBuilder | evictIdleConnections(org.apache.hc.core5.util.TimeValue maxIdleTime)Makes this instance of HttpClient proactively evict idle connections from the
 connection pool using a background thread. | 
| H2AsyncClientBuilder | replaceExecInterceptor(String existing,
                      AsyncExecChainHandler interceptor)Replace an existing interceptor with the given name with new interceptor. | 
| H2AsyncClientBuilder | setCharCodingConfig(org.apache.hc.core5.http.config.CharCodingConfig charCodingConfig)Sets  CharCodingConfigconfiguration. | 
| H2AsyncClientBuilder | setDefaultAuthSchemeRegistry(org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> authSchemeRegistry)Assigns default  AuthSchemeregistry which will
 be used for request execution if not explicitly set in the client execution
 context. | 
| H2AsyncClientBuilder | setDefaultCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> cookieSpecRegistry)Assigns default  CookieSpecregistry
 which will be used for request execution if not explicitly set in the client
 execution context. | 
| H2AsyncClientBuilder | setDefaultCookieStore(CookieStore cookieStore)Assigns default  CookieStoreinstance which will be used for
 request execution if not explicitly set in the client execution context. | 
| H2AsyncClientBuilder | setDefaultCredentialsProvider(CredentialsProvider credentialsProvider)Assigns default  CredentialsProviderinstance which will be used
 for request execution if not explicitly set in the client execution
 context. | 
| H2AsyncClientBuilder | setDefaultHeaders(Collection<? extends org.apache.hc.core5.http.Header> defaultHeaders)Assigns default request header values. | 
| H2AsyncClientBuilder | setDefaultRequestConfig(RequestConfig config)Assigns default  RequestConfiginstance which will be used
 for request execution if not explicitly set in the client execution
 context. | 
| H2AsyncClientBuilder | setDnsResolver(DnsResolver dnsResolver)Assigns  DnsResolverinstance. | 
| H2AsyncClientBuilder | setH2Config(org.apache.hc.core5.http2.config.H2Config h2Config)Sets  H2Configconfiguration. | 
| H2AsyncClientBuilder | setIOReactorConfig(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)Sets  IOReactorConfigconfiguration. | 
| H2AsyncClientBuilder | setProxyAuthenticationStrategy(AuthenticationStrategy proxyAuthStrategy)Assigns  AuthenticationStrategyinstance for proxy
 authentication. | 
| H2AsyncClientBuilder | setRedirectStrategy(RedirectStrategy redirectStrategy)Assigns  RedirectStrategyinstance. | 
| H2AsyncClientBuilder | setRetryStrategy(HttpRequestRetryStrategy retryStrategy)Assigns  HttpRequestRetryStrategyinstance. | 
| H2AsyncClientBuilder | setRoutePlanner(HttpRoutePlanner routePlanner)Assigns  HttpRoutePlannerinstance. | 
| H2AsyncClientBuilder | setSchemePortResolver(SchemePortResolver schemePortResolver)Assigns  SchemePortResolverinstance. | 
| H2AsyncClientBuilder | setTargetAuthenticationStrategy(AuthenticationStrategy targetAuthStrategy)Assigns  AuthenticationStrategyinstance for target
 host authentication. | 
| H2AsyncClientBuilder | setThreadFactory(ThreadFactory threadFactory)Assigns  ThreadFactoryinstance. | 
| H2AsyncClientBuilder | setTlsStrategy(org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)Assigns  TlsStrategyinstance. | 
| H2AsyncClientBuilder | setUserAgent(String userAgent)Assigns  User-Agentvalue. | 
| H2AsyncClientBuilder | useSystemProperties()Use system properties when creating and configuring default
 implementations. | 
public static H2AsyncClientBuilder create()
public final H2AsyncClientBuilder setH2Config(org.apache.hc.core5.http2.config.H2Config h2Config)
H2Config configuration.public final H2AsyncClientBuilder setIOReactorConfig(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)
IOReactorConfig configuration.public final H2AsyncClientBuilder setCharCodingConfig(org.apache.hc.core5.http.config.CharCodingConfig charCodingConfig)
CharCodingConfig configuration.public final H2AsyncClientBuilder setTargetAuthenticationStrategy(AuthenticationStrategy targetAuthStrategy)
AuthenticationStrategy instance for target
 host authentication.public final H2AsyncClientBuilder setProxyAuthenticationStrategy(AuthenticationStrategy proxyAuthStrategy)
AuthenticationStrategy instance for proxy
 authentication.public final H2AsyncClientBuilder addResponseInterceptorFirst(org.apache.hc.core5.http.HttpResponseInterceptor interceptor)
public final H2AsyncClientBuilder addResponseInterceptorLast(org.apache.hc.core5.http.HttpResponseInterceptor interceptor)
public final H2AsyncClientBuilder addExecInterceptorBefore(String existing, String name, AsyncExecChainHandler interceptor)
public final H2AsyncClientBuilder addExecInterceptorAfter(String existing, String name, AsyncExecChainHandler interceptor)
public final H2AsyncClientBuilder replaceExecInterceptor(String existing, AsyncExecChainHandler interceptor)
public final H2AsyncClientBuilder addExecInterceptorFirst(String name, AsyncExecChainHandler interceptor)
public final H2AsyncClientBuilder addExecInterceptorLast(String name, AsyncExecChainHandler interceptor)
public final H2AsyncClientBuilder addRequestInterceptorFirst(org.apache.hc.core5.http.HttpRequestInterceptor interceptor)
public final H2AsyncClientBuilder addRequestInterceptorLast(org.apache.hc.core5.http.HttpRequestInterceptor interceptor)
public final H2AsyncClientBuilder setRetryStrategy(HttpRequestRetryStrategy retryStrategy)
HttpRequestRetryStrategy instance.
 
 Please note this value can be overridden by the disableAutomaticRetries()
 method.
public H2AsyncClientBuilder setRedirectStrategy(RedirectStrategy redirectStrategy)
RedirectStrategy instance.
 
 Please note this value can be overridden by the disableRedirectHandling()
 method.
 
public final H2AsyncClientBuilder setSchemePortResolver(SchemePortResolver schemePortResolver)
SchemePortResolver instance.public final H2AsyncClientBuilder setDnsResolver(DnsResolver dnsResolver)
DnsResolver instance.public final H2AsyncClientBuilder setTlsStrategy(org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)
TlsStrategy instance.public final H2AsyncClientBuilder setThreadFactory(ThreadFactory threadFactory)
ThreadFactory instance.public final H2AsyncClientBuilder setUserAgent(String userAgent)
User-Agent value.public final H2AsyncClientBuilder setDefaultHeaders(Collection<? extends org.apache.hc.core5.http.Header> defaultHeaders)
public final H2AsyncClientBuilder setRoutePlanner(HttpRoutePlanner routePlanner)
HttpRoutePlanner instance.public final H2AsyncClientBuilder setDefaultCredentialsProvider(CredentialsProvider credentialsProvider)
CredentialsProvider instance which will be used
 for request execution if not explicitly set in the client execution
 context.public final H2AsyncClientBuilder setDefaultAuthSchemeRegistry(org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> authSchemeRegistry)
AuthScheme registry which will
 be used for request execution if not explicitly set in the client execution
 context.public final H2AsyncClientBuilder setDefaultCookieSpecRegistry(org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> cookieSpecRegistry)
CookieSpec registry
 which will be used for request execution if not explicitly set in the client
 execution context.public final H2AsyncClientBuilder setDefaultCookieStore(CookieStore cookieStore)
CookieStore instance which will be used for
 request execution if not explicitly set in the client execution context.public final H2AsyncClientBuilder setDefaultRequestConfig(RequestConfig config)
RequestConfig instance which will be used
 for request execution if not explicitly set in the client execution
 context.public final H2AsyncClientBuilder useSystemProperties()
public final H2AsyncClientBuilder disableRedirectHandling()
public final H2AsyncClientBuilder disableAutomaticRetries()
public final H2AsyncClientBuilder disableCookieManagement()
public final H2AsyncClientBuilder disableAuthCaching()
public final H2AsyncClientBuilder evictIdleConnections(org.apache.hc.core5.util.TimeValue maxIdleTime)
 One MUST explicitly close HttpClient with Closeable.close()
 in order to stop and release the background thread.
 
Please note this method has no effect if the instance of HttpClient is configuted to use a shared connection manager.
maxIdleTime - maximum time persistent connections can stay idle while kept alive
 in the connection pool. Connections whose inactivity period exceeds this value will
 get closed and evicted from the pool.@Internal protected void customizeExecChain(org.apache.hc.core5.http.config.NamedElementChain<AsyncExecChainHandler> execChainDefinition)
For internal use.
@Internal protected void addCloseable(Closeable closeable)
Closeable resources to be managed by the client.
 For internal use.
public CloseableHttpAsyncClient build()
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.