Class Client.Environment

java.lang.Object
com.couchbase.client.dcp.Client.Environment
Enclosing class:
Client

public static class Client.Environment extends Object
The Client.Environment is responsible to carry various configuration and state information throughout the lifecycle.
  • Field Details

    • DEFAULT_BOOTSTRAP_TIMEOUT

      public static final Duration DEFAULT_BOOTSTRAP_TIMEOUT
    • DEFAULT_CONFIG_REFRESH_INTERVAL

      public static final Duration DEFAULT_CONFIG_REFRESH_INTERVAL
    • DEFAULT_SOCKET_CONNECT_TIMEOUT

      public static final long DEFAULT_SOCKET_CONNECT_TIMEOUT
    • DEFAULT_DCP_CHANNELS_RECONNECT_DELAY

      public static final reactor.util.retry.Retry DEFAULT_DCP_CHANNELS_RECONNECT_DELAY
    • DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS

      public static final int DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS
      See Also:
  • Method Details

    • networkSelector

      public com.couchbase.client.core.topology.NetworkSelector networkSelector()
    • portSelector

      public com.couchbase.client.core.topology.PortSelector portSelector()
    • clusterAt

      public List<com.couchbase.client.core.util.HostAndPort> clusterAt()
      Returns the node addresses to use for bootstrapping.

      If the connection string is eligible for DNS SRV resolution, the DSN SRV lookup happens every time this method is called.

    • connectionString

      public com.couchbase.client.core.util.ConnectionString connectionString()
    • networkResolution

      public com.couchbase.client.core.env.NetworkResolution networkResolution()
      Returns the configured hostname selection strategy.
    • dataEventHandler

      public DataEventHandler dataEventHandler()
      Returns the currently attached data event handler.
    • streamEventBuffer

      public StreamEventBuffer streamEventBuffer()
      Returns the stream event buffer used for rollback mitigation.
      Throws:
      IllegalStateException - if persistence polling / rollback mitigation is disabled
    • persistedSeqnos

      public PersistedSeqnos persistedSeqnos()
      Returns the bookkeeper for observed seqno persistence.
    • persistencePollingIntervalMillis

      public long persistencePollingIntervalMillis()
      Returns the interval between observeSeqno requests. Non-positive values disable persistence polling.
    • persistencePollingEnabled

      public boolean persistencePollingEnabled()
      Returns true if and only if rollback mitigation / persistence polling is enabled.
    • controlEventHandler

      public ControlEventHandler controlEventHandler()
      Returns the current attached control event handler.
    • connectionNameGenerator

      public ConnectionNameGenerator connectionNameGenerator()
      Returns the name generator used to identify DCP sockets.
    • bucket

      public String bucket()
      Name of the bucket used.
    • collectionsAware

      public boolean collectionsAware()
      Whether the client should operate in collections-aware mode
    • collectionIds

      public Set<Long> collectionIds()
      Collection IDs to filter on, or empty for all collections.
    • collectionNames

      public Set<String> collectionNames()
      Collection names to filter on, or empty for all collections.
    • scopeId

      public OptionalLong scopeId()
      Scope to filter on, or empty to filter by collection IDs.
    • scopeName

      public Optional<String> scopeName()
      Scope to filter on, or empty to filter by collection IDs.
    • authenticator

      public Authenticator authenticator()
      The authenticator for the connection
    • dcpControl

      public DcpControl dcpControl()
      Returns all DCP control params set, may be empty.
    • connectionFlags

      public Set<OpenConnectionFlag> connectionFlags()
      Returns the flags to use when opening a DCP connection.
    • streamFlags

      public Set<StreamFlag> streamFlags()
      Returns the flags to use when opening or adding a DCP stream.
    • bufferAckWatermark

      public int bufferAckWatermark()
      The watermark in percent for buffer acknowledgements.
    • eventLoopGroup

      public com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup()
      Returns the currently attached event loop group for IO process.ing.
    • configRefreshInterval

      public Duration configRefreshInterval()
      Polling interval when server does not support clustermap change notifications.
    • bootstrapTimeout

      public Duration bootstrapTimeout()
      Time in milliseconds to wait for first configuration during bootstrap.
    • setDataEventHandler

      public void setDataEventHandler(DataEventHandler dataEventHandler)
      Set/Override the data event handler.
    • setControlEventHandler

      public void setControlEventHandler(ControlEventHandler controlEventHandler)
      Set/Override the control event handler.
    • setSystemEventHandler

      public void setSystemEventHandler(SystemEventHandler systemEventHandler)
      Set/Override the control event handler.
    • poolBuffers

      public boolean poolBuffers()
      If buffer pooling is enabled.
    • socketConnectTimeout

      public long socketConnectTimeout()
      Socket connect timeout in milliseconds.
    • eventBus

      public EventBus eventBus()
      Returns the event bus where events are broadcasted on and can be published to.
    • securityConfig

      public SecurityConfig securityConfig()
      Returns the TLS configuration
    • tracer

      public Tracer tracer()
    • shutdown

      public reactor.core.publisher.Mono<Void> shutdown()
      Shut down this stateful environment.

      Note that it will only release/terminate resources which are owned by the client, especially if a custom event loop group is passed in it needs to be shut down separately.

      Returns:
      a Mono indicating completion of the shutdown process.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • dcpChannelsReconnectMaxAttempts

      public int dcpChannelsReconnectMaxAttempts()