Modifier and Type | Method and Description |
---|---|
ClusterManager |
clusterManager(String username,
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,
List<String> nodes) |
static CouchbaseCluster |
create(CouchbaseEnvironment environment,
String... nodes) |
static CouchbaseCluster |
create(List<String> nodes) |
static CouchbaseCluster |
create(String... nodes) |
Boolean |
disconnect()
Disconnects form all open buckets and shuts down the
CouchbaseEnvironment if it is the exclusive owner with the default disconnect timeout. |
Boolean |
disconnect(long timeout,
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,
String connectionString) |
static CouchbaseCluster |
fromConnectionString(String connectionString) |
Bucket |
openBucket()
Opens the default bucket with an empty password with the default connect timeout.
|
Bucket |
openBucket(long timeout,
TimeUnit timeUnit)
Opens the default bucket with an empty password with a custom timeout.
|
Bucket |
openBucket(String name)
Opens a bucket identified by its name with an empty password and with the default connect timeout.
|
Bucket |
openBucket(String name,
long timeout,
TimeUnit timeUnit)
Opens a bucket identified by its name with an empty password and with a custom timeout.
|
Bucket |
openBucket(String name,
String password)
Opens a bucket identified by its name and password with the default connect timeout.
|
Bucket |
openBucket(String name,
String password,
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(String name,
String password,
List<Transcoder<? extends Document,?>> transcoders,
long timeout,
TimeUnit timeUnit)
Opens a bucket identified by its name and password with custom transcoders and with a custom timeout.
|
Bucket |
openBucket(String name,
String password,
long timeout,
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(String... nodes)
public static CouchbaseCluster create(List<String> nodes)
public static CouchbaseCluster create(CouchbaseEnvironment environment, String... nodes)
public static CouchbaseCluster create(CouchbaseEnvironment environment, List<String> nodes)
public static CouchbaseCluster fromConnectionString(String connectionString)
public static CouchbaseCluster fromConnectionString(CouchbaseEnvironment environment, String connectionString)
public Bucket openBucket()
Cluster
Opens the default bucket with an empty password with the default connect timeout.
This method throws:
openBucket
in interface Cluster
public Bucket openBucket(long timeout, TimeUnit timeUnit)
Cluster
Opens the default bucket with an empty password with a custom timeout.
This method throws:
openBucket
in interface Cluster
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.public Bucket openBucket(String name)
Cluster
Opens a bucket identified by its name with an empty password and with the default connect timeout.
This method throws:
openBucket
in interface Cluster
public Bucket openBucket(String name, long timeout, TimeUnit timeUnit)
Cluster
Opens a bucket identified by its name with an empty password and with a custom timeout.
This method throws:
openBucket
in interface Cluster
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.public Bucket openBucket(String name, String password)
Cluster
Opens a bucket identified by its name and password with the default connect timeout.
This method throws:
openBucket
in interface Cluster
public Bucket openBucket(String name, String password, long timeout, TimeUnit timeUnit)
Cluster
Opens a bucket identified by its name and password with a custom timeout.
This method throws:
openBucket
in interface Cluster
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.public Bucket openBucket(String name, String password, List<Transcoder<? extends Document,?>> transcoders)
Cluster
Opens a bucket identified by its name and password with custom transcoders and with the default connect timeout.
This method throws:
openBucket
in interface Cluster
public Bucket openBucket(String name, String password, List<Transcoder<? extends Document,?>> transcoders, long timeout, TimeUnit timeUnit)
Cluster
Opens a bucket identified by its name and password with custom transcoders and with a custom timeout.
This method throws:
openBucket
in interface Cluster
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.public ClusterManager clusterManager(String username, String password)
Cluster
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.
clusterManager
in interface Cluster
username
- the username to perform cluster-wide operations.password
- the password associated with the username.ClusterManager
if successful.public Boolean disconnect()
Cluster
Disconnects form all open buckets and shuts down the CouchbaseEnvironment
if it is the exclusive owner with the default disconnect timeout.
disconnect
in interface Cluster
public Boolean disconnect(long timeout, TimeUnit timeUnit)
Cluster
Disconnects form all open buckets and shuts down the CouchbaseEnvironment
if it is the exclusive owner with a custom timeout.
disconnect
in interface Cluster
public com.couchbase.client.core.ClusterFacade core()
Cluster
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.
Copyright © 2014 Couchbase, Inc.