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

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PoolingHttpClientConnectionManager` | `build()`
    `static PoolingHttpClientConnectionManagerBuilder` | `create()`
    `PoolingHttpClientConnectionManagerBuilder` | `setConnectionFactory(org.apache.hc.core5.http.io.HttpConnectionFactory<ManagedHttpClientConnection> connectionFactory)` Assigns `HttpConnectionFactory` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setConnectionTimeToLive(org.apache.hc.core5.util.TimeValue timeToLive)` Sets maximum time to live for persistent connections
    `PoolingHttpClientConnectionManagerBuilder` | `setConnPoolPolicy(org.apache.hc.core5.pool.PoolReusePolicy poolReusePolicy)` Assigns `PoolReusePolicy` value.
    `PoolingHttpClientConnectionManagerBuilder` | `setDefaultSocketConfig(org.apache.hc.core5.http.io.SocketConfig config)` Assigns default `SocketConfig`.
    `PoolingHttpClientConnectionManagerBuilder` | `setDnsResolver(DnsResolver dnsResolver)` Assigns `DnsResolver` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setMaxConnPerRoute(int maxConnPerRoute)` Assigns maximum connection per route value.
    `PoolingHttpClientConnectionManagerBuilder` | `setMaxConnTotal(int maxConnTotal)` Assigns maximum total connection value.
    `PoolingHttpClientConnectionManagerBuilder` | `setPoolConcurrencyPolicy(org.apache.hc.core5.pool.PoolConcurrencyPolicy poolConcurrencyPolicy)` Assigns `PoolConcurrencyPolicy` value.
    `PoolingHttpClientConnectionManagerBuilder` | `setSchemePortResolver(SchemePortResolver schemePortResolver)` Assigns `SchemePortResolver` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setSSLSocketFactory(LayeredConnectionSocketFactory sslSocketFactory)` Assigns `LayeredConnectionSocketFactory` instance.
    `PoolingHttpClientConnectionManagerBuilder` | `setValidateAfterInactivity(org.apache.hc.core5.util.TimeValue validateAfterInactivity)` Sets period after inactivity after which persistent connections must be checked to ensure they are still valid.
    `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`

- - ### Method Detail

    - #### create

          public static PoolingHttpClientConnectionManagerBuilder create()

    - #### setConnectionFactory

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

      Assigns `HttpConnectionFactory` instance.

    - #### setSSLSocketFactory

          public final PoolingHttpClientConnectionManagerBuilder setSSLSocketFactory(LayeredConnectionSocketFactory sslSocketFactory)

      Assigns `LayeredConnectionSocketFactory` instance.

    - #### setDnsResolver

          public final PoolingHttpClientConnectionManagerBuilder setDnsResolver(DnsResolver dnsResolver)

      Assigns `DnsResolver` instance.

    - #### setSchemePortResolver

          public final PoolingHttpClientConnectionManagerBuilder setSchemePortResolver(SchemePortResolver schemePortResolver)

      Assigns `SchemePortResolver` instance.

    - #### setPoolConcurrencyPolicy

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

      Assigns `PoolConcurrencyPolicy` value.

    - #### setConnPoolPolicy

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

      Assigns `PoolReusePolicy` value.

    - #### setMaxConnTotal

          public final PoolingHttpClientConnectionManagerBuilder setMaxConnTotal(int maxConnTotal)

      Assigns maximum total connection value.

    - #### setMaxConnPerRoute

          public final PoolingHttpClientConnectionManagerBuilder setMaxConnPerRoute(int maxConnPerRoute)

      Assigns maximum connection per route value.

    - #### setDefaultSocketConfig

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

      Assigns default `SocketConfig`.

    - #### setConnectionTimeToLive

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

      Sets maximum time to live for persistent connections

    - #### setValidateAfterInactivity

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

      Sets period after inactivity after which persistent connections must be checked to ensure they are still valid.
      See Also:
        `BHttpConnection.isStale()`

    - #### useSystemProperties

          public final PoolingHttpClientConnectionManagerBuilder useSystemProperties()

      Use system properties when creating and configuring default implementations.

    - #### build

          public PoolingHttpClientConnectionManager build()

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