public class DefaultClusterManager extends java.lang.Object implements ClusterManager
| Modifier and Type | Method and Description |
|---|---|
AsyncClusterManager |
async()
Accesses the underlying
AsyncClusterManager to perform asynchronous operations on the cluster. |
static DefaultClusterManager |
create(java.lang.String username,
java.lang.String password,
ConnectionString connectionString,
CouchbaseEnvironment environment,
com.couchbase.client.core.ClusterFacade core) |
BucketSettings |
getBucket(java.lang.String name)
Returns the
BucketSettings for the Bucket identified by name with the default management timeout. |
BucketSettings |
getBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Returns the
BucketSettings for the Bucket identified by name with a custom timeout. |
java.util.List<BucketSettings> |
getBuckets()
Returns a list of
BucketSettings for all available Buckets with the default management timeout. |
java.util.List<BucketSettings> |
getBuckets(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Returns a list of
BucketSettings for all available Buckets with a custom timeout. |
java.lang.Boolean |
hasBucket(java.lang.String name)
Checks if the cluster has a
Bucket identified by the given name with the default management timeout. |
java.lang.Boolean |
hasBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Checks if the cluster has a
Bucket identified by the given name with a custom timeout. |
ClusterInfo |
info()
Provides information about the cluster with the default management timeout.
|
ClusterInfo |
info(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Provides information about the cluster with a custom timeout.
|
BucketSettings |
insertBucket(BucketSettings settings)
Inserts a
Bucket with its BucketSettings if it does not already exist with the default management timeout. |
BucketSettings |
insertBucket(BucketSettings settings,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Inserts a
Bucket with its BucketSettings if it does not already exist with a custom timeout. |
java.lang.Boolean |
removeBucket(java.lang.String name)
Removes a
Bucket identified by its name with the default management timeout. |
java.lang.Boolean |
removeBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
Bucket identified by its name with a custom timeout. |
BucketSettings |
updateBucket(BucketSettings settings)
Updates a
Bucket with its BucketSettings if it does already exist with the default management timeout. |
BucketSettings |
updateBucket(BucketSettings settings,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Updates a
Bucket with its BucketSettings if it does already exist with a custom timeout. |
public static DefaultClusterManager create(java.lang.String username, java.lang.String password, ConnectionString connectionString, CouchbaseEnvironment environment, com.couchbase.client.core.ClusterFacade core)
public AsyncClusterManager async()
ClusterManagerAccesses the underlying AsyncClusterManager to perform asynchronous operations on the cluster.
async in interface ClusterManagerAsyncClusterManager.public ClusterInfo info()
ClusterManagerProvides information about the cluster with the default management timeout.
This method throws:
info in interface ClusterManagerClusterInfo object.public ClusterInfo info(long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterManagerProvides information about the cluster with a custom timeout.
This method throws:
info in interface ClusterManagertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.ClusterInfo object.public java.util.List<BucketSettings> getBuckets()
ClusterManagerReturns a list of BucketSettings for all available Buckets with the default management timeout.
This method throws:
getBuckets in interface ClusterManagerBucketSettings.public java.util.List<BucketSettings> getBuckets(long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterManagerReturns a list of BucketSettings for all available Buckets with a custom timeout.
This method throws:
getBuckets in interface ClusterManagertimeout - the custom timeout.timeUnit - the time unit for the custom timeout.BucketSettings.public BucketSettings getBucket(java.lang.String name)
ClusterManagerReturns the BucketSettings for the Bucket identified by name with the default management timeout.
This method throws:
getBucket in interface ClusterManagername - the name of the bucket.BucketSettings if found or null.public BucketSettings getBucket(java.lang.String name, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterManagerReturns the BucketSettings for the Bucket identified by name with a custom timeout.
This method throws:
getBucket in interface ClusterManagername - the name of the bucket.timeout - the custom timeout.timeUnit - the time unit for the custom timeout.BucketSettings if found or null.public java.lang.Boolean hasBucket(java.lang.String name)
ClusterManagerChecks if the cluster has a Bucket identified by the given name with the default management timeout.
This method throws:
hasBucket in interface ClusterManagername - the name of the bucket.public java.lang.Boolean hasBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
ClusterManagerChecks if the cluster has a Bucket identified by the given name with a custom timeout.
This method throws:
hasBucket in interface ClusterManagername - the name of the bucket.timeout - the custom timeout.timeUnit - the time unit for the custom timeout.public BucketSettings insertBucket(BucketSettings settings)
ClusterManagerInserts a Bucket with its BucketSettings if it does not already exist with the default management timeout.
This method throws:
insertBucket in interface ClusterManagersettings - the bucket settings that should be applied.public BucketSettings insertBucket(BucketSettings settings, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterManagerInserts a Bucket with its BucketSettings if it does not already exist with a custom timeout.
This method throws:
insertBucket in interface ClusterManagersettings - the bucket settings that should be applied.public BucketSettings updateBucket(BucketSettings settings)
ClusterManagerUpdates a Bucket with its BucketSettings if it does already exist with the default management timeout.
This method throws:
updateBucket in interface ClusterManagersettings - the bucket settings that should be applied.public BucketSettings updateBucket(BucketSettings settings, long timeout, java.util.concurrent.TimeUnit timeUnit)
ClusterManagerUpdates a Bucket with its BucketSettings if it does already exist with a custom timeout.
This method throws:
updateBucket in interface ClusterManagersettings - the bucket settings that should be applied.timeout - the custom timeout.timeUnit - the time unit for the custom timeout.public java.lang.Boolean removeBucket(java.lang.String name)
ClusterManagerRemoves a Bucket identified by its name with the default management timeout.
This method throws:
removeBucket in interface ClusterManagername - the name of the bucket.public java.lang.Boolean removeBucket(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
ClusterManagerRemoves a Bucket identified by its name with a custom timeout.
This method throws:
removeBucket in interface ClusterManagername - the name of the bucket.timeout - the custom timeout.timeUnit - the time unit for the custom timeout.