public static class ConnectionConfig.Builder extends Object
ConnectionConfig.| Modifier and Type | Method and Description |
|---|---|
ConnectionConfig |
build()
Builds a new
ConnectionConfig instance based on the values provided to the setters methods. |
ConnectionConfig.Builder |
setConnectTimeout(long connectTimeout,
TimeUnit timeUnit)
Sets the timeout until a new connection is fully established.
|
ConnectionConfig.Builder |
setConnectTimeout(Timeout connectTimeout)
Sets the timeout until a new connection is fully established.
|
ConnectionConfig.Builder |
setIdleTimeout(long idleTimeout,
TimeUnit timeUnit)
Sets the maximum period of idleness for a connection.
|
ConnectionConfig.Builder |
setIdleTimeout(Timeout idleTimeout)
Determines the maximum period of idleness for a connection.
|
ConnectionConfig.Builder |
setSocketTimeout(int soTimeout,
TimeUnit timeUnit)
Sets the default socket timeout value for I/O operations on connections created by this configuration.
|
ConnectionConfig.Builder |
setSocketTimeout(Timeout soTimeout)
Sets the default socket timeout value for I/O operations on
connections created by this configuration.
|
ConnectionConfig.Builder |
setTimeToLive(long timeToLive,
TimeUnit timeUnit)
Sets the total span of time connections can be kept alive or execute requests.
|
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)
Sets the period of inactivity after which persistent connections must be re-validated prior to being leased to the consumer.
|
ConnectionConfig.Builder |
setValidateAfterInactivity(TimeValue validateAfterInactivity)
Sets the period of inactivity after which persistent connections must
be re-validated prior to being leased to the consumer.
|
public ConnectionConfig.Builder setSocketTimeout(int soTimeout, TimeUnit timeUnit)
soTimeout - The default socket timeout value for I/O operations.timeUnit - The time unit of the soTimeout parameter.setSocketTimeout(Timeout)public ConnectionConfig.Builder setSocketTimeout(Timeout soTimeout)
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)
soTimeout - The default socket timeout value for I/O operations.public ConnectionConfig.Builder setConnectTimeout(Timeout connectTimeout)
A timeout value of zero is interpreted as an infinite timeout.
Default: 3 minutes
connectTimeout - The timeout until a new connection is fully established.public ConnectionConfig.Builder setConnectTimeout(long connectTimeout, TimeUnit timeUnit)
connectTimeout - The timeout until a new connection is fully established.timeUnit - The time unit of the timeout parameter.setConnectTimeout(Timeout)public ConnectionConfig.Builder setIdleTimeout(Timeout idleTimeout)
idleTimeout are no
longer eligible for reuse.
A timeout value of zero is interpreted as an infinite timeout.
Default: null (undefined)
idleTimeout - The maximum period of idleness for a connection.public ConnectionConfig.Builder setIdleTimeout(long idleTimeout, TimeUnit timeUnit)
Connections that are idle for longer than idleTimeout are no longer eligible for reuse.
idleTimeout - The maximum period of idleness for a connection.timeUnit - setIdleTimeout(Timeout)public ConnectionConfig.Builder setValidateAfterInactivity(TimeValue validateAfterInactivity)
Default: null (undefined)
validateAfterInactivity - The period of inactivity after which persistent connections must be re-validated.public ConnectionConfig.Builder setValidateAfterInactivity(long validateAfterInactivity, TimeUnit timeUnit)
validateAfterInactivity - The period of inactivity after which persistent connections must be re-validated.timeUnit - The time unit of the validateAfterInactivity parameter.setValidateAfterInactivity(TimeValue)public ConnectionConfig.Builder setTimeToLive(TimeValue timeToLive)
Default: null (undefined)
timeToLive - The total span of time connections can be kept alive or execute requests.public ConnectionConfig.Builder setTimeToLive(long timeToLive, TimeUnit timeUnit)
timeToLive - The total span of time connections can be kept alive or execute requests.timeUnit - The time unit of the timeToLive parameter.setTimeToLive(TimeValue)public ConnectionConfig build()
ConnectionConfig instance based on the values provided to the setters methods.ConnectionConfig instance.Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.