@InterfaceStability.Committed
@InterfaceAudience.Public
public interface Cluster
Represents a Couchbase Server Cluster
.
A Cluster
is able to open many Bucket
s while sharing the underlying resources very efficiently. In addition, the ClusterManager
is available to perform cluster-wide operations.
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 . |
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. |
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.
|
Bucket openBucket()
Opens the default bucket with an empty password with the default connect timeout.
This method throws:
Bucket openBucket(long timeout, java.util.concurrent.TimeUnit timeUnit)
Opens the default bucket with an empty password with a custom timeout.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the 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.
This method throws:
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.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the 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.
This method throws:
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.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the custom 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.
This method throws:
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.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.ClusterManager clusterManager(java.lang.String username, java.lang.String password)
Provides 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.
username
- the username to perform cluster-wide operations.password
- the password associated with the username.ClusterManager
if successful.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.
com.couchbase.client.core.ClusterFacade core()
Returns 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.
ClusterFacade
from the “core-io” package.