Package com.couchbase.client.java.env
Class ClusterEnvironment.Builder
java.lang.Object
com.couchbase.client.core.env.CoreEnvironment.Builder<ClusterEnvironment.Builder>
com.couchbase.client.java.env.ClusterEnvironment.Builder
- Enclosing class:
ClusterEnvironment
public static class ClusterEnvironment.Builder
extends CoreEnvironment.Builder<ClusterEnvironment.Builder>
-
Field Summary
Fields inherited from class com.couchbase.client.core.env.CoreEnvironment.Builder
transactionsConfig
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Turns this builder into a realClusterEnvironment
.cryptoManager
(CryptoManager cryptoManager) Sets the cryptography manager for Field-Level Encryption (reading and writing encrypted document fields).jsonSerializer
(JsonSerializer jsonSerializer) Sets the default serializer for converting between JSON and Java objects.load
(ClusterPropertyLoader loader) Immediately loads the properties from the given loader into the environment.transactionsConfig
(TransactionsConfig.Builder transactionsConfig) Deprecated.This method clobbers any previously configured values.transactionsConfig
(Consumer<TransactionsConfig.Builder> builderConsumer) Passes theTransactionsConfig.Builder
to the provided consumer.transcoder
(Transcoder transcoder) Allows to override the default transcoder going to be used for all KV operations.Methods inherited from class com.couchbase.client.core.env.CoreEnvironment.Builder
addRequestCallback, applyProfile, compressionConfig, compressionConfig, compressionConfig, eventBus, ioConfig, ioConfig, ioConfig, ioEnvironment, ioEnvironment, ioEnvironment, ioEnvironmentConfig, load, loadSystemProperties, loggerConfig, loggerConfig, loggerConfig, loggingMeterConfig, loggingMeterConfig, loggingMeterConfig, maxNumRequestsInRetry, meter, orphanReporterConfig, orphanReporterConfig, orphanReporterConfig, preferredServerGroup, publishOnScheduler, requestTracer, retryStrategy, scheduler, schedulerThreadCount, securityConfig, securityConfig, securityConfig, self, thresholdLoggingTracerConfig, thresholdLoggingTracerConfig, thresholdLoggingTracerConfig, thresholdRequestTracerConfig, thresholdRequestTracerConfig, timeoutConfig, timeoutConfig, timeoutConfig, transactionsConfig
-
Method Details
-
load
Immediately loads the properties from the given loader into the environment.- Parameters:
loader
- the loader to load the properties from.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes.
-
jsonSerializer
Sets the default serializer for converting between JSON and Java objects.Providing your own serializer gives you complete control over the conversion.
If this method is not called, the client's behavior depends on whether Jackson is in the class path. If Jackson is present, an instance of
JacksonJsonSerializer
will be used. Otherwise the client will fall back toDefaultJsonSerializer
.- Parameters:
jsonSerializer
- the serializer used for all JSON values.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes. - See Also:
-
transcoder
Allows to override the default transcoder going to be used for all KV operations.- Parameters:
transcoder
- the transcoder that should be used by default.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes.
-
cryptoManager
Sets the cryptography manager for Field-Level Encryption (reading and writing encrypted document fields).Note: Use of the Field-Level Encryption functionality is subject to the Couchbase Inc. Enterprise Subscription License Agreement v7
- Parameters:
cryptoManager
- (nullable) the manager to use, or null to disable encryption support.- Returns:
- this builder for chaining purposes.
-
transactionsConfig
@Deprecated @Uncommitted public ClusterEnvironment.Builder transactionsConfig(TransactionsConfig.Builder transactionsConfig) Deprecated.This method clobbers any previously configured values. Please usetransactionsConfig(Consumer)
instead.Sets the configuration for all transactions.- Parameters:
transactionsConfig
- the transactions configuration.- Returns:
- this builder for chaining purposes.
-
transactionsConfig
@Uncommitted public ClusterEnvironment.Builder transactionsConfig(Consumer<TransactionsConfig.Builder> builderConsumer) Passes theTransactionsConfig.Builder
to the provided consumer.Allows customizing the default options for all transactions.
- Parameters:
builderConsumer
- a callback that configures options.- Returns:
- this builder for chaining purposes.
-
build
Turns this builder into a realClusterEnvironment
.- Overrides:
build
in classCoreEnvironment.Builder<ClusterEnvironment.Builder>
- Returns:
- the created cluster environment.
-