public static final class CouchbaseConfiguration.Builder<K,V> extends Object
Builder for creating CouchbaseConfigurations
.
Modifier | Constructor and Description |
---|---|
protected |
Builder(String cacheName) |
Modifier and Type | Method and Description |
---|---|
CouchbaseConfiguration<K,V> |
build()
Create the appropriate
CouchbaseConfiguration from this CouchbaseConfiguration.Builder . |
CouchbaseConfiguration.Builder |
defaultBase()
Use a default configuration as the base for this
CouchbaseConfiguration . |
CouchbaseConfiguration.Builder |
useBase(javax.cache.configuration.CompleteConfiguration<K,V> base)
Copy a given
CompleteConfiguration as the base for this CouchbaseConfiguration . |
CouchbaseConfiguration.Builder |
useDedicatedBucket(String bucketName,
String bucketPassword)
Instruct this
CouchbaseConfiguration to use a dedicated bucket as the underlying Bucket . |
CouchbaseConfiguration.Builder |
useDefaultSharedBucket()
Instruct this
CouchbaseConfiguration to use default bucket information to connect to the underlying Bucket . |
CouchbaseConfiguration.Builder |
useSharedBucket(String name,
String password)
Instruct this
CouchbaseConfiguration to use given information to connect to the underlying Bucket . |
CouchbaseConfiguration.Builder |
viewAll(String designDoc,
String viewName)
Indicates that the view that can enumerate the content of this cache is found under design document designDoc, view viewName.
|
CouchbaseConfiguration.Builder |
viewAllDesignDoc(String designDoc)
Indicates that the view that can enumerate the content of this cache is found under design document designDoc.
|
CouchbaseConfiguration.Builder |
viewAllName(String viewName)
Indicates that the view that can enumerate the content of this cache is found under name viewName.
|
CouchbaseConfiguration.Builder |
withPrefix(String prefix)
Indicate that the underlying
Bucket ’s keys should be prefixed by prefix for the cache associated to this configuration. |
protected Builder(String cacheName)
public CouchbaseConfiguration.Builder useBase(javax.cache.configuration.CompleteConfiguration<K,V> base)
Copy a given CompleteConfiguration
as the base for this CouchbaseConfiguration
.
base
- the configuration to use as a baseCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder defaultBase()
Use a default configuration as the base for this CouchbaseConfiguration
.
CouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder useDedicatedBucket(String bucketName, String bucketPassword)
Instruct this CouchbaseConfiguration
to use a dedicated bucket as the underlying Bucket
. Note that this reverts to using no prefix for the keys, call withPrefix(java.lang.String)
after calling this method to change that.
public CouchbaseConfiguration.Builder useDefaultSharedBucket()
Instruct this CouchbaseConfiguration
to use default bucket information to connect to the underlying Bucket
.
Since default bucket for JCache can be used by several caches, the default prefix will be used, which is the name of the cache followed by an underscore, unless you call withPrefix(java.lang.String)
CouchbaseConfiguration.Builder
for chaining callsCouchbaseConfiguration.DEFAULT_BUCKET_NAME
,
CouchbaseConfiguration.DEFAULT_BUCKET_PASSWORD
public CouchbaseConfiguration.Builder useSharedBucket(String name, String password)
Instruct this CouchbaseConfiguration
to use given information to connect to the underlying Bucket
.
Since default bucket for JCache can be used by several caches, the default prefix will be used, which is the name of the cache followed by an underscore, unless you call withPrefix(java.lang.String)
name
- the name of the bucketpassword
- the password for the bucketCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder withPrefix(String prefix)
Indicate that the underlying Bucket
’s keys should be prefixed by prefix for the cache associated to this configuration.
prefix
- the prefix to use for keys in the associated cacheCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder viewAll(String designDoc, String viewName)
Indicates that the view that can enumerate the content of this cache is found under design document designDoc, view viewName.
Defaults to CouchbaseConfiguration.DEFAULT_VIEWALL_DESIGNDOC
and the cacheName as viewName.
designDoc
- the name of the design documentviewName
- the name of the viewCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder viewAllDesignDoc(String designDoc)
Indicates that the view that can enumerate the content of this cache is found under design document designDoc.
Keeps the current view name (which is the cacheName by default).
designDoc
- the name of the design documentCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration.Builder viewAllName(String viewName)
Indicates that the view that can enumerate the content of this cache is found under name viewName.
Keeps the current view design document (which is CouchbaseConfiguration.DEFAULT_VIEWALL_DESIGNDOC
by default).
viewName
- the name of the viewCouchbaseConfiguration.Builder
for chaining callspublic CouchbaseConfiguration<K,V> build()
Create the appropriate CouchbaseConfiguration
from this CouchbaseConfiguration.Builder
.
Copyright © 2014 Couchbase, Inc.