Class DefaultAsyncClusterManager

    • Method Detail

      • info

        public rx.Observable<ClusterInfo> info()
        Description copied from interface: AsyncClusterManager
        Provides information about the cluster. 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.
        Specified by:
        info in interface AsyncClusterManager
        Returns:
        cluster information wrapped into a ClusterInfo object.
      • getBuckets

        public rx.Observable<BucketSettings> getBuckets()
        Description copied from interface: AsyncClusterManager
        Returns BucketSettings for all available Buckets. 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.
        Specified by:
        getBuckets in interface AsyncClusterManager
        Returns:
        zero to N BucketSettings.
      • getBucket

        public rx.Observable<BucketSettings> getBucket​(String name)
        Description copied from interface: AsyncClusterManager
        Returns the 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.
        Specified by:
        getBucket in interface AsyncClusterManager
        Parameters:
        name - the name of the bucket.
        Returns:
        the BucketSettings if found or an empty observable if not found.
      • hasBucket

        public rx.Observable<Boolean> hasBucket​(String name)
        Description copied from interface: AsyncClusterManager
        Checks if the cluster has a 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.
        Specified by:
        hasBucket in interface AsyncClusterManager
        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: AsyncClusterManager
        Removes a 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.
        Specified by:
        removeBucket in interface AsyncClusterManager
        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: AsyncClusterManager
        Inserts a 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.
        Specified by:
        insertBucket in interface AsyncClusterManager
        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: AsyncClusterManager
        Updates a 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.
        Specified by:
        updateBucket in interface AsyncClusterManager
        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 its 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.
        Specified by:
        upsertUser in interface AsyncClusterManager
        Parameters:
        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.
        Returns:
        true if the update was successful, false otherwise.
      • removeUser

        public rx.Observable<Boolean> removeUser​(AuthDomain domain,
                                                 String userid)
        Description copied from interface: AsyncClusterManager
        Removes a user identified by user name. The 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.
        Specified by:
        removeUser in interface AsyncClusterManager
        Parameters:
        domain - the authentication to use, most likely AuthDomain.LOCAL
        userid - 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: AsyncClusterManager
        Get all users in Couchbase Server. 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.
        Specified by:
        getUsers in interface AsyncClusterManager
        Parameters:
        domain - the authentication to use, most likely AuthDomain.LOCAL
        Returns:
        users list of users.
      • getUser

        public rx.Observable<User> getUser​(AuthDomain domain,
                                           String userid)
        Description copied from interface: AsyncClusterManager
        Get user info from Couchbase Server. 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.
        Specified by:
        getUser in interface AsyncClusterManager
        Parameters:
        domain - the authentication to use, most likely AuthDomain.LOCAL
        Returns:
        user info
      • getConfigureBucketPayload

        protected String getConfigureBucketPayload​(BucketSettings settings,
                                                   boolean includeName)
      • getUserSettingsPayload

        protected String getUserSettingsPayload​(UserSettings settings)