Package com.couchbase.client.core.config
Class DefaultClusterConfig
- java.lang.Object
-
- com.couchbase.client.core.config.DefaultClusterConfig
-
- All Implemented Interfaces:
ClusterConfig
public class DefaultClusterConfig extends Object implements ClusterConfig
Default implementation of aClusterConfig
.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultClusterConfig()
Creates a newDefaultClusterConfig
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
allNodeAddresses()
Returns the addresses of all nodes in the cluster, accumulated from all open buckets.BucketConfig
bucketConfig(String bucketName)
Returns theBucketConfig
for the given bucket name.Map<String,BucketConfig>
bucketConfigs()
void
deleteBucketConfig(String bucketName)
boolean
hasBucket(String bucketName)
True if there is a bucket config with the given name, false otherwise.void
setBucketConfig(String bucketName, BucketConfig config)
Set a bucket config for the given bucket name.String
toString()
-
-
-
Constructor Detail
-
DefaultClusterConfig
public DefaultClusterConfig()
Creates a newDefaultClusterConfig
.
-
-
Method Detail
-
bucketConfig
public BucketConfig bucketConfig(String bucketName)
Description copied from interface:ClusterConfig
Returns theBucketConfig
for the given bucket name.- Specified by:
bucketConfig
in interfaceClusterConfig
- Parameters:
bucketName
- name of the bucket.- Returns:
- a config, if set.
-
setBucketConfig
public void setBucketConfig(String bucketName, BucketConfig config)
Description copied from interface:ClusterConfig
Set a bucket config for the given bucket name.- Specified by:
setBucketConfig
in interfaceClusterConfig
- Parameters:
bucketName
- the name of the bucket.config
- the configuration associated with the bucket.
-
deleteBucketConfig
public void deleteBucketConfig(String bucketName)
- Specified by:
deleteBucketConfig
in interfaceClusterConfig
-
hasBucket
public boolean hasBucket(String bucketName)
Description copied from interface:ClusterConfig
True if there is a bucket config with the given name, false otherwise.- Specified by:
hasBucket
in interfaceClusterConfig
- Parameters:
bucketName
- name of the bucket.- Returns:
- true if bucket is there.
-
bucketConfigs
public Map<String,BucketConfig> bucketConfigs()
- Specified by:
bucketConfigs
in interfaceClusterConfig
-
allNodeAddresses
public Set<String> allNodeAddresses()
Description copied from interface:ClusterConfig
Returns the addresses of all nodes in the cluster, accumulated from all open buckets.- Specified by:
allNodeAddresses
in interfaceClusterConfig
-
-