Package com.couchbase.client.core
Class CouchbaseCore
java.lang.Object
com.couchbase.client.core.CouchbaseCore
- All Implemented Interfaces:
ClusterFacade
public class CouchbaseCore extends Object implements ClusterFacade
The general implementation of a
ClusterFacade
.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
Field Summary
Fields Modifier and Type Field Description static BackpressureException
BACKPRESSURE_EXCEPTION
A preconstructedBackpressureException
. -
Constructor Summary
Constructors Constructor Description CouchbaseCore()
Creates a newCouchbaseCore
.CouchbaseCore(CoreEnvironment environment)
Creates a newCouchbaseCore
. -
Method Summary
Modifier and Type Method Description CoreContext
ctx()
Exposes the currently used environment.long
id()
The core id is unique per core instance.<R extends CouchbaseResponse>
rx.Observable<R>send(CouchbaseRequest request)
Sends aCouchbaseRequest
into the cluster and eventually returns aCouchbaseResponse
.
-
Field Details
-
BACKPRESSURE_EXCEPTION
A preconstructedBackpressureException
.
-
-
Constructor Details
-
CouchbaseCore
public CouchbaseCore()Creates a newCouchbaseCore
. -
CouchbaseCore
Creates a newCouchbaseCore
.
-
-
Method Details
-
send
Description copied from interface:ClusterFacade
Sends aCouchbaseRequest
into the cluster and eventually returns aCouchbaseResponse
. TheCouchbaseResponse
is not returned directly, but is wrapped into aObservable
.- Specified by:
send
in interfaceClusterFacade
- Type Parameters:
R
- the generic response type.- Parameters:
request
- the request to send.- Returns:
- the
CouchbaseResponse
wrapped into aObservable
.
-
id
public long id()Description copied from interface:ClusterFacade
The core id is unique per core instance.- Specified by:
id
in interfaceClusterFacade
- Returns:
- returns the ID for this core.
-
ctx
Description copied from interface:ClusterFacade
Exposes the currently used environment.- Specified by:
ctx
in interfaceClusterFacade
- Returns:
- the environment used.
-