Package org.elasticsearch.transport
Class ConnectionProfile.Builder
- java.lang.Object
-
- org.elasticsearch.transport.ConnectionProfile.Builder
-
- Enclosing class:
- ConnectionProfile
public static class ConnectionProfile.Builder extends java.lang.ObjectA builder to build a newConnectionProfile
-
-
Constructor Summary
Constructors Constructor Description Builder()create an empty builderBuilder(ConnectionProfile source)copy constructor, using another profile as a base
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnections(int numConnections, TransportRequestOptions.Type... types)Adds a number of connections for one or more types.ConnectionProfilebuild()Creates a newConnectionProfilebased on the added connections.voidsetConnectTimeout(TimeValue connectTimeout)Sets a connect timeout for this connection profilevoidsetHandshakeTimeout(TimeValue handshakeTimeout)Sets a handshake timeout for this connection profile
-
-
-
Constructor Detail
-
Builder
public Builder()
create an empty builder
-
Builder
public Builder(ConnectionProfile source)
copy constructor, using another profile as a base
-
-
Method Detail
-
setConnectTimeout
public void setConnectTimeout(TimeValue connectTimeout)
Sets a connect timeout for this connection profile
-
setHandshakeTimeout
public void setHandshakeTimeout(TimeValue handshakeTimeout)
Sets a handshake timeout for this connection profile
-
addConnections
public void addConnections(int numConnections, TransportRequestOptions.Type... types)Adds a number of connections for one or more types. Each type can only be added once.- Parameters:
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 connections
-
build
public ConnectionProfile build()
Creates a newConnectionProfilebased on the added connections.- Throws:
java.lang.IllegalStateException- if any of theTransportRequestOptions.Typeenum is missing
-
-