Interface CouchbaseClientFactory
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
SimpleCouchbaseClientFactory
The
CouchbaseClientFactory is the main way to get access to the managed SDK instance and resources.
Please note that a single factory is always bound to a Bucket, so if you need to access more than one
you need to initialize one factory for each.
-
Method Summary
Modifier and TypeMethodDescriptioncom.couchbase.client.java.BucketProvides access to the managed SDKBucketreference.com.couchbase.client.java.ClusterProvides access to the managed SDKClusterreference.com.couchbase.client.java.CollectiongetCollection(String name) Provides access to a collection (identified by its name) in managed SDKScopereference.com.couchbase.client.java.CollectionProvides access to the default collection.The exception translator used on the factory.com.couchbase.client.java.ScopegetScope()Provides access to the managed SDKScopereference.Returns a newCouchbaseClientFactoryset to the scope given as an argument.
-
Method Details
-
getCluster
com.couchbase.client.java.Cluster getCluster()Provides access to the managed SDKClusterreference. -
getBucket
com.couchbase.client.java.Bucket getBucket()Provides access to the managed SDKBucketreference. -
getScope
com.couchbase.client.java.Scope getScope()Provides access to the managed SDKScopereference. -
getCollection
Provides access to a collection (identified by its name) in managed SDKScopereference.- Parameters:
name- the name of the collection. If null is passed in, the default collection is assumed.
-
getDefaultCollection
com.couchbase.client.java.Collection getDefaultCollection()Provides access to the default collection. -
withScope
Returns a newCouchbaseClientFactoryset to the scope given as an argument.- Parameters:
scopeName- the name of the scope to use for all collection access.- Returns:
- a new client factory, bound to the other scope.
-
getExceptionTranslator
PersistenceExceptionTranslator getExceptionTranslator()The exception translator used on the factory.
-