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.Object
A builder to build a new
ConnectionProfile-
Constructor Summary
Constructors Constructor Description Builder()create an empty builderBuilder(ConnectionProfile source)copy constructor, using another profile as a base -
Method Summary
Modifier and Type Method Description ConnectionProfile.BuilderaddConnections(int numConnections, TransportRequestOptions.Type... types)Adds a number of connections for one or more types.ConnectionProfilebuild()Creates a newConnectionProfilebased on the added connections.ConnectionProfile.BuildersetCompressionEnabled(boolean compressionEnabled)Sets compression enabled for this connection profileConnectionProfile.BuildersetConnectTimeout(TimeValue connectTimeout)Sets a connect timeout for this connection profileConnectionProfile.BuildersetHandshakeTimeout(TimeValue handshakeTimeout)Sets a handshake timeout for this connection profileConnectionProfile.BuildersetPingInterval(TimeValue pingInterval)Sets a ping interval for this connection profile
-
Constructor Details
-
Method Details
-
setConnectTimeout
Sets a connect timeout for this connection profile -
setHandshakeTimeout
Sets a handshake timeout for this connection profile -
setPingInterval
Sets a ping interval for this connection profile -
setCompressionEnabled
Sets compression enabled for this connection profile -
addConnections
public ConnectionProfile.Builder 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
Creates a newConnectionProfilebased on the added connections.- Throws:
java.lang.IllegalStateException- if any of theTransportRequestOptions.Typeenum is missing
-