Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.impl.async

public Class H2AsyncClientBuilder

extends Object
Class Inheritance
Imports
java.io.Closeable, .IOException, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Collection, .LinkedList, .List, java.util.concurrent.ThreadFactory, org.apache.hc.client5.http.AuthenticationStrategy, .DnsResolver, .HttpRequestRetryStrategy, .SchemePortResolver, org.apache.hc.client5.http.async.AsyncExecChainHandler, org.apache.hc.client5.http.auth.AuthSchemeFactory, .CredentialsProvider, .StandardAuthScheme, org.apache.hc.client5.http.config.ConnectionConfig, .RequestConfig, org.apache.hc.client5.http.cookie.BasicCookieStore, .CookieSpecFactory, .CookieStore, org.apache.hc.client5.http.impl.ChainElement, .CookieSpecSupport, .DefaultAuthenticationStrategy, .DefaultHttpRequestRetryStrategy, .DefaultRedirectStrategy, .DefaultSchemePortResolver, org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider, .BasicSchemeFactory, .BearerSchemeFactory, .DigestSchemeFactory, .SystemDefaultCredentialsProvider, org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator, org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner, org.apache.hc.client5.http.protocol.RedirectStrategy, .RequestAddCookies, .RequestDefaultHeaders, .RequestExpectContinue, .ResponseProcessCookies, org.apache.hc.client5.http.routing.HttpRoutePlanner, org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.concurrent.DefaultThreadFactory, org.apache.hc.core5.function.Callback, .Decorator, .Resolver, org.apache.hc.core5.http.Header, .HttpHost, .HttpRequestInterceptor, .HttpResponseInterceptor, org.apache.hc.core5.http.config.CharCodingConfig, .Lookup, .NamedElementChain, .RegistryBuilder, org.apache.hc.core5.http.nio.command.ShutdownCommand, org.apache.hc.core5.http.nio.ssl.TlsStrategy, org.apache.hc.core5.http.protocol.DefaultHttpProcessor, .HttpProcessor, .HttpProcessorBuilder, .RequestTargetHost, .RequestUserAgent, org.apache.hc.core5.http2.config.H2Config, org.apache.hc.core5.http2.protocol.H2RequestConnControl, .H2RequestContent, .H2RequestTargetHost, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.reactor.Command, .DefaultConnectingIOReactor, .IOEventHandlerFactory, .IOReactorConfig, .IOSession, .IOSessionListener, org.apache.hc.core5.util.Args, .TimeValue, .VersionInfo

Builder for HTTP/2 only 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.

Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private Lookup<AuthSchemeFactory>
private boolean
private CharCodingConfig
private List<Closeable>
private Resolver<HttpHost, ConnectionConfig>
private boolean
private Lookup<CookieSpecFactory>
private CookieStore
private CredentialsProvider
private Collection<? extends Header>
private RequestConfig
private DnsResolver
private boolean
private LinkedList<H2AsyncClientBuilder.ExecInterceptorEntry>
private H2Config
private IOReactorConfig
private Callback<Exception>
private Decorator<IOSession>
private IOSessionListener
private TimeValue
private AuthenticationStrategy
private boolean
private RedirectStrategy
private LinkedList<H2AsyncClientBuilder.RequestInterceptorEntry>
private LinkedList<H2AsyncClientBuilder.ResponseInterceptorEntry>
private HttpRequestRetryStrategy
private HttpRoutePlanner
private SchemePortResolver
private boolean
private AuthenticationStrategy
private ThreadFactory
private TlsStrategy
private String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected void
addCloseable(final Closeable closeable)

Adds to the list of Closeable resources to be managed by the client.

public final H2AsyncClientBuilder
addExecInterceptorAfter(final String existing, final String name, final AsyncExecChainHandler interceptor)

Adds this execution interceptor after interceptor with the given name.

public final H2AsyncClientBuilder
addExecInterceptorBefore(final String existing, final String name, final AsyncExecChainHandler interceptor)

Adds this execution interceptor before an existing interceptor.

public final H2AsyncClientBuilder
addExecInterceptorFirst(final String name, final AsyncExecChainHandler interceptor)

Add an interceptor to the head of the processing list.

public final H2AsyncClientBuilder
addExecInterceptorLast(final String name, final AsyncExecChainHandler interceptor)

Add an interceptor to the tail of the processing list.

public final H2AsyncClientBuilder
addRequestInterceptorFirst(final HttpRequestInterceptor interceptor)

Adds this protocol interceptor to the head of the protocol processing list.

public final H2AsyncClientBuilder
addRequestInterceptorLast(final HttpRequestInterceptor interceptor)

Adds this protocol interceptor to the tail of the protocol processing list.

public final H2AsyncClientBuilder
addResponseInterceptorFirst(final HttpResponseInterceptor interceptor)

Adds this protocol interceptor to the head of the protocol processing list.

public final H2AsyncClientBuilder
addResponseInterceptorLast(final HttpResponseInterceptor interceptor)

Adds this protocol interceptor to the tail of the protocol processing list.

