public class DefaultAsyncClusterManager extends Object implements AsyncClusterManager
Modifier and Type | Method and 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 the
BucketSettings for the Bucket identified by name. |
rx.Observable<BucketSettings> |
getBuckets()
Returns
BucketSettings for all available Bucket 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 a
Bucket identified by the given name. |
rx.Observable<ClusterInfo> |
info()
Provides information about the cluster.
|
rx.Observable<BucketSettings> |
insertBucket(BucketSettings settings)
Inserts a
Bucket with its BucketSettings if it does not already exist. |
rx.Observable<Boolean> |
removeBucket(String name)
Removes a
Bucket 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 a
Bucket with its BucketSettings if it does already exist. |
rx.Observable<Boolean> |
upsertUser(AuthDomain domain,
String userid,
UserSettings userSettings)
Creates/Updates a user with its
UserSettings . |
@Deprecated public static DefaultAsyncClusterManager create(String username, String password, ConnectionString connectionString, CouchbaseEnvironment environment, ClusterFacade core)
public static DefaultAsyncClusterManager create(String username, String password, List<ConnectionString.UnresolvedSocket> seedNodes, CouchbaseEnvironment environment, ClusterFacade core)
@InterfaceStability.Experimental public rx.Observable<AsyncClusterApiClient> apiClient()
apiClient
in interface AsyncClusterManager
Observable
emitting a single new AsyncClusterApiClient
to prepare and perform
REST API asynchronous requests on this cluster.public rx.Observable<ClusterInfo> info()
AsyncClusterManager
Observable
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.info
in interface AsyncClusterManager
ClusterInfo
object.public rx.Observable<BucketSettings> getBuckets()
AsyncClusterManager
BucketSettings
for all available Bucket
s.
The Observable
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.getBuckets
in interface AsyncClusterManager
BucketSettings
.public rx.Observable<BucketSettings> getBucket(String name)
AsyncClusterManager
BucketSettings
for the Bucket
identified by name.
The Observable
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.getBucket
in interface AsyncClusterManager
name
- the name of the bucket.BucketSettings
if found or an empty observable if not found.public rx.Observable<Boolean> hasBucket(String name)
AsyncClusterManager
Bucket
identified by the given name.
The Observable
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.hasBucket
in interface AsyncClusterManager
name
- the name of the bucket.public rx.Observable<Boolean> removeBucket(String name)
AsyncClusterManager
Bucket
identified by its name.
The Observable
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.removeBucket
in interface AsyncClusterManager
name
- the name of the bucket.public rx.Observable<BucketSettings> insertBucket(BucketSettings settings)
AsyncClusterManager
Bucket
with its BucketSettings
if it does not already exist.
The Observable
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.insertBucket
in interface AsyncClusterManager
settings
- the bucket settings that should be applied.public rx.Observable<BucketSettings> updateBucket(BucketSettings settings)
AsyncClusterManager
Bucket
with its BucketSettings
if it does already exist.
The Observable
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.updateBucket
in interface AsyncClusterManager
settings
- the bucket settings that should be applied.public rx.Observable<Boolean> upsertUser(AuthDomain domain, String userid, UserSettings userSettings)
AsyncClusterManager
UserSettings
.
The Observable
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.upsertUser
in interface AsyncClusterManager
domain
- the authentication to use, most likely AuthDomain.LOCAL
userid
- the user name of the user that should be updated.userSettings
- the user settings that should be applied.public rx.Observable<Boolean> removeUser(AuthDomain domain, String userid)
AsyncClusterManager
Observable
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.removeUser
in interface AsyncClusterManager
domain
- the authentication to use, most likely AuthDomain.LOCAL
userid
- the user name of the user that should be updated.public rx.Observable<User> getUsers(AuthDomain domain)
AsyncClusterManager
Observable
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.getUsers
in interface AsyncClusterManager
domain
- the authentication to use, most likely AuthDomain.LOCAL
public rx.Observable<User> getUser(AuthDomain domain, String userid)
AsyncClusterManager
Observable
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.getUser
in interface AsyncClusterManager
domain
- the authentication to use, most likely AuthDomain.LOCAL
protected String getConfigureBucketPayload(BucketSettings settings, boolean includeName)
protected String getUserSettingsPayload(UserSettings settings)
Copyright © 2015 Couchbase, Inc.