@Stability.Volatile public class CollectionManager extends Object
CollectionManager
provides APIs to manage bucket collections and scopes.Constructor and Description |
---|
CollectionManager(AsyncCollectionManager async)
Creates a new
CollectionManager . |
Modifier and Type | Method and Description |
---|---|
void |
createCollection(CollectionSpec collectionSpec)
Deprecated.
This method cannot be used to set the collection's "history" property.
Please use
createCollection(String, String, CreateCollectionSettings) instead. |
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. |
void |
createCollection(String scopeName,
String collectionName)
Creates a collection if it does not already exist.
|
void |
createCollection(String scopeName,
String collectionName,
CreateCollectionSettings settings)
Creates a collection if it does not already exist with custom options.
|
void |
createCollection(String scopeName,
String collectionName,
CreateCollectionSettings settings,
CreateCollectionOptions options)
Creates a collection if it does not already exist with custom options.
|
void |
createScope(String scopeName)
Creates a scope if it does not already exist.
|
void |
createScope(String scopeName,
CreateScopeOptions options)
Creates a scope if it does not already exist with custom options.
|
void |
dropCollection(CollectionSpec collectionSpec)
Deprecated.
Please use
dropCollection(String, String) instead. |
void |
dropCollection(CollectionSpec collectionSpec,
DropCollectionOptions options)
Deprecated.
Please use
dropCollection(String, String, DropCollectionOptions) instead. |
void |
dropCollection(String scopeName,
String collectionName)
Drops a collection if it exists.
|
void |
dropCollection(String scopeName,
String collectionName,
DropCollectionOptions options)
Drops a collection if it exists with custom options.
|
void |
dropScope(String scopeName)
Drops a scope if it exists.
|
void |
dropScope(String scopeName,
DropScopeOptions options)
Drops a scope if it exists with custom options.
|
List<ScopeSpec> |
getAllScopes()
Returns all scopes in this bucket.
|
List<ScopeSpec> |
getAllScopes(GetAllScopesOptions options)
Returns all scopes in this bucket with custom options.
|
ScopeSpec |
getScope(String scopeName)
Deprecated.
use
getAllScopes() instead. |
ScopeSpec |
getScope(String scopeName,
GetScopeOptions options)
Deprecated.
use
getAllScopes(GetAllScopesOptions) instead. |
void |
updateCollection(String scopeName,
String collectionName,
UpdateCollectionSettings settings)
Updates a collection with custom options.
|
void |
updateCollection(String scopeName,
String collectionName,
UpdateCollectionSettings settings,
UpdateCollectionOptions options)
Updates a collection with custom options.
|
@Stability.Internal public CollectionManager(AsyncCollectionManager async)
CollectionManager
.
This API is not intended to be called by the user directly, use Bucket.collections()
instead.
async
- the underlying async collection manager.@Deprecated public 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.com.couchbase.client.core.error.CollectionExistsException
- if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Deprecated public 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.com.couchbase.client.core.error.CollectionExistsException
- if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public void createCollection(String scopeName, String collectionName)
Note that a scope needs to be created first (via createScope(String)
) if it doesn't exist already.
scopeName
- the scope namecollectionName
- the collection namecom.couchbase.client.core.error.CollectionExistsException
- if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public 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
- the scope name to create the collection incollectionName
- the collection namesettings
- the collection settingscom.couchbase.client.core.error.CollectionExistsException
- if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public 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
- the scope name to create the collection incollectionName
- the collection namesettings
- the collection settingsoptions
- the custom options to apply.com.couchbase.client.core.error.CollectionExistsException
- if the collection already existscom.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public void createScope(String scopeName)
scopeName
- the name of the scope to create.com.couchbase.client.core.error.ScopeExistsException
- if the scope already exists.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public void createScope(String scopeName, CreateScopeOptions options)
scopeName
- the name of the scope to create.options
- the custom options to apply.com.couchbase.client.core.error.ScopeExistsException
- if the scope already exists.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public void updateCollection(String scopeName, String collectionName, UpdateCollectionSettings settings)
scopeName
- name of scope to update collection incollectionName
- name of collection to updatesettings
- the collection settingscom.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.@Stability.Volatile public 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.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 void dropCollection(CollectionSpec collectionSpec)
dropCollection(String, String)
instead.collectionSpec
- the collection spec that contains the properties of the collection.com.couchbase.client.core.error.CollectionNotFoundException
- if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Deprecated public 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.com.couchbase.client.core.error.CollectionNotFoundException
- if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public void dropCollection(String scopeName, String collectionName)
scopeName
- the scope name containing the collection to dropcollectionName
- the collection namecom.couchbase.client.core.error.CollectionNotFoundException
- if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Stability.Volatile public void dropCollection(String scopeName, String collectionName, DropCollectionOptions options)
scopeName
- the scope name containing the collection to dropcollectionName
- the collection nameoptions
- the custom options to apply.com.couchbase.client.core.error.CollectionNotFoundException
- if the collection did not exist.com.couchbase.client.core.error.ScopeNotFoundException
- if the specified scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public void dropScope(String scopeName)
scopeName
- the name of the scope to drop.com.couchbase.client.core.error.ScopeNotFoundException
- if the scope did not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public void dropScope(String scopeName, DropScopeOptions options)
scopeName
- the name of the scope to drop.options
- the custom options to apply.com.couchbase.client.core.error.ScopeNotFoundException
- if the scope did not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Deprecated public ScopeSpec getScope(String scopeName)
getAllScopes()
instead.scopeName
- the name of the scope.com.couchbase.client.core.error.ScopeNotFoundException
- if scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.@Deprecated public ScopeSpec getScope(String scopeName, GetScopeOptions options)
getAllScopes(GetAllScopesOptions)
instead.scopeName
- the name of the scope.options
- the custom options to apply.com.couchbase.client.core.error.ScopeNotFoundException
- if scope does not exist.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public List<ScopeSpec> getAllScopes()
com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.public List<ScopeSpec> getAllScopes(GetAllScopesOptions options)
options
- the custom options to apply.com.couchbase.client.core.error.CouchbaseException
- if any other generic unhandled/unexpected errors.Copyright © 2024 Couchbase, Inc.. All rights reserved.