public abstract class AbstractCouchbaseRequest extends Object implements CouchbaseRequest
Default implementation for a CouchbaseRequest
, should be extended by child messages.
Modifier | Constructor and Description |
---|---|
protected |
AbstractCouchbaseRequest(String bucket,
String password)
Create a new
AbstractCouchbaseRequest . |
protected |
AbstractCouchbaseRequest(String bucket,
String password,
Subject<CouchbaseResponse,CouchbaseResponse> observable)
Create a new
AbstractCouchbaseRequest . |
Modifier and Type | Method and Description |
---|---|
String |
bucket()
The associated bucket name for this request.
|
long |
creationTime()
Returns the time in nanoseconds when the message was created.
|
int |
incrementRetryCount()
Returns the old retry count and increments it by one.
|
Subject<CouchbaseResponse,CouchbaseResponse> |
observable()
Get the underlying
Observable . |
String |
password()
The password associated with the bucket for this request.
|
int |
retryCount()
Returns the current retry count.
|
String |
toString() |
protected AbstractCouchbaseRequest(String bucket, String password)
Create a new AbstractCouchbaseRequest
.
Depending on the type of operation, bucket and password may be null, this needs to be enforced properly by the child implementations.
This constructor will create a AsyncSubject, which implies that the response for this request only emits one message. If you need to expose a streaming response, use the other constructor and feed it a ReplaySubject or something similar.
bucket
- the name of the bucket.password
- the password of the bucket.protected AbstractCouchbaseRequest(String bucket, String password, Subject<CouchbaseResponse,CouchbaseResponse> observable)
Create a new AbstractCouchbaseRequest
.
Depending on the type of operation, bucket and password may be null, this needs to be enforced properly by the child implementations.
bucket
- the name of the bucket.password
- the password of the bucket.public Subject<CouchbaseResponse,CouchbaseResponse> observable()
CouchbaseRequest
Get the underlying Observable
.
observable
in interface CouchbaseRequest
public String bucket()
CouchbaseRequest
The associated bucket name for this request.
bucket
in interface CouchbaseRequest
public String password()
CouchbaseRequest
The password associated with the bucket for this request.
password
in interface CouchbaseRequest
public long creationTime()
CouchbaseMessage
Returns the time in nanoseconds when the message was created.
creationTime
in interface CouchbaseMessage
public int incrementRetryCount()
CouchbaseRequest
Returns the old retry count and increments it by one.
incrementRetryCount
in interface CouchbaseRequest
public int retryCount()
CouchbaseRequest
Returns the current retry count.
retryCount
in interface CouchbaseRequest
Copyright © 2017 Couchbase, Inc.. All rights reserved.