public static class ConnectionProfile.Builder
extends java.lang.Object
ConnectionProfile
Constructor and Description |
---|
Builder()
create an empty builder
|
Builder(ConnectionProfile source)
copy constructor, using another profile as a base
|
Modifier and Type | Method and Description |
---|---|
ConnectionProfile.Builder |
addConnections(int numConnections,
TransportRequestOptions.Type... types)
Adds a number of connections for one or more types.
|
ConnectionProfile |
build()
Creates a new
ConnectionProfile based on the added connections. |
ConnectionProfile.Builder |
setConnectTimeout(TimeValue connectTimeout)
Sets a connect timeout for this connection profile
|
ConnectionProfile.Builder |
setHandshakeTimeout(TimeValue handshakeTimeout)
Sets a handshake timeout for this connection profile
|
public Builder()
public Builder(ConnectionProfile source)
public ConnectionProfile.Builder setConnectTimeout(TimeValue connectTimeout)
public ConnectionProfile.Builder setHandshakeTimeout(TimeValue handshakeTimeout)
public ConnectionProfile.Builder addConnections(int numConnections, TransportRequestOptions.Type... types)
numConnections
- the number of connections to use in the pool for the given connection typestypes
- a set of types that should share the given number of connectionspublic ConnectionProfile build()
ConnectionProfile
based on the added connections.java.lang.IllegalStateException
- if any of the TransportRequestOptions.Type
enum is missing