@Stability.Volatile public class AsyncCollectionManager extends Object
AsyncCollectionManager provides APIs to manage collections and scopes within a bucket.| Constructor and Description |
|---|
AsyncCollectionManager(com.couchbase.client.core.manager.CoreCollectionManager coreCollectionManager,
AsyncCluster cluster)
Creates a new
AsyncCollectionManager. |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
createCollection(CollectionSpec collectionSpec)
Deprecated.
This method cannot be used to set the collection's "history" property.
Please use
createCollection(String, String, CreateCollectionSettings) instead. |
CompletableFuture<Void> |
createCollection(CollectionSpec collectionSpec,
CreateCollectionOptions options)
Deprecated.
This method cannot be used to set the collection's "history" property.
Please use
createCollection(String, String, CreateCollectionSettings, CreateCollectionOptions) instead. |
CompletableFuture<Void> |
createCollection(String scopeName,
String collectionName,
CreateCollectionSettings settings)
Creates a collection if it does not already exist with custom options.
|
CompletableFuture<Void> |
createCollection(String scopeName,
String collectionName,
CreateCollectionSettings settings,
CreateCollectionOptions options)
Creates a collection if it does not already exist with custom options.
|
CompletableFuture<Void> |
createScope(String scopeName)
Creates a scope if it does not already exist.
|
CompletableFuture<Void> |
createScope(String scopeName,
CreateScopeOptions options)
Creates a scope if it does not already exist with custom options.
|
CompletableFuture<Void> |
dropCollection(CollectionSpec collectionSpec)
Deprecated.
Please use
dropCollection(String, String) instead. |
CompletableFuture<Void> |
dropCollection(CollectionSpec collectionSpec,
DropCollectionOptions options)
Deprecated.
Please use
dropCollection(String, String, DropCollectionOptions) instead. |
CompletableFuture<Void> |
dropCollection(String scopeName,
String collectionName)
Drops a collection if it exists.
|
CompletableFuture<Void> |
dropCollection(String scopeName,
String collectionName,
DropCollectionOptions options)
Drops a collection if it exists with custom options.
|
CompletableFuture<Void> |
dropScope(String scopeName)
Drops a scope if it exists.
|
CompletableFuture<Void> |
dropScope(String scopeName,
DropScopeOptions options)
Drops a scope if it exists with custom options.
|
CompletableFuture<List<ScopeSpec>> |
getAllScopes()
Returns all scopes in this bucket.
|
CompletableFuture<List<ScopeSpec>> |
getAllScopes(GetAllScopesOptions options)
Returns all scopes in this bucket with custom options.
|
CompletableFuture<ScopeSpec> |
getScope(String scopeName)
Deprecated.
use
getAllScopes() instead. |
CompletableFuture<ScopeSpec> |
getScope(String scopeName,
GetScopeOptions options)
Deprecated.
use
getAllScopes(GetAllScopesOptions) instead. |
CompletableFuture<Void> |
updateCollection(String scopeName,
String collectionName,
UpdateCollectionSettings settings)
Updates a collection with custom options.
|
CompletableFuture<Void> |
updateCollection(String scopeName,
String collectionName,
UpdateCollectionSettings settings,
UpdateCollectionOptions options)
Updates a collection with custom options.
|
@Stability.Internal
public AsyncCollectionManager(com.couchbase.client.core.manager.CoreCollectionManager coreCollectionManager,
AsyncCluster cluster)
AsyncCollectionManager.
This API is not intended to be called by the user directly, use AsyncBucket.collections()
instead.
@Deprecated public CompletableFuture<Void> createCollection(CollectionSpec collectionSpec)
createCollection(String, String, CreateCollectionSettings) instead.
Note that a scope needs to be created first (via createScope(String)) if it doesn't exist already.
collectionSpec - the collection spec that contains the properties of the collection.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionExistsException - (async) if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Deprecated public CompletableFuture<Void> createCollection(CollectionSpec collectionSpec, CreateCollectionOptions options)
createCollection(String, String, CreateCollectionSettings, CreateCollectionOptions) instead.
Note that a scope needs to be created first (via createScope(String)) if it doesn't exist already.
collectionSpec - the collection spec that contains the properties of the collection.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionExistsException - (async) if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> createCollection(String scopeName, String collectionName, CreateCollectionSettings settings)
Note that a scope needs to be created first (via createScope(String)) if it doesn't exist already.
scopeName - name of scope to create collection incollectionName - name of collection to createsettings - the collection settingsCompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionExistsException - (async) if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> createCollection(String scopeName, String collectionName, CreateCollectionSettings settings, CreateCollectionOptions options)
Note that a scope needs to be created first (via createScope(String)) if it doesn't exist already.
scopeName - name of scope to create collection incollectionName - name of collection to createsettings - the collection settingsoptions - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionExistsException - (async) if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> createScope(String scopeName)
scopeName - the name of the scope to create.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.ScopeExistsException - (async) if the scope already exists.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> createScope(String scopeName, CreateScopeOptions options)
scopeName - the name of the scope to create.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.ScopeExistsException - (async) if the scope already exists.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> updateCollection(String scopeName, String collectionName, UpdateCollectionSettings settings)
scopeName - name of scope to update collection incollectionName - name of collection to updatesettings - the collection settingsCompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> updateCollection(String scopeName, String collectionName, UpdateCollectionSettings settings, UpdateCollectionOptions options)
scopeName - name of scope to update collection incollectionName - name of collection to updatesettings - the collection settingsoptions - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionNotFoundException - (async) if the collection does not exist.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Deprecated public CompletableFuture<Void> dropCollection(CollectionSpec collectionSpec)
dropCollection(String, String) instead.collectionSpec - the collection spec that contains the properties of the collection.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionNotFoundException - (async) if the collection does not exist.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Deprecated public CompletableFuture<Void> dropCollection(CollectionSpec collectionSpec, DropCollectionOptions options)
dropCollection(String, String, DropCollectionOptions) instead.collectionSpec - the collection spec that contains the properties of the collection.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionNotFoundException - (async) if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> dropCollection(String scopeName, String collectionName)
scopeName - name of scope to drop collection fromcollectionName - name of collection to dropCompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionNotFoundException - (async) if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Stability.Volatile public CompletableFuture<Void> dropCollection(String scopeName, String collectionName, DropCollectionOptions options)
scopeName - name of scope to drop collection fromcollectionName - name of collection to dropoptions - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CollectionNotFoundException - (async) if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropScope(String scopeName)
scopeName - the name of the scope to drop.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the scope did not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropScope(String scopeName, DropScopeOptions options)
scopeName - the name of the scope to drop.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.ScopeNotFoundException - (async) if the scope did not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Deprecated public CompletableFuture<ScopeSpec> getScope(String scopeName)
getAllScopes() instead.scopeName - the name of the scope.CompletableFuture containing information about the scope.com.couchbase.client.core.error.ScopeNotFoundException - (async) if scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.@Deprecated public CompletableFuture<ScopeSpec> getScope(String scopeName, GetScopeOptions options)
getAllScopes(GetAllScopesOptions) instead.scopeName - the name of the scope.options - the custom options to apply.CompletableFuture containing information about the scope.com.couchbase.client.core.error.ScopeNotFoundException - (async) if scope does not exist.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<List<ScopeSpec>> getAllScopes()
CompletableFuture with a (potentially empty) list of scopes in the bucket.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<List<ScopeSpec>> getAllScopes(GetAllScopesOptions options)
options - the custom options to apply.CompletableFuture with a (potentially empty) list of scopes in the bucket.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.Copyright © 2024 Couchbase, Inc.. All rights reserved.