Package com.couchbase.client.core.config
Class AbstractBucketConfig
- java.lang.Object
-
- com.couchbase.client.core.config.AbstractBucketConfig
-
- All Implemented Interfaces:
BucketConfig
- Direct Known Subclasses:
DefaultCouchbaseBucketConfig
,DefaultMemcachedBucketConfig
public abstract class AbstractBucketConfig extends Object implements BucketConfig
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBucketConfig(String uuid, String name, BucketNodeLocator locator, String uri, String streamingUri, List<NodeInfo> nodeInfos, List<PortInfo> portInfos, List<BucketCapabilities> bucketCapabilities, String origin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<BucketCapabilities>
capabilities()
Returns the bucket capabilities of this bucket config.BucketNodeLocator
locator()
The type of node locator in use for this bucket.String
name()
The name of the bucket.List<NodeInfo>
nodes()
The list of nodes associated with this bucket.String
password()
The password of the bucket/user.BucketConfig
password(String password)
Setter to inject the password manually into the config.boolean
serviceEnabled(ServiceType type)
Check if the service is enabled on the bucket.String
streamingUri()
The HTTP Streaming URI for this bucket.String
uri()
The HTTP Uri for this bucket configuration.String
useAlternateNetwork()
Non null if alternate addresses should be used, false otherwise.void
useAlternateNetwork(String useAlternateNetwork)
Setter to set if external networking should be used or not.String
username()
User authorized for the bucket access.BucketConfig
username(String username)
Set user authorized for the bucket access.String
uuid()
Returns the UUID of the bucket, ornull
if the bucket does not have a UUID.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.couchbase.client.core.config.BucketConfig
hasFastForwardMap, rev, tainted, type
-
-
-
-
Method Detail
-
uuid
public String uuid()
Description copied from interface:BucketConfig
Returns the UUID of the bucket, ornull
if the bucket does not have a UUID.The UUID is an opaque value assigned when the bucket is created. If the bucket is deleted and a new bucket is created with the same name, the new bucket will have a different UUID.
- Specified by:
uuid
in interfaceBucketConfig
- Returns:
- bucket UUID, or
null
.
-
name
public String name()
Description copied from interface:BucketConfig
The name of the bucket.- Specified by:
name
in interfaceBucketConfig
- Returns:
- name of the bucket.
-
locator
public BucketNodeLocator locator()
Description copied from interface:BucketConfig
The type of node locator in use for this bucket.- Specified by:
locator
in interfaceBucketConfig
- Returns:
- the node locator type.
-
uri
public String uri()
Description copied from interface:BucketConfig
The HTTP Uri for this bucket configuration.- Specified by:
uri
in interfaceBucketConfig
- Returns:
- the uri.
-
streamingUri
public String streamingUri()
Description copied from interface:BucketConfig
The HTTP Streaming URI for this bucket.- Specified by:
streamingUri
in interfaceBucketConfig
- Returns:
- the streaming uri.
-
nodes
public List<NodeInfo> nodes()
Description copied from interface:BucketConfig
The list of nodes associated with this bucket.- Specified by:
nodes
in interfaceBucketConfig
- Returns:
- the list of nodes.
-
password
public String password()
Description copied from interface:BucketConfig
The password of the bucket/user.- Specified by:
password
in interfaceBucketConfig
- Returns:
- the password of the bucket/user.
-
password
public BucketConfig password(String password)
Description copied from interface:BucketConfig
Setter to inject the password manually into the config.- Specified by:
password
in interfaceBucketConfig
- Parameters:
password
- the password of the bucket/user to inject.- Returns:
- the config for proper chaining.
-
username
public String username()
Description copied from interface:BucketConfig
User authorized for the bucket access.- Specified by:
username
in interfaceBucketConfig
- Returns:
- username of the user.
-
username
public BucketConfig username(String username)
Description copied from interface:BucketConfig
Set user authorized for the bucket access.- Specified by:
username
in interfaceBucketConfig
- Parameters:
username
- the user authorized for bucket access- Returns:
- the config for chaining
-
useAlternateNetwork
public String useAlternateNetwork()
Description copied from interface:BucketConfig
Non null if alternate addresses should be used, false otherwise.- Specified by:
useAlternateNetwork
in interfaceBucketConfig
-
useAlternateNetwork
public void useAlternateNetwork(String useAlternateNetwork)
Description copied from interface:BucketConfig
Setter to set if external networking should be used or not.- Specified by:
useAlternateNetwork
in interfaceBucketConfig
- Parameters:
useAlternateNetwork
- if an alternate network should be used.
-
serviceEnabled
public boolean serviceEnabled(ServiceType type)
Description copied from interface:BucketConfig
Check if the service is enabled on the bucket.- Specified by:
serviceEnabled
in interfaceBucketConfig
- Parameters:
type
- the type to check.- Returns:
- true if it is, false otherwise.
-
capabilities
public List<BucketCapabilities> capabilities()
Description copied from interface:BucketConfig
Returns the bucket capabilities of this bucket config.- Specified by:
capabilities
in interfaceBucketConfig
-
-