Class ClusterOptions

java.lang.Object
com.couchbase.client.java.ClusterOptions

public class ClusterOptions extends Object
Allows specifying custom options when connecting to the cluster.
  • Method Details

    • clusterOptions

      public static ClusterOptions clusterOptions(Authenticator authenticator)
    • clusterOptions

      public static ClusterOptions clusterOptions(String username, String password)
    • environment

      public ClusterOptions environment(ClusterEnvironment 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