Package com.couchbase.client.java
Class ReactiveCluster
- java.lang.Object
-
- com.couchbase.client.java.ReactiveCluster
-
public class ReactiveCluster extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<ReactiveAnalyticsResult>
analyticsQuery(String statement)
Performs an Analytics query with defaultAnalyticsOptions
.Mono<ReactiveAnalyticsResult>
analyticsQuery(String statement, AnalyticsOptions options)
Performs an Analytics query with customAnalyticsOptions
.AsyncCluster
async()
Provides access to the underlyingAsyncCluster
.Mono<ReactiveBucket>
bucket(String name)
Opens aReactiveBucket
with the given name.static Mono<ReactiveCluster>
connect(ClusterEnvironment environment)
Connect to a Couchbase cluster with a customClusterEnvironment
.static Mono<ReactiveCluster>
connect(String connectionString, Credentials credentials)
Connect to a Couchbase cluster with customCredentials
.static Mono<ReactiveCluster>
connect(String connectionString, String username, String password)
Connect to a Couchbase cluster with a username and a password as credentials.Core
core()
Provides access to the underlyingCore
.ClusterEnvironment
environment()
Provides access to the configuredClusterEnvironment
for this cluster.Mono<ReactiveQueryResult>
query(String statement)
Performs a N1QL query with defaultQueryOptions
.Mono<ReactiveQueryResult>
query(String statement, QueryOptions options)
Performs a N1QL query with customQueryOptions
.ReactiveSearchIndexManager
searchIndexes()
Provides access to the index management capabilities.Mono<ReactiveSearchResult>
searchQuery(SearchQuery query)
Performs a Full Text Search (FTS) query with defaultSearchOptions
.Mono<ReactiveSearchResult>
searchQuery(SearchQuery query, SearchOptions options)
Performs a Full Text Search (FTS) query with customSearchOptions
.Mono<Void>
shutdown()
Performs a non-reversible shutdown of thisReactiveCluster
.Mono<Void>
shutdown(Duration timeout)
Performs a non-reversible shutdown of thisReactiveCluster
.
-
-
-
Method Detail
-
connect
public static Mono<ReactiveCluster> connect(String connectionString, String username, String password)
Connect to a Couchbase cluster with a username and a password as credentials.- Parameters:
connectionString
- connection string used to locate the Couchbase cluster.username
- the name of the user with appropriate permissions on the cluster.password
- the password of the user with appropriate permissions on the cluster.- Returns:
- if properly connected, returns a
ReactiveCluster
.
-
connect
public static Mono<ReactiveCluster> connect(String connectionString, Credentials credentials)
Connect to a Couchbase cluster with customCredentials
.- Parameters:
connectionString
- connection string used to locate the Couchbase cluster.credentials
- custom credentials used when connecting to the cluster.- Returns:
- if properly connected, returns a
ReactiveCluster
.
-
connect
public static Mono<ReactiveCluster> connect(ClusterEnvironment environment)
Connect to a Couchbase cluster with a customClusterEnvironment
.- Parameters:
environment
- the custom environment with its properties used to connect to the cluster.- Returns:
- if properly connected, returns a
ReactiveCluster
.
-
core
@Volatile public Core core()
Provides access to the underlyingCore
.This is advanced API, use with care!
-
async
public AsyncCluster async()
Provides access to the underlyingAsyncCluster
.
-
environment
public ClusterEnvironment environment()
Provides access to the configuredClusterEnvironment
for this cluster.
-
searchIndexes
@Volatile public ReactiveSearchIndexManager searchIndexes()
Provides access to the index management capabilities.
-
query
public Mono<ReactiveQueryResult> query(String statement)
Performs a N1QL query with defaultQueryOptions
.- Parameters:
statement
- the N1QL query statement as a raw string.- Returns:
- the
ReactiveQueryResult
once the response arrives successfully.
-
query
public Mono<ReactiveQueryResult> query(String statement, QueryOptions options)
Performs a N1QL query with customQueryOptions
.- Parameters:
statement
- the N1QL query statement as a raw string.options
- the custom options for this query.- Returns:
- the
ReactiveQueryResult
once the response arrives successfully.
-
analyticsQuery
public Mono<ReactiveAnalyticsResult> analyticsQuery(String statement)
Performs an Analytics query with defaultAnalyticsOptions
.- Parameters:
statement
- the Analytics query statement as a raw string.- Returns:
- the
ReactiveAnalyticsResult
once the response arrives successfully.
-
analyticsQuery
public Mono<ReactiveAnalyticsResult> analyticsQuery(String statement, AnalyticsOptions options)
Performs an Analytics query with customAnalyticsOptions
.- Parameters:
statement
- the Analytics query statement as a raw string.options
- the custom options for this analytics query.- Returns:
- the
ReactiveAnalyticsResult
once the response arrives successfully.
-
searchQuery
public Mono<ReactiveSearchResult> searchQuery(SearchQuery query)
Performs a Full Text Search (FTS) query with defaultSearchOptions
.- Parameters:
query
- the query, in the form of aSearchQuery
- Returns:
- the
SearchRequest
once the response arrives successfully, inside aMono
-
searchQuery
public Mono<ReactiveSearchResult> searchQuery(SearchQuery query, SearchOptions options)
Performs a Full Text Search (FTS) query with customSearchOptions
.- Parameters:
query
- the query, in the form of aSearchQuery
options
- the custom options for this query.- Returns:
- the
SearchRequest
once the response arrives successfully, inside aMono
-
bucket
public Mono<ReactiveBucket> bucket(String name)
Opens aReactiveBucket
with the given name.- Parameters:
name
- the name of the bucket to open.- Returns:
- a
ReactiveBucket
once opened.
-
shutdown
public Mono<Void> shutdown()
Performs a non-reversible shutdown of thisReactiveCluster
.
-
shutdown
public Mono<Void> shutdown(Duration timeout)
Performs a non-reversible shutdown of thisReactiveCluster
.- Parameters:
timeout
- overriding the default disconnect timeout if needed.
-
-