public class Bucket extends Object
Modifier and Type | Method and Description |
---|---|
AsyncBucket |
async()
Provides access to the underlying
AsyncBucket . |
Collection |
collection(String collectionName)
Opens the collection with the given name for this
Bucket . |
CollectionManager |
collections() |
Core |
core()
Provides access to the underlying
Core . |
Collection |
defaultCollection()
Opens the default collection for this
Bucket . |
Scope |
defaultScope()
Opens the default
Scope . |
ClusterEnvironment |
environment()
Returns the attached
ClusterEnvironment . |
String |
name()
Returns the name of the
Bucket . |
PingResult |
ping()
Performs application-level ping requests against services in the couchbase cluster.
|
PingResult |
ping(PingOptions options)
Performs application-level ping requests with custom options against services in the couchbase cluster.
|
ReactiveBucket |
reactive()
Provides access to the related
ReactiveBucket . |
Scope |
scope(String name)
Opens the
Scope with the given name. |
ViewIndexManager |
viewIndexes() |
ViewResult |
viewQuery(String designDoc,
String viewName)
Queries a view on the bucket.
|
ViewResult |
viewQuery(String designDoc,
String viewName,
ViewOptions options)
Queries a view on the bucket with custom options.
|
void |
waitUntilReady(Duration timeout)
Waits until the desired
ClusterState is reached. |
void |
waitUntilReady(Duration timeout,
WaitUntilReadyOptions options)
Waits until the desired
ClusterState is reached. |
public AsyncBucket async()
AsyncBucket
.public ReactiveBucket reactive()
ReactiveBucket
.public ClusterEnvironment environment()
ClusterEnvironment
.public CollectionManager collections()
public ViewIndexManager viewIndexes()
@Stability.Volatile public Core core()
Core
.
This is advanced API, use with care!
@Stability.Volatile public Scope scope(String name)
Scope
with the given name.name
- the name of the scope.Scope
once opened.@Stability.Volatile public Scope defaultScope()
Scope
.Scope
once opened.public Collection defaultCollection()
Bucket
.Collection
once opened.@Stability.Volatile public Collection collection(String collectionName)
Bucket
.Collection
once opened.public ViewResult viewQuery(String designDoc, String viewName)
designDoc
- the name of the design document in which the view resides.viewName
- the name of the view to query.ViewResult
once completed.ViewNotFoundException
- if the view or design document is not found on the server.TimeoutException
- if the operation times out before getting a result.CouchbaseException
- for all other error reasons (acts as a base type and catch-all).public ViewResult viewQuery(String designDoc, String viewName, ViewOptions options)
designDoc
- the name of the design document in which the view resides.viewName
- the name of the view to query.options
- allows to customize view options.ViewResult
once completed.ViewNotFoundException
- if the view or design document is not found on the server.TimeoutException
- if the operation times out before getting a result.CouchbaseException
- for all other error reasons (acts as a base type and catch-all).public PingResult ping()
PingResult
once complete.public PingResult ping(PingOptions options)
PingResult
once complete.public void waitUntilReady(Duration timeout)
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.
timeout
- the maximum time to wait until readiness.public void waitUntilReady(Duration timeout, WaitUntilReadyOptions options)
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
.
timeout
- the maximum time to wait until readiness.options
- the options to customize the readiness waiting.Copyright © 2020 Couchbase, Inc.. All rights reserved.