| Modifier and Type | Method and Description |
|---|---|
ClusterManager |
clusterManager(java.lang.String username,
java.lang.String password)
Provides access to the
ClusterManager to perform cluster-wide operations. |
com.couchbase.client.core.ClusterFacade |
core()
Returns the underlying “core-io” library through its
ClusterFacade. |
static CouchbaseCluster |
create() |
static CouchbaseCluster |
create(CouchbaseEnvironment environment) |
static CouchbaseCluster |
create(CouchbaseEnvironment environment,
java.util.List<java.lang.String> nodes) |
static CouchbaseCluster |
create(CouchbaseEnvironment environment,
java.lang.String... nodes) |
static CouchbaseCluster |
create(java.util.List<java.lang.String> nodes) |
static CouchbaseCluster |
create(java.lang.String... nodes) |
java.lang.Boolean |
disconnect()
Disconnects form all open buckets and shuts down the
CouchbaseEnvironment if it is the exclusive owner with the default disconnect timeout. |
java.lang.Boolean |
disconnect(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Disconnects form all open buckets and shuts down the
CouchbaseEnvironment if it is the exclusive owner with a custom timeout. |
static CouchbaseCluster |
fromConnectionString(CouchbaseEnvironment environment,
java.lang.String connectionString) |
static CouchbaseCluster |
fromConnectionString(java.lang.String connectionString) |
Bucket |
openBucket()
Opens the default bucket with an empty password with the default connect timeout.
|
Bucket |
openBucket(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Opens the default bucket with an empty password with a custom timeout.
|
Bucket |
openBucket(java.lang.String name)
Opens a bucket identified by its name with an empty password and with the default connect timeout.
|
Bucket |
openBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Opens a bucket identified by its name with an empty password and with a custom timeout.
|
Bucket |
openBucket(java.lang.String name,
java.lang.String password)
Opens a bucket identified by its name and password with the default connect timeout.
|
Bucket |
openBucket(java.lang.String name,
java.lang.String password,
java.util.List<Transcoder<? extends Document,?>> transcoders)
Opens a bucket identified by its name and password with custom transcoders and with the default connect timeout.
|
Bucket |
openBucket(java.lang.String name,
java.lang.String password,
java.util.List<Transcoder<? extends Document,?>> transcoders,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Opens a bucket identified by its name and password with custom transcoders and with a custom timeout.
|
Bucket |
openBucket(java.lang.String name,
java.lang.String password,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Opens a bucket identified by its name and password with a custom timeout.
|
public static CouchbaseCluster create()
public static CouchbaseCluster create(CouchbaseEnvironment environment)
public static CouchbaseCluster create(java.lang.String... nodes)
public static CouchbaseCluster create(java.util.List<java.lang.String> nodes)
public static CouchbaseCluster create(CouchbaseEnvironment environment, java.lang.String... nodes)
public static CouchbaseCluster create(CouchbaseEnvironment environment, java.util.List<java.lang.String> nodes)
public static CouchbaseCluster fromConnectionString(java.lang.String connectionString)
public static CouchbaseCluster fromConnectionString(CouchbaseEnvironment environment, java.lang.String connectionString)
public Bucket openBucket()
ClusterOpens the default bucket with an empty password with the default connect timeout.
This method throws:
openBucket in interface Clusterpublic Bucket openBucket(long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterOpens the default bucket with an empty password with a custom timeout.
This method throws:
openBucket in interface Clustertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.public Bucket openBucket(java.lang.String name)
ClusterOpens a bucket identified by its name with an empty password and with the default connect timeout.
This method throws:
openBucket in interface Clusterpublic Bucket openBucket(java.lang.String name, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterOpens a bucket identified by its name with an empty password and with a custom timeout.
This method throws:
openBucket in interface Clustertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.public Bucket openBucket(java.lang.String name, java.lang.String password)
ClusterOpens a bucket identified by its name and password with the default connect timeout.
This method throws:
openBucket in interface Clusterpublic Bucket openBucket(java.lang.String name, java.lang.String password, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterOpens a bucket identified by its name and password with a custom timeout.
This method throws:
openBucket in interface Clustertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.public Bucket openBucket(java.lang.String name, java.lang.String password, java.util.List<Transcoder<? extends Document,?>> transcoders)
ClusterOpens a bucket identified by its name and password with custom transcoders and with the default connect timeout.
This method throws:
openBucket in interface Clusterpublic Bucket openBucket(java.lang.String name, java.lang.String password, java.util.List<Transcoder<? extends Document,?>> transcoders, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterOpens a bucket identified by its name and password with custom transcoders and with a custom timeout.
This method throws:
openBucket in interface Clustertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.public ClusterManager clusterManager(java.lang.String username, java.lang.String password)
ClusterProvides access to the ClusterManager to perform cluster-wide operations.
Note that the credentials provided here are different from bucket-level credentials. As a rule of thumb, the “Administrator” credentials need to be passed in here or any credentials with enough permissions to perform the underlying operations. Bucket level credentials will not work.
clusterManager in interface Clusterusername - the username to perform cluster-wide operations.password - the password associated with the username.ClusterManager if successful.public java.lang.Boolean disconnect()
ClusterDisconnects form all open buckets and shuts down the CouchbaseEnvironment if it is the exclusive owner with the default disconnect timeout.
disconnect in interface Clusterpublic java.lang.Boolean disconnect(long timeout,
java.util.concurrent.TimeUnit timeUnit)
ClusterDisconnects form all open buckets and shuts down the CouchbaseEnvironment if it is the exclusive owner with a custom timeout.
disconnect in interface Clusterpublic com.couchbase.client.core.ClusterFacade core()
ClusterReturns the underlying “core-io” library through its ClusterFacade.
Handle with care, with great power comes great responsibility. All additional checks which are normally performed by this library are skipped.