Class AsyncBucket


  • public class AsyncBucket
    extends Object
    Provides access to a Couchbase bucket in an async fashion.
    • Method Detail

      • core

        @Volatile
        public Core core()
        Provides access to the underlying Core.

        This is advanced API, use with care!

      • defaultCollection

        public AsyncCollection defaultCollection()
        Opens the default collection for this AsyncBucket using the default scope.

        This method does not block and the client will try to establish all needed resources in the background. If you need to eagerly await until all resources are established before performing an operation, use the waitUntilReady(Duration) method on the AsyncBucket.

        Returns:
        the opened default AsyncCollection.
      • collection

        public AsyncCollection collection​(String collectionName)
        Provides access to the collection with the given name for this AsyncBucket using the default scope.

        This method does not block and the client will try to establish all needed resources in the background. If you need to eagerly await until all resources are established before performing an operation, use the waitUntilReady(Duration) method on the AsyncBucket.

        Returns:
        the opened named AsyncCollection.
      • waitUntilReady

        public CompletableFuture<Void> waitUntilReady​(Duration timeout)
        Waits until the desired ClusterState is reached.

        This method will wait until either the cluster state is "online", or the timeout is reached. Since the SDK is bootstrapping lazily, this method allows to eagerly check during bootstrap if all of the services are online and usable before moving on.

        Parameters:
        timeout - the maximum time to wait until readiness.
        Returns:
        a completable future that completes either once ready or timeout.
      • waitUntilReady

        public CompletableFuture<Void> waitUntilReady​(Duration timeout,
                                                      WaitUntilReadyOptions options)
        Waits until the desired ClusterState is reached.

        This method will wait until either the cluster state is "online" by default, or the timeout is reached. Since the SDK is bootstrapping lazily, this method allows to eagerly check during bootstrap if all of the services are online and usable before moving on. You can tune the properties through WaitUntilReadyOptions.

        Parameters:
        timeout - the maximum time to wait until readiness.
        options - the options to customize the readiness waiting.
        Returns:
        a completable future that completes either once ready or timeout.