org.apache.hc.client5.http.impl.nio

## Class PoolingAsyncClientConnectionManagerBuilder

- java.lang.Object
- - org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder

    public class PoolingAsyncClientConnectionManagerBuilder
    extends Object

Builder for `PoolingAsyncClientConnectionManager` instances.

When a particular component is not explicitly set 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()`.

- ssl.TrustManagerFactory.algorithm
- javax.net.ssl.trustStoreType
- javax.net.ssl.trustStore
- javax.net.ssl.trustStoreProvider
- javax.net.ssl.trustStorePassword
- ssl.KeyManagerFactory.algorithm
- javax.net.ssl.keyStoreType
- javax.net.ssl.keyStore
- javax.net.ssl.keyStoreProvider
- javax.net.ssl.keyStorePassword
- https.protocols
- https.cipherSuites

Since:
  5.0

### Constructor Summary

Constructors
`protected` `PoolingAsyncClientConnectionManagerBuilder()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`PoolingAsyncClientConnectionManager` `build()`
`static PoolingAsyncClientConnectionManagerBuilder` `create()`
`protected AsyncClientConnectionOperator` `createConnectionOperator(TlsStrategy tlsStrategy, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)`
`PoolingAsyncClientConnectionManagerBuilder` `setConnectionConfigResolver(Resolver<HttpRoute,ConnectionConfig> connectionConfigResolver)` Sets `Resolver` of `ConnectionConfig` on a per route basis.
`PoolingAsyncClientConnectionManagerBuilder` `setConnectionTimeToLive(TimeValue timeToLive)` Deprecated. Use `setDefaultConnectionConfig(ConnectionConfig)`
`PoolingAsyncClientConnectionManagerBuilder` `setConnPoolPolicy(PoolReusePolicy poolReusePolicy)` Sets `PoolReusePolicy` value.
`PoolingAsyncClientConnectionManagerBuilder` `setDefaultConnectionConfig(ConnectionConfig config)` Sets the same `ConnectionConfig` for all routes.
`PoolingAsyncClientConnectionManagerBuilder` `setDefaultTlsConfig(TlsConfig config)` Sets the same `TlsConfig` for all hosts.
`PoolingAsyncClientConnectionManagerBuilder` `setDnsResolver(DnsResolver dnsResolver)` Sets `DnsResolver` instance.
`PoolingAsyncClientConnectionManagerBuilder` `setMaxConnPerRoute(int maxConnPerRoute)` Sets maximum connection per route value.
`PoolingAsyncClientConnectionManagerBuilder` `setMaxConnTotal(int maxConnTotal)` Sets maximum total connection value.
`PoolingAsyncClientConnectionManagerBuilder` `setMessageMultiplexing(boolean messageMultiplexing)` Use experimental connections pool implementation that acts as a caching facade in front of a standard connection pool and shares already leased connections to multiplex message exchanges over active HTTP/2 connections.
`PoolingAsyncClientConnectionManagerBuilder` `setPoolConcurrencyPolicy(PoolConcurrencyPolicy poolConcurrencyPolicy)` Sets `PoolConcurrencyPolicy` value.
`PoolingAsyncClientConnectionManagerBuilder` `setSchemePortResolver(SchemePortResolver schemePortResolver)` Sets `SchemePortResolver` instance.
`PoolingAsyncClientConnectionManagerBuilder` `setTlsConfigResolver(Resolver<HttpHost,TlsConfig> tlsConfigResolver)` Sets `Resolver` of `TlsConfig` on a per host basis.
`PoolingAsyncClientConnectionManagerBuilder` `setTlsStrategy(TlsStrategy tlsStrategy)` Sets `TlsStrategy` instance for TLS connections.
`PoolingAsyncClientConnectionManagerBuilder` `setValidateAfterInactivity(TimeValue validateAfterInactivity)` Deprecated. Use `setConnectionConfigResolver(Resolver)`.
`PoolingAsyncClientConnectionManagerBuilder` `useSystemProperties()` Use system properties when creating and configuring default implementations.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PoolingAsyncClientConnectionManagerBuilder

    @Internal
    protected PoolingAsyncClientConnectionManagerBuilder()

### Method Detail

#### create

    public static PoolingAsyncClientConnectionManagerBuilder create()

#### setTlsStrategy

    public final PoolingAsyncClientConnectionManagerBuilder setTlsStrategy(TlsStrategy tlsStrategy)