public CloseableHttpAsyncClient
public static H2AsyncClientBuilder
protected void
customizeExecChain(final NamedElementChain<AsyncExecChainHandler> execChainDefinition)

Request exec chain customization and extension.

public final H2AsyncClientBuilder
disableAuthCaching()

Disables authentication scheme caching.

public final H2AsyncClientBuilder
disableAutomaticRetries()

Disables automatic request recovery and re-execution.

public final H2AsyncClientBuilder
disableCookieManagement()

Disables state (cookie) management.

public final H2AsyncClientBuilder
disableRedirectHandling()

Disables automatic redirect handling.

public final H2AsyncClientBuilder
evictIdleConnections(final TimeValue
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.
maxIdleTime
)

Makes this instance of HttpClient proactively evict idle connections from the connection pool using a background thread.

private static String
getProperty(final String key, final String defaultValue)

public final H2AsyncClientBuilder
replaceExecInterceptor(final String existing, final AsyncExecChainHandler interceptor)

Replace an existing interceptor with the given name with new interceptor.

public final H2AsyncClientBuilder
setCharCodingConfig(final CharCodingConfig charCodingConfig)

Sets CharCodingConfig configuration.

public final H2AsyncClientBuilder
setConnectionConfigResolver(final Resolver<HttpHost, ConnectionConfig> connectionConfigResolver)

Assigns Resolver for ConnectionConfig on a per host basis.

public final H2AsyncClientBuilder
setDefaultAuthSchemeRegistry(final Lookup<AuthSchemeFactory> authSchemeRegistry)

Assigns default org.apache.hc.client5.http.auth.AuthScheme registry which will be used for request execution if not explicitly set in the client execution context.

public final H2AsyncClientBuilder
setDefaultConnectionConfig(final ConnectionConfig connectionConfig)

Assigns the same ConnectionConfig for all hosts.

public final H2AsyncClientBuilder
setDefaultCookieSpecRegistry(final Lookup<CookieSpecFactory> cookieSpecRegistry)

Assigns default org.apache.hc.client5.http.cookie.CookieSpec registry which will be used for request execution if not explicitly set in the client execution context.

public final H2AsyncClientBuilder
setDefaultCookieStore(final CookieStore cookieStore)

Assigns default CookieStore instance which will be used for request execution if not explicitly set in the client execution context.

public final H2AsyncClientBuilder
setDefaultCredentialsProvider(final CredentialsProvider credentialsProvider)

Assigns default CredentialsProvider instance which will be used for request execution if not explicitly set in the client execution context.

public final H2AsyncClientBuilder
setDefaultHeaders(final Collection<? extends Header> defaultHeaders)

Assigns default request header values.

public final H2AsyncClientBuilder
setDefaultRequestConfig(final RequestConfig config)

Assigns default RequestConfig instance which will be used for request execution if not explicitly set in the client execution context.

public final H2AsyncClientBuilder
setDnsResolver(final DnsResolver dnsResolver)

Assigns DnsResolver instance.

public final H2AsyncClientBuilder
setH2Config(final H2Config h2Config)

Sets H2Config configuration.

public final H2AsyncClientBuilder
setIOReactorConfig(final IOReactorConfig ioReactorConfig)

Sets IOReactorConfig configuration.

public final H2AsyncClientBuilder
setIoReactorExceptionCallback(final Callback<Exception> ioReactorExceptionCallback)

Sets the callback that will be invoked when the client's IOReactor encounters an uncaught exception.

public final H2AsyncClientBuilder
setIoSessionDecorator(final Decorator<IOSession> ioSessionDecorator)

Sets the IOSession Decorator that will be use with the client's IOReactor.

public final H2AsyncClientBuilder
setIOSessionListener(final IOSessionListener ioSessionListener)

Sets IOSessionListener listener.

public final H2AsyncClientBuilder
setProxyAuthenticationStrategy(final AuthenticationStrategy proxyAuthStrategy)

Assigns AuthenticationStrategy instance for proxy authentication.

public H2AsyncClientBuilder
setRedirectStrategy(final RedirectStrategy redirectStrategy)

Assigns RedirectStrategy instance.

public final H2AsyncClientBuilder
public final H2AsyncClientBuilder
setRoutePlanner(final HttpRoutePlanner routePlanner)

Assigns HttpRoutePlanner instance.

public final H2AsyncClientBuilder
setSchemePortResolver(final SchemePortResolver schemePortResolver)

Assigns SchemePortResolver instance.

public final H2AsyncClientBuilder
setTargetAuthenticationStrategy(final AuthenticationStrategy targetAuthStrategy)

Assigns AuthenticationStrategy instance for target host authentication.

public final H2AsyncClientBuilder
setThreadFactory(final ThreadFactory threadFactory)

Assigns ThreadFactory instance.

public final H2AsyncClientBuilder
setTlsStrategy(final TlsStrategy tlsStrategy)

Assigns TlsStrategy instance.

public final H2AsyncClientBuilder
setUserAgent(final String userAgent)

Assigns User-Agent value.

public final H2AsyncClientBuilder
useSystemProperties()

Use system properties when creating and configuring default implementations.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait