public class ClusterOptions extends Object
Modifier and Type | Class and Description |
---|---|
class |
ClusterOptions.Built |
Modifier and Type | Method and Description |
---|---|
ClusterOptions.Built |
build() |
static ClusterOptions |
clusterOptions(com.couchbase.client.core.env.Authenticator authenticator) |
static ClusterOptions |
clusterOptions(String username,
String password) |
ClusterOptions |
environment(ClusterEnvironment environment)
Sets the ClusterEnvironment to use with this cluster.
|
ClusterOptions |
environment(Consumer<ClusterEnvironment.Builder> environmentCustomizer)
Sets a callback that configures the ClusterEnvironment owned by this
cluster.
|
public static ClusterOptions clusterOptions(com.couchbase.client.core.env.Authenticator authenticator)
public static ClusterOptions clusterOptions(String username, String password)
public ClusterOptions environment(ClusterEnvironment environment)
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)
.
@Stability.Uncommitted public ClusterOptions environment(Consumer<ClusterEnvironment.Builder> environmentCustomizer)
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.
@Stability.Internal public ClusterOptions.Built build()
Copyright © 2024 Couchbase, Inc.. All rights reserved.