Class ClusterEnvironment
- java.lang.Object
-
- com.couchbase.client.core.env.CoreEnvironment
-
- com.couchbase.client.java.env.ClusterEnvironment
-
public class ClusterEnvironment extends 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
ClusterOptionsthough the user is responsible for shutting it down after the cluster is disconnected!Since the
ClusterEnvironmentextends theCoreEnvironment, most options can be found on the parent class for documentation purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusterEnvironment.Builder
-
Field Summary
-
Fields inherited from class com.couchbase.client.core.env.CoreEnvironment
DEFAULT_MAX_NUM_REQUESTS_IN_RETRY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClusterEnvironment.Builderbuilder()Creates aClusterEnvironment.Builderto customize the properties of the environment.static ClusterEnvironmentcreate()Creates a newClusterEnvironmentwith default settings.Optional<CryptoManager>cryptoManager()Returns the low-level cryptography manager for Field-Level Encryption if one has been configured.protected StringdefaultAgentTitle()JsonSerializerjsonSerializer()Returns the default serializer used to serialize and deserialize JSON values.Transcodertranscoder()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
clientHash, clientVersion, compressionConfig, coreHash, coreVersion, eventBus, exportAsString, ioConfig, ioEnvironment, loggerConfig, maxNumRequestsInRetry, meter, orphanReporter, requestCallbacks, requestTracer, retryStrategy, scheduler, securityConfig, shutdown, shutdown, shutdownAsync, shutdownAsync, shutdownReactive, shutdownReactive, timeoutConfig, timer, toString, transactionsConfig, transactionsSchedulers, userAgent
-
-
-
-
Method Detail
-
defaultAgentTitle
protected String defaultAgentTitle()
- Overrides:
defaultAgentTitlein classCoreEnvironment
-
create
public static ClusterEnvironment create()
Creates a newClusterEnvironmentwith default settings.- Returns:
- a new environment with default settings.
-
builder
public static ClusterEnvironment.Builder builder()
Creates aClusterEnvironment.Builderto customize the properties of the environment.- Returns:
- the
ClusterEnvironment.Builderto 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<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
JsonObjectCryptofor a high level alternative that's compatible with CouchbaseJsonObjects.Note: Use of the Field-Level Encryption functionality is subject to the Couchbase Inc. Enterprise Subscription License Agreement v7
-
-