/** * Creates a new {@link CouchbaseCluster} reference against the nodes passed in. * * @param environment the custom environment to use for this cluster reference. * @param nodes the list of nodes to use when connecting to the cluster reference. * @return a new {@link CouchbaseCluster} reference. */ public static CouchbaseCluster create(final CouchbaseEnvironment environment, final List<String> nodes) { return new CouchbaseCluster(environment, ConnectionString.fromHostnames(nodes), true); }
/** * Creates a new {@link CouchbaseCluster} reference using the connection string. * * @param environment the custom environment to use for this cluster reference. * @param connectionString the connection string to identify the remote cluster. * @return a new {@link CouchbaseCluster} reference. */ public static CouchbaseCluster fromConnectionString(final CouchbaseEnvironment environment, final String connectionString) { return new CouchbaseCluster(environment, ConnectionString.create(connectionString), true); }
/** * Creates a new {@link CouchbaseCluster} reference using the connection string. * * The {@link CouchbaseEnvironment} will be automatically created and its lifecycle managed. * * @param connectionString the connection string to identify the remote cluster. * @return a new {@link CouchbaseCluster} reference. */ public static CouchbaseCluster fromConnectionString(final String connectionString) { return new CouchbaseCluster( DefaultCouchbaseEnvironment.create(), ConnectionString.create(connectionString), false ); }
/** * Creates a new {@link CouchbaseCluster} reference against the nodes passed in. * * The {@link CouchbaseEnvironment} will be automatically created and its lifecycle managed. * * @param nodes the list of nodes to use when connecting to the cluster reference. * @return a new {@link CouchbaseCluster} reference. */ public static CouchbaseCluster create(final List<String> nodes) { return new CouchbaseCluster( DefaultCouchbaseEnvironment.create(), ConnectionString.fromHostnames(nodes), false ); }