Class SimpleCouchbaseClientFactory
java.lang.Object
org.springframework.data.couchbase.SimpleCouchbaseClientFactory
- All Implemented Interfaces:
Closeable
,AutoCloseable
,CouchbaseClientFactory
The default implementation of a
CouchbaseClientFactory
.- Author:
- Michael Nitschinger, Michael Reiche
-
Constructor Summary
ConstructorDescriptionSimpleCouchbaseClientFactory
(com.couchbase.client.java.Cluster cluster, String bucketName, String scopeName) SimpleCouchbaseClientFactory
(String connectionString, com.couchbase.client.core.env.Authenticator authenticator, String bucketName) SimpleCouchbaseClientFactory
(String connectionString, com.couchbase.client.core.env.Authenticator authenticator, String bucketName, String scopeName) SimpleCouchbaseClientFactory
(String connectionString, com.couchbase.client.core.env.Authenticator authenticator, String bucketName, String scopeName, com.couchbase.client.java.env.ClusterEnvironment environment) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
com.couchbase.client.java.Bucket
Provides access to the managed SDKBucket
reference.com.couchbase.client.java.Cluster
Provides access to the managed SDKCluster
reference.com.couchbase.client.java.Collection
getCollection
(String collectionName) Provides access to a collection (identified by its name) in managed SDKScope
reference.com.couchbase.client.java.Collection
Provides access to the default collection.The exception translator used on the factory.com.couchbase.client.java.Scope
getScope()
Provides access to the managed SDKScope
reference.Returns a newCouchbaseClientFactory
set to the scope given as an argument.
-
Constructor Details
-
SimpleCouchbaseClientFactory
-
SimpleCouchbaseClientFactory
-
SimpleCouchbaseClientFactory
-
SimpleCouchbaseClientFactory
-
-
Method Details
-
withScope
Description copied from interface:CouchbaseClientFactory
Returns a newCouchbaseClientFactory
set to the scope given as an argument.- Specified by:
withScope
in interfaceCouchbaseClientFactory
- Parameters:
scopeName
- the name of the scope to use for all collection access.- Returns:
- a new client factory, bound to the other scope.
-
getCluster
public com.couchbase.client.java.Cluster getCluster()Description copied from interface:CouchbaseClientFactory
Provides access to the managed SDKCluster
reference.- Specified by:
getCluster
in interfaceCouchbaseClientFactory
-
getBucket
public com.couchbase.client.java.Bucket getBucket()Description copied from interface:CouchbaseClientFactory
Provides access to the managed SDKBucket
reference.- Specified by:
getBucket
in interfaceCouchbaseClientFactory
-
getScope
public com.couchbase.client.java.Scope getScope()Description copied from interface:CouchbaseClientFactory
Provides access to the managed SDKScope
reference.- Specified by:
getScope
in interfaceCouchbaseClientFactory
-
getCollection
Description copied from interface:CouchbaseClientFactory
Provides access to a collection (identified by its name) in managed SDKScope
reference.- Specified by:
getCollection
in interfaceCouchbaseClientFactory
- Parameters:
collectionName
- the name of the collection. If null is passed in, the default collection is assumed.
-
getDefaultCollection
public com.couchbase.client.java.Collection getDefaultCollection()Description copied from interface:CouchbaseClientFactory
Provides access to the default collection.- Specified by:
getDefaultCollection
in interfaceCouchbaseClientFactory
-
getExceptionTranslator
Description copied from interface:CouchbaseClientFactory
The exception translator used on the factory.- Specified by:
getExceptionTranslator
in interfaceCouchbaseClientFactory
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-