@InterfaceStability.Committed @InterfaceAudience.Public public interface AsyncCluster
Represents a Couchbase Server Cluster
.
A AsyncCluster
is able to open many AsyncBucket
s while sharing the underlying resources very efficiently. In addition, the AsyncClusterManager
is available to perform cluster-wide operations.
Modifier and Type | Method and Description |
---|---|
AsyncCluster |
authenticate(Authenticator auth)
Sets the
Authenticator to use when credentials are needed for an operation but no explicit credentials are provided. |
Observable<AsyncClusterManager> |
clusterManager()
Provides access to the
AsyncClusterManager to perform cluster-wide operations, using the credentials set through the configured Authenticator , for the CredentialContext.CLUSTER_MANAGEMENT context. |
Observable<AsyncClusterManager> |
clusterManager(String username,
String password)
Provides access to the
AsyncClusterManager to perform cluster-wide operations. |
Observable<ClusterFacade> |
core()
Returns the underlying “core-io” library through its
ClusterFacade . |
Observable<Boolean> |
disconnect()
Disconnects form all open buckets and shuts down the
CouchbaseEnvironment if it is the exclusive owner. |
Observable<AsyncBucket> |
openBucket()
Opens the default bucket with an empty password.
|
Observable<AsyncBucket> |
openBucket(String name)
Opens the bucket with the given name using the password from the
Authenticator that was last set (in the BUCKET_KV context ). |
Observable<AsyncBucket> |
openBucket(String name,
String password)
Opens the bucket with the given name and password.
|
Observable<AsyncBucket> |
openBucket(String name,
String password,
List<Transcoder<? extends Document,?>> transcoders)
Opens the bucket with the given name, password and a custom list of
Transcoder s. |
Observable<AsyncBucket> openBucket()
Opens the default bucket with an empty password.
The Observable
can error under the following conditions:
Observable<AsyncBucket> openBucket(String name)
Opens the bucket with the given name using the password from the Authenticator
that was last set
(in the BUCKET_KV context
).
If no credential can be found for the bucket in the authenticator, the old behavior of defaulting to an empty password is used.
The Observable
can error under the following conditions:
AuthenticatorException
: If more than one credentials was returned by the Authenticator for this bucket.name
- the name of the bucket.Observable<AsyncBucket> openBucket(String name, String password)
Opens the bucket with the given name and password.
The Observable
can error under the following conditions:
name
- the name of the bucket.Observable<AsyncBucket> openBucket(String name, String password, List<Transcoder<? extends Document,?>> transcoders)
Opens the bucket with the given name, password and a custom list of Transcoder
s.
The Observable
can error under the following conditions:
name
- the name of the bucket.Observable<AsyncClusterManager> clusterManager(String username, String password)
Provides access to the AsyncClusterManager
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.AsyncClusterManager
if successful.Observable<AsyncClusterManager> clusterManager()
Provides access to the AsyncClusterManager
to perform cluster-wide operations, using the credentials set through the configured Authenticator
, for the CredentialContext.CLUSTER_MANAGEMENT
context.
The Observable can error under the following notable condition:
AuthenticatorException
: if no Authenticator
is set or it doesn’t contains a cluster management credential.AsyncClusterManager
if successful.Observable<Boolean> disconnect()
Disconnects form all open buckets and shuts down the CouchbaseEnvironment
if it is the exclusive owner.
Observable<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.AsyncCluster authenticate(Authenticator auth)
Sets the Authenticator
to use when credentials are needed for an operation but no explicit credentials are provided.
Note that setting a new Authenticator will not be propagated to any Bucket
that has been opened with the previous Authenticator, as the instance is passed to the Bucket for its own use.
auth
- the new Authenticator
to use.Copyright © 2015 Couchbase, Inc.