Interface CouchbaseClientFactory

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
SimpleCouchbaseClientFactory

public interface CouchbaseClientFactory extends Closeable
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 Details

    • getCluster

      com.couchbase.client.java.Cluster getCluster()
      Provides access to the managed SDK Cluster reference.
    • getBucket

      com.couchbase.client.java.Bucket getBucket()
      Provides access to the managed SDK Bucket reference.
    • getScope

      com.couchbase.client.java.Scope getScope()
      Provides access to the managed SDK Scope reference.
    • getCollection

      com.couchbase.client.java.Collection getCollection(String name)
      Provides access to a collection (identified by its name) in managed SDK Scope reference.
      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

      CouchbaseClientFactory withScope(String scopeName)
      Returns a new CouchbaseClientFactory set 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.