Package com.couchbase.client.java
Class AsyncBucket
java.lang.Object
com.couchbase.client.java.AsyncBucket
public class AsyncBucket extends Object
Provides access to a Couchbase bucket in an async fashion.
-
Method Summary
Modifier and Type Method Description AsyncCollection
collection(String collectionName)
Opens the collection with the given name for thisAsyncBucket
.AsyncCollectionManager
collections()
Core
core()
Provides access to the underlyingCore
.AsyncCollection
defaultCollection()
Opens the default collection for thisAsyncBucket
.AsyncScope
defaultScope()
Opens the defaultAsyncScope
.ClusterEnvironment
environment()
Returns the attachedClusterEnvironment
.String
name()
Returns the name of theAsyncBucket
.CompletableFuture<PingResult>
ping()
Performs application-level ping requests against services in the couchbase cluster.CompletableFuture<PingResult>
ping(PingOptions options)
Performs application-level ping requests with custom options against services in the couchbase cluster.AsyncScope
scope(String name)
Opens theAsyncScope
with the given name.AsyncViewIndexManager
viewIndexes()
CompletableFuture<ViewResult>
viewQuery(String designDoc, String viewName)
CompletableFuture<ViewResult>
viewQuery(String designDoc, String viewName, ViewOptions options)
CompletableFuture<Void>
waitUntilReady(Duration timeout)
Waits until the desiredClusterState
is reached.CompletableFuture<Void>
waitUntilReady(Duration timeout, WaitUntilReadyOptions options)
Waits until the desiredClusterState
is reached.
-
Method Details
-
name
Returns the name of theAsyncBucket
. -
environment
Returns the attachedClusterEnvironment
. -
core
Provides access to the underlyingCore
.This is advanced API, use with care!
-
collections
-
viewIndexes
-
scope
Opens theAsyncScope
with the given name.- Parameters:
name
- the name of the scope.- Returns:
- the
AsyncScope
once opened.
-
defaultScope
Opens the defaultAsyncScope
.- Returns:
- the
AsyncScope
once opened.
-
defaultCollection
Opens the default collection for thisAsyncBucket
.- Returns:
- the
AsyncCollection
once opened.
-
collection
Opens the collection with the given name for thisAsyncBucket
.- Returns:
- the
AsyncCollection
once opened.
-
viewQuery
-
viewQuery
public CompletableFuture<ViewResult> viewQuery(String designDoc, String viewName, ViewOptions options) -
ping
Performs application-level ping requests against services in the couchbase cluster.- Returns:
- the
PingResult
once complete.
-
ping
Performs application-level ping requests with custom options against services in the couchbase cluster.- Returns:
- the
PingResult
once complete.
-
waitUntilReady
Waits until the desiredClusterState
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
Waits until the desiredClusterState
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.
-