org.apache.hc.client5.http.impl.io

## Class PoolingHttpClientConnectionManagerBuilder

- java.lang.Object
- - org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder

-     public class PoolingHttpClientConnectionManagerBuilder
      extends Object

  Builder for `PoolingHttpClientConnectionManager` 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
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PoolingHttpClientConnectionManagerBuilder()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `PoolingHttpClientConnectionManager` | `build()`
    `static PoolingHttpClientConnectionManagerBuilder` | `create()`
    `protected HttpClientConnectionOperator` | `createConnectionOperator(SchemePortResolver schemePortResolver, DnsResolver dnsResolver, TlsSocketStrategy tlsSocketStrategy)`
    `PoolingHttpClientConnectionManagerBuilder` | `setConnectionConfigResolver(org.apache.hc.core5.function.Resolver<HttpRoute,ConnectionConfig> connectionConfigResolver)` Sets `Resolver` of `ConnectionConfig` on a per route basis.
    `PoolingHttpClientConnectionManagerBuilder` | `setConnectionFactory(org.apache.hc.core5.http.io.HttpConnectionFactory<ManagedHttpClientConnection> connectionFactory)` Sets `HttpConnectionFactory` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setConnectionTimeToLive(org.apache.hc.core5.util.TimeValue timeToLive)` Deprecated. Use `setDefaultConnectionConfig(ConnectionConfig)`.
    `PoolingHttpClientConnectionManagerBuilder` | `setConnPoolPolicy(org.apache.hc.core5.pool.PoolReusePolicy poolReusePolicy)` Sets `PoolReusePolicy` value.
    `PoolingHttpClientConnectionManagerBuilder` | `setDefaultConnectionConfig(ConnectionConfig config)` Sets the same `ConnectionConfig` for all routes.
    `PoolingHttpClientConnectionManagerBuilder` | `setDefaultSocketConfig(org.apache.hc.core5.http.io.SocketConfig config)` Sets the same `SocketConfig` for all routes.
    `PoolingHttpClientConnectionManagerBuilder` | `setDefaultTlsConfig(TlsConfig config)` Sets the same `TlsConfig` for all hosts.
    `PoolingHttpClientConnectionManagerBuilder` | `setDnsResolver(DnsResolver dnsResolver)` Sets `DnsResolver` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setMaxConnPerRoute(int maxConnPerRoute)` Sets maximum connection per route value.
    `PoolingHttpClientConnectionManagerBuilder` | `setMaxConnTotal(int maxConnTotal)` Sets maximum total connection value.
    `PoolingHttpClientConnectionManagerBuilder` | `setPoolConcurrencyPolicy(org.apache.hc.core5.pool.PoolConcurrencyPolicy poolConcurrencyPolicy)` Sets `PoolConcurrencyPolicy` value.
    `PoolingHttpClientConnectionManagerBuilder` | `setSchemePortResolver(SchemePortResolver schemePortResolver)` Sets `SchemePortResolver` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setSocketConfigResolver(org.apache.hc.core5.function.Resolver<HttpRoute,org.apache.hc.core5.http.io.SocketConfig> socketConfigResolver)` Sets `Resolver` of `SocketConfig` on a per route basis.
    `PoolingHttpClientConnectionManagerBuilder` | `setSSLSocketFactory(LayeredConnectionSocketFactory sslSocketFactory)` Deprecated. Use `setTlsSocketStrategy(TlsSocketStrategy)`
    `PoolingHttpClientConnectionManagerBuilder` | `setTlsConfigResolver(org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost,TlsConfig> tlsConfigResolver)` Sets `Resolver` of `TlsConfig` on a per host basis.
    `PoolingHttpClientConnectionManagerBuilder` | `setTlsSocketStrategy(TlsSocketStrategy tlsSocketStrategy)` Sets `TlsSocketStrategy` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setValidateAfterInactivity(org.apache.hc.core5.util.TimeValue validateAfterInactivity)` Deprecated. Use `setDefaultConnectionConfig(ConnectionConfig)`.
    `PoolingHttpClientConnectionManagerBuilder` | `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

    - #### PoolingHttpClientConnectionManagerBuilder

          @Internal
          protected PoolingHttpClientConnectionManagerBuilder()

  - ### Method Detail

    - #### create

          public static PoolingHttpClientConnectionManagerBuilder create()

    - #### setConnectionFactory

          public final PoolingHttpClientConnectionManagerBuilder setConnectionFactory(org.apache.hc.core5.http.io.HttpConnectionFactory<ManagedHttpClientConnection> connectionFactory)

      Sets `HttpConnectionFactory` instance.
      Returns:
        this instance.

    - #### setSSLSocketFactory

          @Deprecated
          public final PoolingHttpClientConnectionManagerBuilder setSSLSocketFactory(LayeredConnectionSocketFactory sslSocketFactory)

      Deprecated. Use `setTlsSocketStrategy(TlsSocketStrategy)`
      Sets `LayeredConnectionSocketFactory` instance.
      Returns:
        this instance.

    - #### setTlsSocketStrategy

          public final PoolingHttpClientConnectionManagerBuilder setTlsSocketStrategy(TlsSocketStrategy tlsSocketStrategy)

      Sets `TlsSocketStrategy` instance.
      Returns:
        this instance.

    - #### setDnsResolver

          public final PoolingHttpClientConnectionManagerBuilder setDnsResolver(DnsResolver dnsResolver)

      Sets `DnsResolver` instance.
      Returns:
        this instance.

    - #### setSchemePortResolver

          public final PoolingHttpClientConnectionManagerBuilder setSchemePortResolver(SchemePortResolver schemePortResolver)

      Sets `SchemePortResolver` instance.
      Returns:
        this instance.

    - #### setPoolConcurrencyPolicy

          public final PoolingHttpClientConnectionManagerBuilder setPoolConcurrencyPolicy(org.apache.hc.core5.pool.PoolConcurrencyPolicy poolConcurrencyPolicy)

      Sets `PoolConcurrencyPolicy` value.
      Returns:
        this instance.

    - #### setConnPoolPolicy

          public final PoolingHttpClientConnectionManagerBuilder setConnPoolPolicy(org.apache.hc.core5.pool.PoolReusePolicy poolReusePolicy)

      Sets `PoolReusePolicy` value.
      Returns:
        this instance.

    - #### setMaxConnTotal

          public final PoolingHttpClientConnectionManagerBuilder setMaxConnTotal(int maxConnTotal)

      Sets maximum total connection value.
      Returns:
        this instance.

    - #### setMaxConnPerRoute

          public final PoolingHttpClientConnectionManagerBuilder setMaxConnPerRoute(int maxConnPerRoute)

      Sets maximum connection per route value.
      Returns:
        this instance.

    - #### setDefaultSocketConfig

          public final PoolingHttpClientConnectionManagerBuilder setDefaultSocketConfig(org.apache.hc.core5.http.io.SocketConfig config)

      Sets the same `SocketConfig` for all routes.
      Returns:
        this instance.

    - #### setSocketConfigResolver

          public final PoolingHttpClientConnectionManagerBuilder setSocketConfigResolver(org.apache.hc.core5.function.Resolver<HttpRoute,org.apache.hc.core5.http.io.SocketConfig> socketConfigResolver)

      Sets `Resolver` of `SocketConfig` on a per route basis.
      Returns:
        this instance.
      Since:
        5.2

    - #### setDefaultConnectionConfig

          public final PoolingHttpClientConnectionManagerBuilder setDefaultConnectionConfig(ConnectionConfig config)

      Sets the same `ConnectionConfig` for all routes.
      Returns:
        this instance.
      Since:
        5.2

    - #### setConnectionConfigResolver

          public final PoolingHttpClientConnectionManagerBuilder setConnectionConfigResolver(org.apache.hc.core5.function.Resolver<HttpRoute,ConnectionConfig> connectionConfigResolver)

      Sets `Resolver` of `ConnectionConfig` on a per route basis.
      Returns:
        this instance.
      Since:
        5.2

    - #### setDefaultTlsConfig

          public final PoolingHttpClientConnectionManagerBuilder setDefaultTlsConfig(TlsConfig config)

      Sets the same `TlsConfig` for all hosts.
      Returns:
        this instance.
      Since:
        5.2

    - #### setTlsConfigResolver

          public final PoolingHttpClientConnectionManagerBuilder setTlsConfigResolver(org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost,TlsConfig> tlsConfigResolver)

      Sets `Resolver` of `TlsConfig` on a per host basis.
      Returns:
        this instance.
      Since:
        5.2

    - #### setConnectionTimeToLive

          @Deprecated
          public final PoolingHttpClientConnectionManagerBuilder setConnectionTimeToLive(org.apache.hc.core5.util.TimeValue timeToLive)

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

    - #### setValidateAfterInactivity

          @Deprecated
          public final PoolingHttpClientConnectionManagerBuilder setValidateAfterInactivity(org.apache.hc.core5.util.TimeValue validateAfterInactivity)

      Deprecated. Use `setDefaultConnectionConfig(ConnectionConfig)`.
      Sets period after inactivity after which persistent connections must be checked to ensure they are still valid.
      Returns:
        this instance.

    - #### useSystemProperties

          public final PoolingHttpClientConnectionManagerBuilder useSystemProperties()

      Use system properties when creating and configuring default implementations.
      Returns:
        this instance.

    - #### createConnectionOperator

          @Internal
          protected HttpClientConnectionOperator createConnectionOperator(SchemePortResolver schemePortResolver,
                                                                                    DnsResolver dnsResolver,
                                                                                    TlsSocketStrategy tlsSocketStrategy)

    - #### build

          public PoolingHttpClientConnectionManager build()

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.