Package com.couchbase.client.java
Class ClusterOptions
java.lang.Object
com.couchbase.client.java.ClusterOptions
Allows specifying custom options when connecting to the cluster.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static ClusterOptions
clusterOptions
(Authenticator authenticator) static ClusterOptions
clusterOptions
(String username, String password) environment
(ClusterEnvironment environment) Sets the ClusterEnvironment to use with this cluster.environment
(Consumer<ClusterEnvironment.Builder> environmentCustomizer) Sets a callback that configures the ClusterEnvironment owned by this cluster.
-
Method Details
-
clusterOptions
-
clusterOptions
-
environment
Sets the ClusterEnvironment to use with this cluster.The caller is responsible for shutting down the environment after all clusters sharing it have disconnected.
Use this method when sharing an environment between multiple clusters. In all other cases, prefer
environment(Consumer)
. -
environment
@Uncommitted public ClusterOptions environment(Consumer<ClusterEnvironment.Builder> environmentCustomizer) Sets a callback that configures the ClusterEnvironment owned by this cluster.The cluster will manage the lifecycle of the environment, and automatically shut it down when the cluster is disconnected.
This is the recommended way to configure the cluster environment unless you need to share an environment between multiple clusters.
-
build
-