Sets `TlsStrategy` instance for TLS connections.

Returns:
  this instance.

#### setDnsResolver

    public final PoolingAsyncClientConnectionManagerBuilder setDnsResolver(DnsResolver dnsResolver)

Sets `DnsResolver` instance.

Returns:
  this instance.

#### setSchemePortResolver

    public final PoolingAsyncClientConnectionManagerBuilder setSchemePortResolver(SchemePortResolver schemePortResolver)

Sets `SchemePortResolver` instance.

Returns:
  this instance.

#### setPoolConcurrencyPolicy

    public final PoolingAsyncClientConnectionManagerBuilder setPoolConcurrencyPolicy(PoolConcurrencyPolicy poolConcurrencyPolicy)

Sets `PoolConcurrencyPolicy` value.

Returns:
  this instance.

#### setConnPoolPolicy

    public final PoolingAsyncClientConnectionManagerBuilder setConnPoolPolicy(PoolReusePolicy poolReusePolicy)

Sets `PoolReusePolicy` value.

Returns:
  this instance.

#### setMaxConnTotal

    public final PoolingAsyncClientConnectionManagerBuilder setMaxConnTotal(int maxConnTotal)

Sets maximum total connection value.

Returns:
  this instance.

#### setMaxConnPerRoute

    public final PoolingAsyncClientConnectionManagerBuilder setMaxConnPerRoute(int maxConnPerRoute)

Sets maximum connection per route value.

Returns:
  this instance.

#### setDefaultConnectionConfig

    public final PoolingAsyncClientConnectionManagerBuilder setDefaultConnectionConfig(ConnectionConfig config)

Sets the same `ConnectionConfig` for all routes.

Returns:
  this instance.
Since:
  5.2

#### setConnectionConfigResolver

    public final PoolingAsyncClientConnectionManagerBuilder setConnectionConfigResolver(Resolver<HttpRoute,ConnectionConfig> connectionConfigResolver)

Sets `Resolver` of `ConnectionConfig` on a per route basis.

Returns:
  this instance.
Since:
  5.2

#### setDefaultTlsConfig

    public final PoolingAsyncClientConnectionManagerBuilder setDefaultTlsConfig(TlsConfig config)

Sets the same `TlsConfig` for all hosts.

Returns:
  this instance.
Since:
  5.2

#### setTlsConfigResolver

    public final PoolingAsyncClientConnectionManagerBuilder setTlsConfigResolver(Resolver<HttpHost,TlsConfig> tlsConfigResolver)

Sets `Resolver` of `TlsConfig` on a per host basis.

Returns:
  this instance.
Since:
  5.2

#### setConnectionTimeToLive

    @Deprecated
    public final PoolingAsyncClientConnectionManagerBuilder setConnectionTimeToLive(TimeValue timeToLive)

Deprecated. Use `setDefaultConnectionConfig(ConnectionConfig)`
Sets maximum time to live for persistent connections

Returns:
  this instance.

#### setValidateAfterInactivity

    @Deprecated
    public final PoolingAsyncClientConnectionManagerBuilder setValidateAfterInactivity(TimeValue validateAfterInactivity)

Deprecated. Use `setConnectionConfigResolver(Resolver)`.
Sets period after inactivity after which persistent connections must be checked to ensure they are still valid.

Returns:
  this instance.

#### useSystemProperties

    public final PoolingAsyncClientConnectionManagerBuilder useSystemProperties()

Use system properties when creating and configuring default implementations.

Returns:
  this instance.

#### setMessageMultiplexing

    @Experimental
    public final PoolingAsyncClientConnectionManagerBuilder setMessageMultiplexing(boolean messageMultiplexing)

Use experimental connections pool implementation that acts as a caching facade in front of a standard connection pool and shares already leased connections to multiplex message exchanges over active HTTP/2 connections.

Please note this flag has no effect on HTTP/1.1 and HTTP/1.0 connections.

This feature is considered experimenal

Returns:
  this instance.
Since:
  5.5

#### createConnectionOperator

    @Internal
    protected AsyncClientConnectionOperator createConnectionOperator(TlsStrategy tlsStrategy,
                                                                               SchemePortResolver schemePortResolver,
                                                                               DnsResolver dnsResolver)

#### build

    public PoolingAsyncClientConnectionManager build()