Interface AsyncClusterManager
-
- All Known Implementing Classes:
DefaultAsyncClusterManager
@Committed @Public public interface AsyncClusterManager
Provides management capabilities for a Couchbase ServerCluster.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description rx.Observable<AsyncClusterApiClient>apiClient()rx.Observable<BucketSettings>getBucket(String name)Returns theBucketSettingsfor theBucketidentified by name.rx.Observable<BucketSettings>getBuckets()ReturnsBucketSettingsfor all availableBuckets.rx.Observable<User>getUser(AuthDomain domain, String username)Get user info from Couchbase Server.rx.Observable<User>getUsers(AuthDomain domain)Get all users in Couchbase Server.rx.Observable<Boolean>hasBucket(String name)Checks if the cluster has aBucketidentified by the given name.rx.Observable<ClusterInfo>info()Provides information about the cluster.rx.Observable<BucketSettings>insertBucket(BucketSettings settings)Inserts aBucketwith itsBucketSettingsif it does not already exist.rx.Observable<Boolean>removeBucket(String name)Removes aBucketidentified by its name.rx.Observable<Boolean>removeUser(AuthDomain domain, String username)Removes a user identified by user name.rx.Observable<BucketSettings>updateBucket(BucketSettings settings)Updates aBucketwith itsBucketSettingsif it does already exist.rx.Observable<Boolean>upsertUser(AuthDomain domain, String username, UserSettings settings)Creates/Updates a user with itsUserSettings.
-
-
-
Method Detail
-
info
rx.Observable<ClusterInfo> info()
Provides information about the cluster. TheObservablecan 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.- Returns:
- cluster information wrapped into a
ClusterInfoobject.
-
getBuckets
rx.Observable<BucketSettings> getBuckets()
ReturnsBucketSettingsfor all availableBuckets. TheObservablecan 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.- Returns:
- zero to N
BucketSettings.
-
getBucket
rx.Observable<BucketSettings> getBucket(String name)
Returns theBucketSettingsfor theBucketidentified by name. TheObservablecan 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.- Parameters:
name- the name of the bucket.- Returns:
- the
BucketSettingsif found or an empty observable if not found.
-
hasBucket
rx.Observable<Boolean> hasBucket(String name)
Checks if the cluster has aBucketidentified by the given name. TheObservablecan 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.- Parameters:
name- the name of the bucket.- Returns:
- true if it was found, false otherwise.
-
insertBucket
rx.Observable<BucketSettings> insertBucket(BucketSettings settings)
Inserts aBucketwith itsBucketSettingsif it does not already exist. TheObservablecan 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.- Parameters:
settings- the bucket settings that should be applied.- Returns:
- the stored bucket settings if succeeded.
-
updateBucket
rx.Observable<BucketSettings> updateBucket(BucketSettings settings)
Updates aBucketwith itsBucketSettingsif it does already exist. TheObservablecan 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.- Parameters:
settings- the bucket settings that should be applied.- Returns:
- the updated bucket settings if succeeded.
-
removeBucket
rx.Observable<Boolean> removeBucket(String name)
Removes aBucketidentified by its name. TheObservablecan 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.- Parameters:
name- the name of the bucket.- Returns:
- true if the removal was successful, false otherwise.
-
upsertUser
@Experimental rx.Observable<Boolean> upsertUser(AuthDomain domain, String username, UserSettings settings)
Creates/Updates a user with itsUserSettings. TheObservablecan 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.- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCALusername- the user name of the user that should be updated.settings- the user settings that should be applied.- Returns:
- true if the update was successful, false otherwise.
-
removeUser
@Experimental rx.Observable<Boolean> removeUser(AuthDomain domain, String username)
Removes a user identified by user name. TheObservablecan 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.- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCALusername- the user name of the user that should be updated.- Returns:
- true if the removal was successful, false otherwise.
-
getUsers
@Experimental rx.Observable<User> getUsers(AuthDomain domain)
Get all users in Couchbase Server. TheObservablecan 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.- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCAL- Returns:
- users list of users.
-
getUser
@Experimental rx.Observable<User> getUser(AuthDomain domain, String username)
Get user info from Couchbase Server. TheObservablecan 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.- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCAL- Returns:
- user info
-
apiClient
@Experimental rx.Observable<AsyncClusterApiClient> apiClient()
- Returns:
- an
Observableemitting a single newAsyncClusterApiClientto prepare and perform REST API asynchronous requests on this cluster.
-
-