Package org.elasticsearch.transport
Class ConnectionProfile.Builder
java.lang.Object
org.elasticsearch.transport.ConnectionProfile.Builder
- Enclosing class:
- ConnectionProfile
A builder to build a new
ConnectionProfile
-
Constructor Summary
ConstructorDescriptionBuilder()
create an empty builderBuilder(ConnectionProfile source)
copy constructor, using another profile as a base -
Method Summary
Modifier and TypeMethodDescriptionaddConnections(int numConnections, TransportRequestOptions.Type... types)
Adds a number of connections for one or more types.build()
Creates a newConnectionProfile
based on the added connections.setCompressionEnabled(Compression.Enabled compressionEnabled)
Sets compression enabled configuration for this connection profilesetCompressionScheme(Compression.Scheme compressionScheme)
Sets compression scheme for this connection profilesetConnectTimeout(org.elasticsearch.core.TimeValue connectTimeout)
Sets a connect timeout for this connection profilesetHandshakeTimeout(org.elasticsearch.core.TimeValue handshakeTimeout)
Sets a handshake timeout for this connection profilesetPingInterval(org.elasticsearch.core.TimeValue pingInterval)
Sets a ping interval for this connection profile
-
Constructor Details
-
Builder
public Builder()create an empty builder -
Builder
copy constructor, using another profile as a base
-
-
Method Details
-
setConnectTimeout
public ConnectionProfile.Builder setConnectTimeout(org.elasticsearch.core.TimeValue connectTimeout)Sets a connect timeout for this connection profile -
setHandshakeTimeout
public ConnectionProfile.Builder setHandshakeTimeout(org.elasticsearch.core.TimeValue handshakeTimeout)Sets a handshake timeout for this connection profile -
setPingInterval
Sets a ping interval for this connection profile -
setCompressionEnabled
Sets compression enabled configuration for this connection profile -
setCompressionScheme
Sets compression scheme 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 newConnectionProfile
based on the added connections.- Throws:
IllegalStateException
- if any of theTransportRequestOptions.Type
enum is missing
-