Class ConnectionConfig
java.lang.Object
org.apache.hc.client5.http.config.ConnectionConfig
- All Implemented Interfaces:
Cloneable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.util.Timeoutstatic final ConnectionConfigThe default connection configuration.private static final org.apache.hc.core5.util.Timeoutprivate final org.apache.hc.core5.util.Timeoutprivate final org.apache.hc.core5.util.Timeoutprivate final org.apache.hc.core5.util.TimeValueprivate final org.apache.hc.core5.util.TimeValue -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIntended for CDI compatibility(package private)ConnectionConfig(org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.util.Timeout socketTimeout, org.apache.hc.core5.util.Timeout idleTimeout, org.apache.hc.core5.util.TimeValue validateAfterInactivity, org.apache.hc.core5.util.TimeValue timeToLive) -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionConfigclone()static ConnectionConfig.Buildercopy(ConnectionConfig config) Creates a new builder forConnectionConfigbased on an existing instance.static ConnectionConfig.Buildercustom()Creates a new builder forConnectionConfig.org.apache.hc.core5.util.TimeoutGets the timeout until the target endpoint acknowledges accepting the connection request.org.apache.hc.core5.util.TimeoutGets the maximum period of idleness for a connection.org.apache.hc.core5.util.TimeoutGets the default socket timeout value for I/O operations on connections created by this configuration.org.apache.hc.core5.util.TimeValueGets the total span of time connections can be kept alive or execute requests.org.apache.hc.core5.util.TimeValueGets the period of inactivity after which persistent connections must be re-validated.toString()
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT
private static final org.apache.hc.core5.util.Timeout DEFAULT_CONNECT_TIMEOUT -
DEFAULT
The default connection configuration.- Timeout connectTimeout: 3 minutes
- Timeout socketTimeout:
null(undefined) - Timeout idleTimeout:
null(undefined) - TimeValue validateAfterInactivity:
null(undefined) - TimeValue timeToLive:
null(undefined)
-
connectTimeout
private final org.apache.hc.core5.util.Timeout connectTimeout -
socketTimeout
private final org.apache.hc.core5.util.Timeout socketTimeout -
idleTimeout
private final org.apache.hc.core5.util.Timeout idleTimeout -
validateAfterInactivity
private final org.apache.hc.core5.util.TimeValue validateAfterInactivity -
timeToLive
private final org.apache.hc.core5.util.TimeValue timeToLive
-
-
Constructor Details
-
ConnectionConfig
protected ConnectionConfig()Intended for CDI compatibility -
ConnectionConfig
ConnectionConfig(org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.util.Timeout socketTimeout, org.apache.hc.core5.util.Timeout idleTimeout, org.apache.hc.core5.util.TimeValue validateAfterInactivity, org.apache.hc.core5.util.TimeValue timeToLive)
-
-
Method Details
-
getSocketTimeout
public org.apache.hc.core5.util.Timeout getSocketTimeout()Gets 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.- Returns:
- the default socket timeout value, defaults to null.
- See Also:
-
getConnectTimeout
public org.apache.hc.core5.util.Timeout getConnectTimeout()Gets the timeout until the target endpoint acknowledges accepting the connection request.Note that isn't the same time as the new connection being fully established. An HTTPS connection cannot be considered fully established until the TLS handshake has been successfully completed.
A timeout value of zero is interpreted as an infinite timeout.
- Returns:
- the timeout until the target endpoint acknowledges accepting the connection request, defaults to 3 minutes.
- See Also:
-
getIdleTimeout
public org.apache.hc.core5.util.Timeout getIdleTimeout()Gets the maximum period of idleness for a connection.Implementations can use this value to discard connections that have been idle for too long.
- Returns:
- the maximum period of idleness for a connection, defaults to null.
- See Also:
-
getValidateAfterInactivity
public org.apache.hc.core5.util.TimeValue getValidateAfterInactivity()Gets the period of inactivity after which persistent connections must be re-validated.- Returns:
- the period of inactivity after which persistent connections must be re-validated, defaults to null.
- See Also:
-
getTimeToLive
public org.apache.hc.core5.util.TimeValue getTimeToLive()Gets the total span of time connections can be kept alive or execute requests.- Returns:
- the total span of time connections can be kept alive or execute requests, defaults to null.
- See Also:
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
toString
-
custom
Creates a new builder forConnectionConfig.- Returns:
- a new builder for
ConnectionConfig.
-
copy
Creates a new builder forConnectionConfigbased on an existing instance.- Parameters:
config- the instance to copy.- Returns:
- a new builder for
ConnectionConfig.
-