Class ClusterEnvironment

java.lang.Object
com.couchbase.client.core.env.CoreEnvironment
com.couchbase.client.java.env.ClusterEnvironment
All Implemented Interfaces:
com.couchbase.client.core.util.ReactorOps, AutoCloseable

public class ClusterEnvironment extends com.couchbase.client.core.env.CoreEnvironment
The Environment is the main place in the SDK where configuration and state lives (i.e. I/O pools).

If not created explicitly by the user, the SDK will create its own one internally that can also be accessed by the user. If this is the case it does not need to be shut down manually. If the environment is passed in to the ClusterOptions though the user is responsible for shutting it down after the cluster is disconnected!

Since the ClusterEnvironment extends the CoreEnvironment, most options can be found on the parent class for documentation purposes.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields inherited from class com.couchbase.client.core.env.CoreEnvironment

    DEFAULT_DISABLE_APP_TELEMETRY, DEFAULT_MAX_NUM_REQUESTS_IN_RETRY
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a ClusterEnvironment.Builder to customize the properties of the environment.
    protected com.couchbase.client.core.env.VersionAndGitHash
     
    Creates a new ClusterEnvironment with default settings.
    Optional<com.couchbase.client.core.encryption.CryptoManager>
    Returns the low-level cryptography manager for Field-Level Encryption if one has been configured.
    protected String
     
    Returns the default serializer used to serialize and deserialize JSON values.
    Returns the default transcoder used for all operations if not overridden on a per-operation basis.

    Methods inherited from class com.couchbase.client.core.env.CoreEnvironment

    appTelemetryDisabled, appTelemetryEndpoint, clientHash, clientVersion, close, compressionConfig, coreHash, coreVersion, eventBus, executor, exportAsString, ioConfig, ioEnvironment, loggerConfig, maxNumRequestsInRetry, meter, orphanReporter, preferredServerGroup, publishOnUserScheduler, publishOnUserScheduler, requestCallbacks, requestTracer, retryStrategy, scheduler, securityConfig, shutdown, shutdown, shutdownAsync, shutdownAsync, shutdownReactive, shutdownReactive, timeoutConfig, timer, toString, transactionsConfig, transactionsSchedulers, userAgent, userScheduler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.couchbase.client.core.util.ReactorOps

    publishOnUserScheduler
  • Method Details

    • defaultAgentTitle

      protected String defaultAgentTitle()
      Overrides:
      defaultAgentTitle in class com.couchbase.client.core.env.CoreEnvironment
    • clientVersionAndGitHash

      protected com.couchbase.client.core.env.VersionAndGitHash clientVersionAndGitHash()
      Overrides:
      clientVersionAndGitHash in class com.couchbase.client.core.env.CoreEnvironment
    • create

      public static ClusterEnvironment create()
      Creates a new ClusterEnvironment with default settings.
      Returns:
      a new environment with default settings.
    • builder

      public static ClusterEnvironment.Builder builder()
      Creates a ClusterEnvironment.Builder to customize the properties of the environment.
      Returns:
      the ClusterEnvironment.Builder to customize.
    • transcoder

      public Transcoder transcoder()
      Returns the default transcoder used for all operations if not overridden on a per-operation basis.
    • jsonSerializer

      public JsonSerializer jsonSerializer()
      Returns the default serializer used to serialize and deserialize JSON values.
    • cryptoManager

      public Optional<com.couchbase.client.core.encryption.CryptoManager> cryptoManager()
      Returns the low-level cryptography manager for Field-Level Encryption if one has been configured.

      Useful for implementing encryption with external JSON libraries.

      See JsonObjectCrypto for a high level alternative that's compatible with Couchbase JsonObjects.

      Note: Use of the Field-Level Encryption functionality is subject to the Couchbase Inc. Enterprise Subscription License Agreement v7

      See Also: