public final class ConnectionProfile
extends java.lang.Object
TransportRequestOptions.Type
). This allows to tailor a connection towards a specific usage.Modifier and Type | Class and Description |
---|---|
static class |
ConnectionProfile.Builder
A builder to build a new
ConnectionProfile |
Modifier and Type | Method and Description |
---|---|
static ConnectionProfile |
buildSingleChannelProfile(TransportRequestOptions.Type channelType,
TimeValue connectTimeout,
TimeValue handshakeTimeout)
Builds a connection profile that is dedicated to a single channel type.
|
TimeValue |
getConnectTimeout()
Returns the connect timeout or
null if no explicit timeout is set on this profile. |
TimeValue |
getHandshakeTimeout()
Returns the handshake timeout or
null if no explicit timeout is set on this profile. |
int |
getNumConnections()
Returns the total number of connections for this profile
|
int |
getNumConnectionsPerType(TransportRequestOptions.Type type)
Returns the number of connections per type for this profile.
|
public static ConnectionProfile buildSingleChannelProfile(TransportRequestOptions.Type channelType, @Nullable TimeValue connectTimeout, @Nullable TimeValue handshakeTimeout)
public TimeValue getConnectTimeout()
null
if no explicit timeout is set on this profile.public TimeValue getHandshakeTimeout()
null
if no explicit timeout is set on this profile.public int getNumConnections()
public int getNumConnectionsPerType(TransportRequestOptions.Type type)
getNumConnections()
. For instance if
TransportRequestOptions.Type.BULK
shares connections with
TransportRequestOptions.Type.REG
they will return both the same number of connections from
this method but the connections are not distinct.