Class AsyncCollectionManager
- java.lang.Object
-
- com.couchbase.client.java.manager.ManagerSupport
-
- com.couchbase.client.java.manager.collection.AsyncCollectionManager
-
@Volatile public class AsyncCollectionManager extends ManagerSupport
TheAsyncCollectionManager
provides APIs to manage bucket collections and scopes.
-
-
Constructor Summary
Constructors Constructor Description AsyncCollectionManager(Core core, String bucketName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Boolean>
collectionExists(CollectionSpec collectionSpec)
Checks if the given collection exists in this bucket.CompletableFuture<Void>
createCollection(CollectionSpec collectionSpec)
Creates a collection if it does not already exist.CompletableFuture<Void>
createScope(ScopeSpec scopeSpec)
Creates a scope if it does not already exist.CompletableFuture<Void>
dropCollection(CollectionSpec collectionSpec)
Drops a collection if it exists.CompletableFuture<Void>
dropScope(String scopeName)
Drops a scope if it exists.CompletableFuture<List<ScopeSpec>>
getAllScopes()
Returns all scopes in this bucket.CompletableFuture<ScopeSpec>
getScope(String scopeName)
Returns the scope if it exists.-
Methods inherited from class com.couchbase.client.java.manager.ManagerSupport
checkStatus, sendRequest, sendRequest, sendRequest, sendRequest, sendRequest
-
-
-
-
Method Detail
-
createCollection
public CompletableFuture<Void> createCollection(CollectionSpec collectionSpec)
Creates a collection if it does not already exist.- Parameters:
collectionSpec
- the collection spec that contains the properties of the collection.- Returns:
- a
CompletableFuture
once the collection creation completed.
-
collectionExists
public CompletableFuture<Boolean> collectionExists(CollectionSpec collectionSpec)
Checks if the given collection exists in this bucket.- Parameters:
collectionSpec
- the collection spec that contains the properties of the collection.- Returns:
- a
CompletableFuture
returning true if it exists, false otherwise.
-
createScope
public CompletableFuture<Void> createScope(ScopeSpec scopeSpec)
Creates a scope if it does not already exist.- Parameters:
scopeSpec
- the scope spec that contains the properties of the scope.- Returns:
- a
CompletableFuture
once the scope creation completed.
-
dropCollection
public CompletableFuture<Void> dropCollection(CollectionSpec collectionSpec)
Drops a collection if it exists.- Parameters:
collectionSpec
- the collection spec that contains the properties of the collection.- Returns:
- a
CompletableFuture
once the collection is dropped.
-
dropScope
public CompletableFuture<Void> dropScope(String scopeName)
Drops a scope if it exists.- Parameters:
scopeName
- the name of the scope to drop.- Returns:
- a
CompletableFuture
once the scope is dropped.
-
getScope
public CompletableFuture<ScopeSpec> getScope(String scopeName)
Returns the scope if it exists.- Parameters:
scopeName
- the name of the scope.- Returns:
- a
CompletableFuture
containing the scope spec if it exists.
-
getAllScopes
public CompletableFuture<List<ScopeSpec>> getAllScopes()
Returns all scopes in this bucket.- Returns:
- a
CompletableFuture
with a list of scopes in the bucket.
-
-