Class ConnectionProfile.Builder

org.elasticsearch.transport.ConnectionProfile.Builder
Enclosing class:
ConnectionProfile

public static class ConnectionProfile.Builder extends
A builder to build a new ConnectionProfile
  • Constructor Details

    • Builder

      public Builder()
      create an empty builder
    • Builder

      public Builder(ConnectionProfile source)
      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

      public ConnectionProfile.Builder setPingInterval(org.elasticsearch.core.TimeValue pingInterval)
      Sets a ping interval for this connection profile
    • setCompressionEnabled

      public ConnectionProfile.Builder setCompressionEnabled(Compression.Enabled compressionEnabled)
      Sets compression enabled configuration for this connection profile
    • setCompressionScheme

      public ConnectionProfile.Builder setCompressionScheme(Compression.Scheme compressionScheme)
      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 types
      types - a set of types that should share the given number of connections
    • build

      public ConnectionProfile build()
      Creates a new ConnectionProfile based on the added connections.
      Throws:
      - if any of the TransportRequestOptions.Type enum is missing