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
`ConnectionConfig` `build()`
`ConnectionConfig.Builder` `setConnectTimeout(long connectTimeout, TimeUnit timeUnit)`
`ConnectionConfig.Builder` `setConnectTimeout(Timeout connectTimeout)` Determines the timeout until a new connection is fully established.
`ConnectionConfig.Builder` `setIdleTimeout(long idleTimeout, TimeUnit timeUnit)`
`ConnectionConfig.Builder` `setIdleTimeout(Timeout idleTimeout)` Determines the maximum period of idleness for a connection.
`ConnectionConfig.Builder` `setSocketTimeout(int soTimeout, TimeUnit timeUnit)`
`ConnectionConfig.Builder` `setSocketTimeout(Timeout soTimeout)` Determines the default socket timeout value for I/O operations on connections created by this configuration.
`ConnectionConfig.Builder` `setTimeToLive(long timeToLive, TimeUnit timeUnit)`
`ConnectionConfig.Builder` `setTimeToLive(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(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(Timeout soTimeout)

Determines the default socket timeout value for I/O operations on connections created by this configuration. A timeout value of zero is interpreted as an infinite timeout.

This value acts as a baseline at the connection management layer. This parameter overrides the socket timeout setting applied at the I/O layer and in its tuen can overridden by settings applied at the protocol layer for the duration of a message exchange.

Default: `null` (undefined)

Returns:
  this instance.

#### setConnectTimeout

    public ConnectionConfig.Builder setConnectTimeout(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)`

#### setIdleTimeout

    public ConnectionConfig.Builder setIdleTimeout(Timeout idleTimeout)

Determines the maximum period of idleness for a connection. Connections that are idle for longer than `idleTimeout` are no longer eligible for reuse.

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

Default: `null` (undefined)

Returns:
  this instance.
Since:
  5.6

#### setIdleTimeout

    public ConnectionConfig.Builder setIdleTimeout(long idleTimeout,
                                                   TimeUnit timeUnit)

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

#### setValidateAfterInactivity

    public ConnectionConfig.Builder setValidateAfterInactivity(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(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()