Interface ClusterManager

  • All Known Implementing Classes:
    DefaultClusterManager

    @Committed
    @Public
    public interface ClusterManager
    Provides management capabilities for a Couchbase Server Cluster. The underlying asynchronous capabilities can be leveraged through the async() method.
    Since:
    2.0
    Author:
    Michael Nitschinger
    • Method Detail

      • info

        ClusterInfo info()
        Provides information about the cluster with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 ClusterInfo object.
      • info

        ClusterInfo info​(long timeout,
                         TimeUnit timeUnit)
        Provides information about the cluster with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        cluster information wrapped into a ClusterInfo object.
      • getBuckets

        List<BucketSettings> getBuckets()
        Returns a list of BucketSettings for all available Buckets with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        a potentially empty list with BucketSettings.
      • getBuckets

        List<BucketSettings> getBuckets​(long timeout,
                                        TimeUnit timeUnit)
        Returns a list of BucketSettings for all available Buckets with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        a potentially empty list with BucketSettings.
      • getBucket

        BucketSettings getBucket​(String name)
        Returns the BucketSettings for the Bucket identified by name with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 BucketSettings if found or null.
      • getBucket

        BucketSettings getBucket​(String name,
                                 long timeout,
                                 TimeUnit timeUnit)
        Returns the BucketSettings for the Bucket identified by name with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        the BucketSettings if found or null.
      • hasBucket

        Boolean hasBucket​(String name)
        Checks if the cluster has a Bucket identified by the given name with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
      • hasBucket

        Boolean hasBucket​(String name,
                          long timeout,
                          TimeUnit timeUnit)
        Checks if the cluster has a Bucket identified by the given name with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        true if it was found, false otherwise.
      • insertBucket

        BucketSettings insertBucket​(BucketSettings settings)
        Inserts a Bucket with its BucketSettings if it does not already exist with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
      • insertBucket

        BucketSettings insertBucket​(BucketSettings settings,
                                    long timeout,
                                    TimeUnit timeUnit)
        Inserts a Bucket with its BucketSettings if it does not already exist with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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

        BucketSettings updateBucket​(BucketSettings settings)
        Updates a Bucket with its BucketSettings if it does already exist with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
      • updateBucket

        BucketSettings updateBucket​(BucketSettings settings,
                                    long timeout,
                                    TimeUnit timeUnit)
        Updates a Bucket with its BucketSettings if it does already exist with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        the updated bucket settings if succeeded.
      • removeBucket

        Boolean removeBucket​(String name)
        Removes a Bucket identified by its name with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
      • removeBucket

        Boolean removeBucket​(String name,
                             long timeout,
                             TimeUnit timeUnit)
        Removes a Bucket identified by its name with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        true if the removal was successful, false otherwise.
      • upsertUser

        @Experimental
        Boolean upsertUser​(AuthDomain domain,
                           String username,
                           UserSettings settings)
        Creates/Updates a user with its UserSettings with default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 likely AuthDomain.LOCAL
        username - the user name of the user to be updated
        settings - the user settings that should be applied.
        Returns:
        true if succeeded.
      • upsertUser

        @Experimental
        Boolean upsertUser​(AuthDomain domain,
                           String username,
                           UserSettings settings,
                           long timeout,
                           TimeUnit timeUnit)
        Creates/Updates a user with its UserSettings with custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 likely AuthDomain.LOCAL
        username - the user name of the user to be updated.
        settings - the user settings that should be applied.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        true if succeeded.
      • removeUser

        @Experimental
        Boolean removeUser​(AuthDomain domain,
                           String username)
        Removes a user identified by user name with the default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 likely AuthDomain.LOCAL
        username - the user name of the user to be deleted.
        Returns:
        true if the removal was successful, false otherwise.
      • removeUser

        @Experimental
        Boolean removeUser​(AuthDomain domain,
                           String username,
                           long timeout,
                           TimeUnit timeUnit)
        Removes a user identified by user name with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 likely AuthDomain.LOCAL
        username - the user name of the user to be deleted.
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        true if the removal was successful, false otherwise.
      • getUsers

        @Experimental
        List<User> getUsers​(AuthDomain domain)
        Get all users in Couchbase with default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        users the list of users.
      • getUsers

        @Experimental
        List<User> getUsers​(AuthDomain domain,
                            long timeout,
                            TimeUnit timeUnit)
        Get all users in Couchbase with a custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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 likely AuthDomain.LOCAL
        timeout - the custom timeout.
        timeUnit - the time unit for the custom timeout.
        Returns:
        users the list of users.
      • getUser

        @Experimental
        User getUser​(AuthDomain domain,
                     String userid)
        Get user info in Couchbase with default management timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        user info
      • getUser

        @Experimental
        User getUser​(AuthDomain domain,
                     String userid,
                     long timeout,
                     TimeUnit timeUnit)
        Get user info in Couchbase with custom timeout. This method throws: - java.util.concurrent.TimeoutException: If the timeout is exceeded. - 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:
        user info