Class DefaultAsyncClusterManager
java.lang.Object
com.couchbase.client.java.cluster.DefaultAsyncClusterManager
- All Implemented Interfaces:
AsyncClusterManager
public class DefaultAsyncClusterManager extends Object implements AsyncClusterManager
-
Method Summary
Modifier and Type Method Description rx.Observable<AsyncClusterApiClient>
apiClient()
static DefaultAsyncClusterManager
create(String username, String password, ConnectionString connectionString, CouchbaseEnvironment environment, ClusterFacade core)
Deprecated.static DefaultAsyncClusterManager
create(String username, String password, List<ConnectionString.UnresolvedSocket> seedNodes, CouchbaseEnvironment environment, ClusterFacade core)
rx.Observable<BucketSettings>
getBucket(String name)
Returns theBucketSettings
for theBucket
identified by name.rx.Observable<BucketSettings>
getBuckets()
ReturnsBucketSettings
for all availableBucket
s.protected String
getConfigureBucketPayload(BucketSettings settings, boolean includeName)
rx.Observable<User>
getUser(AuthDomain domain, String userid)
Get user info from Couchbase Server.rx.Observable<User>
getUsers(AuthDomain domain)
Get all users in Couchbase Server.protected String
getUserSettingsPayload(UserSettings settings)
rx.Observable<Boolean>
hasBucket(String name)
Checks if the cluster has aBucket
identified by the given name.rx.Observable<ClusterInfo>
info()
Provides information about the cluster.rx.Observable<BucketSettings>
insertBucket(BucketSettings settings)
Inserts aBucket
with itsBucketSettings
if it does not already exist.rx.Observable<Boolean>
removeBucket(String name)
Removes aBucket
identified by its name.rx.Observable<Boolean>
removeUser(AuthDomain domain, String userid)
Removes a user identified by user name.rx.Observable<BucketSettings>
updateBucket(BucketSettings settings)
Updates aBucket
with itsBucketSettings
if it does already exist.rx.Observable<Boolean>
upsertUser(AuthDomain domain, String userid, UserSettings userSettings)
Creates/Updates a user with itsUserSettings
.
-
Method Details
-
create
@Deprecated public static DefaultAsyncClusterManager create(String username, String password, ConnectionString connectionString, CouchbaseEnvironment environment, ClusterFacade core)Deprecated. -
create
public static DefaultAsyncClusterManager create(String username, String password, List<ConnectionString.UnresolvedSocket> seedNodes, CouchbaseEnvironment environment, ClusterFacade core) -
apiClient
- Specified by:
apiClient
in interfaceAsyncClusterManager
- Returns:
- an
Observable
emitting a single newAsyncClusterApiClient
to prepare and perform REST API asynchronous requests on this cluster.
-
info
Description copied from interface:AsyncClusterManager
Provides information about the cluster. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
info
in interfaceAsyncClusterManager
- Returns:
- cluster information wrapped into a
ClusterInfo
object.
-
getBuckets
Description copied from interface:AsyncClusterManager
ReturnsBucketSettings
for all availableBucket
s. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
getBuckets
in interfaceAsyncClusterManager
- Returns:
- zero to N
BucketSettings
.
-
getBucket
Description copied from interface:AsyncClusterManager
Returns theBucketSettings
for theBucket
identified by name. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
getBucket
in interfaceAsyncClusterManager
- Parameters:
name
- the name of the bucket.- Returns:
- the
BucketSettings
if found or an empty observable if not found.
-
hasBucket
Description copied from interface:AsyncClusterManager
Checks if the cluster has aBucket
identified by the given name. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
hasBucket
in interfaceAsyncClusterManager
- Parameters:
name
- the name of the bucket.- Returns:
- true if it was found, false otherwise.
-
removeBucket
Description copied from interface:AsyncClusterManager
Removes aBucket
identified by its name. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded. **Note:** Removing a Bucket is an asynchronous operation on the server side, so even if the response is returned there is no guarantee that the operation has finished on the server itself.- Specified by:
removeBucket
in interfaceAsyncClusterManager
- Parameters:
name
- the name of the bucket.- Returns:
- true if the removal was successful, false otherwise.
-
insertBucket
Description copied from interface:AsyncClusterManager
Inserts aBucket
with itsBucketSettings
if it does not already exist. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded. - com.couchbase.client.java.error.BucketAlreadyExistsException: If the bucket already exists. **Note:** Inserting a Bucket is an asynchronous operation on the server side, so even if the response is returned there is no guarantee that the operation has finished on the server itself.- Specified by:
insertBucket
in interfaceAsyncClusterManager
- Parameters:
settings
- the bucket settings that should be applied.- Returns:
- the stored bucket settings if succeeded.
-
updateBucket
Description copied from interface:AsyncClusterManager
Updates aBucket
with itsBucketSettings
if it does already exist. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded. - com.couchbase.client.java.error.BucketDoesNotExistException: If the bucket does not exist. **Note:** Updating a Bucket is an asynchronous operation on the server side, so even if the response is returned there is no guarantee that the operation has finished on the server itself.- Specified by:
updateBucket
in interfaceAsyncClusterManager
- Parameters:
settings
- the bucket settings that should be applied.- Returns:
- the updated bucket settings if succeeded.
-
upsertUser
public rx.Observable<Boolean> upsertUser(AuthDomain domain, String userid, UserSettings userSettings)Description copied from interface:AsyncClusterManager
Creates/Updates a user with itsUserSettings
. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. **Note:** Updating a user is an asynchronous operation on the server side, so even if the response is returned there is no guarantee that the operation has finished on the server itself.- Specified by:
upsertUser
in interfaceAsyncClusterManager
- Parameters:
domain
- the authentication to use, most likelyAuthDomain.LOCAL
userid
- the user name of the user that should be updated.userSettings
- the user settings that should be applied.- Returns:
- true if the update was successful, false otherwise.
-
removeUser
Description copied from interface:AsyncClusterManager
Removes a user identified by user name. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. **Note:** Removing a user is an asynchronous operation on the server side, so even if the response is returned there is no guarantee that the operation has finished on the server itself.- Specified by:
removeUser
in interfaceAsyncClusterManager
- Parameters:
domain
- the authentication to use, most likelyAuthDomain.LOCAL
userid
- the user name of the user that should be updated.- Returns:
- true if the removal was successful, false otherwise.
-
getUsers
Description copied from interface:AsyncClusterManager
Get all users in Couchbase Server. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
getUsers
in interfaceAsyncClusterManager
- Parameters:
domain
- the authentication to use, most likelyAuthDomain.LOCAL
- Returns:
- users list of users.
-
getUser
Description copied from interface:AsyncClusterManager
Get user info from Couchbase Server. TheObservable
can error under the following conditions: - com.couchbase.client.core.CouchbaseException: If the underlying resources could not be enabled properly. - com.couchbase.client.java.error.TranscodingException: If the server response could not be decoded.- Specified by:
getUser
in interfaceAsyncClusterManager
- Parameters:
domain
- the authentication to use, most likelyAuthDomain.LOCAL
- Returns:
- user info
-
getConfigureBucketPayload
-
getUserSettingsPayload
-