org.apache.hc.client5.http.config

## Class ConnectionConfig.Builder

- java.lang.Object
- - org.apache.hc.client5.http.config.ConnectionConfig.Builder

- Enclosing class:
    ConnectionConfig

      public static class ConnectionConfig.Builder
      extends Object

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConnectionConfig` | `build()`
    `ConnectionConfig.Builder` | `setConnectTimeout(long connectTimeout, TimeUnit timeUnit)`
    `ConnectionConfig.Builder` | `setConnectTimeout(org.apache.hc.core5.util.Timeout connectTimeout)` Determines the timeout until a new connection is fully established.
    `ConnectionConfig.Builder` | `setSocketTimeout(int soTimeout, TimeUnit timeUnit)`
    `ConnectionConfig.Builder` | `setSocketTimeout(org.apache.hc.core5.util.Timeout soTimeout)` Determines the default socket timeout value for I/O operations.
    `ConnectionConfig.Builder` | `setTimeToLive(long timeToLive, TimeUnit timeUnit)`
    `ConnectionConfig.Builder` | `setTimeToLive(org.apache.hc.core5.util.TimeValue timeToLive)` Defines the total span of time connections can be kept alive or execute requests.
    `ConnectionConfig.Builder` | `setValidateAfterInactivity(long validateAfterInactivity, TimeUnit timeUnit)`
    `ConnectionConfig.Builder` | `setValidateAfterInactivity(org.apache.hc.core5.util.TimeValue validateAfterInactivity)` Defines period of inactivity after which persistent connections must be re-validated prior to being leased to the consumer.

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

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

- - ### Method Detail

    - #### setSocketTimeout

          public ConnectionConfig.Builder setSocketTimeout(int soTimeout,
                                                           TimeUnit timeUnit)

      Returns:
        this instance.
      See Also:
        `setSocketTimeout(Timeout)`

    - #### setSocketTimeout

          public ConnectionConfig.Builder setSocketTimeout(org.apache.hc.core5.util.Timeout soTimeout)

      Determines the default socket timeout value for I/O operations.

      Default: `null` (undefined)

      Returns:
        this instance.

    - #### setConnectTimeout

          public ConnectionConfig.Builder setConnectTimeout(org.apache.hc.core5.util.Timeout connectTimeout)

      Determines the timeout until a new connection is fully established.

      A timeout value of zero is interpreted as an infinite timeout.

      Default: 3 minutes

      Returns:
        this instance.

    - #### setConnectTimeout

          public ConnectionConfig.Builder setConnectTimeout(long connectTimeout,
                                                            TimeUnit timeUnit)

      Returns:
        this instance.
      See Also:
        `setConnectTimeout(Timeout)`

    - #### setValidateAfterInactivity

          public ConnectionConfig.Builder setValidateAfterInactivity(org.apache.hc.core5.util.TimeValue validateAfterInactivity)

      Defines period of inactivity after which persistent connections must be re-validated prior to being leased to the consumer. Negative values passed to this method disable connection validation.

      Default: `null` (undefined)

      Returns:
        this instance.

    - #### setValidateAfterInactivity

          public ConnectionConfig.Builder setValidateAfterInactivity(long validateAfterInactivity,
                                                                     TimeUnit timeUnit)

      Returns:
        this instance.
      See Also:
        `setValidateAfterInactivity(TimeValue)`

    - #### setTimeToLive

          public ConnectionConfig.Builder setTimeToLive(org.apache.hc.core5.util.TimeValue timeToLive)

      Defines the total span of time connections can be kept alive or execute requests.

      Default: `null` (undefined)

      Returns:
        this instance.

    - #### setTimeToLive

          public ConnectionConfig.Builder setTimeToLive(long timeToLive,
                                                        TimeUnit timeUnit)

      Returns:
        this instance.
      See Also:
        `setTimeToLive(TimeValue)`

    - #### build

          public ConnectionConfig build()

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