Package com.couchbase.client.java
Class ReactiveBucket
- java.lang.Object
-
- com.couchbase.client.java.ReactiveBucket
-
public class ReactiveBucket extends Object
Provides access to a Couchbase bucket in a reactive fashion.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncBucket
async()
Provides access to the underlyingAsyncBucket
.ReactiveCollection
collection(String collectionName)
Opens the collection with the given name for thisReactiveBucket
.ReactiveCollectionManager
collections()
Core
core()
Provides access to the underlyingCore
.ReactiveCollection
defaultCollection()
Opens the default collection for thisReactiveBucket
.ReactiveScope
defaultScope()
Opens the defaultReactiveScope
.ClusterEnvironment
environment()
Returns the attachedClusterEnvironment
.String
name()
Returns the name of theReactiveBucket
.Mono<PingResult>
ping()
Performs application-level ping requests against services in the couchbase cluster.Mono<PingResult>
ping(PingOptions options)
Performs application-level ping requests with custom options against services in the couchbase cluster.ReactiveScope
scope(String name)
Opens theReactiveScope
with the given name.ReactiveViewIndexManager
viewIndexes()
Mono<ReactiveViewResult>
viewQuery(String designDoc, String viewName)
Mono<ReactiveViewResult>
viewQuery(String designDoc, String viewName, ViewOptions options)
Mono<Void>
waitUntilReady(Duration timeout)
Waits until the desiredClusterState
is reached.Mono<Void>
waitUntilReady(Duration timeout, WaitUntilReadyOptions options)
Waits until the desiredClusterState
is reached.
-
-
-
Method Detail
-
async
public AsyncBucket async()
Provides access to the underlyingAsyncBucket
.
-
name
public String name()
Returns the name of theReactiveBucket
.
-
core
@Volatile public Core core()
Provides access to the underlyingCore
.This is advanced API, use with care!
-
collections
public ReactiveCollectionManager collections()
-
viewIndexes
public ReactiveViewIndexManager viewIndexes()
-
environment
public ClusterEnvironment environment()
Returns the attachedClusterEnvironment
.
-
scope
@Volatile public ReactiveScope scope(String name)
Opens theReactiveScope
with the given name.- Parameters:
name
- the name of the scope.- Returns:
- the
ReactiveScope
once opened.
-
defaultScope
@Volatile public ReactiveScope defaultScope()
Opens the defaultReactiveScope
.- Returns:
- the
ReactiveScope
once opened.
-
defaultCollection
public ReactiveCollection defaultCollection()
Opens the default collection for thisReactiveBucket
.- Returns:
- the
ReactiveCollection
once opened.
-
collection
@Volatile public ReactiveCollection collection(String collectionName)
Opens the collection with the given name for thisReactiveBucket
.- Returns:
- the
ReactiveCollection
once opened.
-
viewQuery
public Mono<ReactiveViewResult> viewQuery(String designDoc, String viewName)
-
viewQuery
public Mono<ReactiveViewResult> viewQuery(String designDoc, String viewName, ViewOptions options)
-
ping
public Mono<PingResult> ping()
Performs application-level ping requests against services in the couchbase cluster.- Returns:
- the
PingResult
once complete.
-
ping
public Mono<PingResult> ping(PingOptions options)
Performs application-level ping requests with custom options against services in the couchbase cluster.- Returns:
- the
PingResult
once complete.
-
waitUntilReady
public Mono<Void> waitUntilReady(Duration timeout)
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 mono that completes either once ready or timeout.
-
waitUntilReady
public Mono<Void> waitUntilReady(Duration timeout, WaitUntilReadyOptions options)
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 mono that completes either once ready or timeout.
-
-