Class DefaultAsyncClusterManager
- java.lang.Object
-
- com.couchbase.client.java.cluster.DefaultAsyncClusterManager
-
- All Implemented Interfaces:
AsyncClusterManager
public class DefaultAsyncClusterManager extends Object implements AsyncClusterManager
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description rx.Observable<AsyncClusterApiClient>apiClient()static DefaultAsyncClusterManagercreate(String username, String password, ConnectionString connectionString, CouchbaseEnvironment environment, ClusterFacade core)Deprecated.static DefaultAsyncClusterManagercreate(String username, String password, List<ConnectionString.UnresolvedSocket> seedNodes, CouchbaseEnvironment environment, ClusterFacade core)rx.Observable<BucketSettings>getBucket(String name)Returns theBucketSettingsfor theBucketidentified by name.rx.Observable<BucketSettings>getBuckets()ReturnsBucketSettingsfor all availableBuckets.protected StringgetConfigureBucketPayload(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 StringgetUserSettingsPayload(UserSettings settings)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 userid)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 userid, UserSettings userSettings)Creates/Updates a user with itsUserSettings.
-
-
-
Method Detail
-
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
@Experimental public rx.Observable<AsyncClusterApiClient> apiClient()
- Specified by:
apiClientin interfaceAsyncClusterManager- Returns:
- an
Observableemitting a single newAsyncClusterApiClientto prepare and perform REST API asynchronous requests on this cluster.
-
info
public rx.Observable<ClusterInfo> info()
Description copied from interface:AsyncClusterManagerProvides 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.- Specified by:
infoin interfaceAsyncClusterManager- Returns:
- cluster information wrapped into a
ClusterInfoobject.
-
getBuckets
public rx.Observable<BucketSettings> getBuckets()
Description copied from interface:AsyncClusterManagerReturnsBucketSettingsfor 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.- Specified by:
getBucketsin interfaceAsyncClusterManager- Returns:
- zero to N
BucketSettings.
-
getBucket
public rx.Observable<BucketSettings> getBucket(String name)
Description copied from interface:AsyncClusterManagerReturns 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.- Specified by:
getBucketin interfaceAsyncClusterManager- Parameters:
name- the name of the bucket.- Returns:
- the
BucketSettingsif found or an empty observable if not found.
-
hasBucket
public rx.Observable<Boolean> hasBucket(String name)
Description copied from interface:AsyncClusterManagerChecks 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.- Specified by:
hasBucketin interfaceAsyncClusterManager- Parameters:
name- the name of the bucket.- Returns:
- true if it was found, false otherwise.
-
removeBucket
public rx.Observable<Boolean> removeBucket(String name)
Description copied from interface:AsyncClusterManagerRemoves 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.- Specified by:
removeBucketin interfaceAsyncClusterManager- Parameters:
name- the name of the bucket.- Returns:
- true if the removal was successful, false otherwise.
-
insertBucket
public rx.Observable<BucketSettings> insertBucket(BucketSettings settings)
Description copied from interface:AsyncClusterManagerInserts 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.- Specified by:
insertBucketin interfaceAsyncClusterManager- Parameters:
settings- the bucket settings that should be applied.- Returns:
- the stored bucket settings if succeeded.
-
updateBucket
public rx.Observable<BucketSettings> updateBucket(BucketSettings settings)
Description copied from interface:AsyncClusterManagerUpdates 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.- Specified by:
updateBucketin 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:AsyncClusterManagerCreates/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.- Specified by:
upsertUserin interfaceAsyncClusterManager- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCALuserid- 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
public rx.Observable<Boolean> removeUser(AuthDomain domain, String userid)
Description copied from interface:AsyncClusterManagerRemoves 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.- Specified by:
removeUserin interfaceAsyncClusterManager- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCALuserid- the user name of the user that should be updated.- Returns:
- true if the removal was successful, false otherwise.
-
getUsers
public rx.Observable<User> getUsers(AuthDomain domain)
Description copied from interface:AsyncClusterManagerGet 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.- Specified by:
getUsersin interfaceAsyncClusterManager- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCAL- Returns:
- users list of users.
-
getUser
public rx.Observable<User> getUser(AuthDomain domain, String userid)
Description copied from interface:AsyncClusterManagerGet 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.- Specified by:
getUserin interfaceAsyncClusterManager- Parameters:
domain- the authentication to use, most likelyAuthDomain.LOCAL- Returns:
- user info
-
getConfigureBucketPayload
protected String getConfigureBucketPayload(BucketSettings settings, boolean includeName)
-
getUserSettingsPayload
protected String getUserSettingsPayload(UserSettings settings)
-
-