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 username,
String password)
Create a new
AbstractCouchbaseRequest. |
protected |
AbstractCouchbaseRequest(String bucket,
String username,
String password,
rx.subjects.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.
|
long |
maxRetryDuration()
Returns the maximum retry duration for the request.
|
void |
maxRetryDuration(long maxRetryDuration)
Sets the maximum retry duration for the request.
|
rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> |
observable()
Get the underlying
Observable. |
String |
password()
The password associated with the bucket/ user
|
long |
retryAfter()
Gets the initial retry after time for the request.
|
void |
retryAfter(long after)
Sets the initial retry after time for the request.
|
int |
retryCount()
Returns the current retry count.
|
Delay |
retryDelay()
Returns the retry delay config
|
void |
retryDelay(Delay retryDelay)
Sets the retry delay config
|
String |
toString() |
String |
username()
User authorized for bucket access
|
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 - user password.protected AbstractCouchbaseRequest(String bucket, String username, 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.username - user authorized to access the bucket.password - user password.protected AbstractCouchbaseRequest(String bucket, String username, String password, rx.subjects.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.username - user authorized to access the bucket.password - the password of the bucket.public rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable()
CouchbaseRequestGet the underlying Observable.
observable in interface CouchbaseRequestpublic String bucket()
CouchbaseRequestThe associated bucket name for this request.
bucket in interface CouchbaseRequestpublic String username()
CouchbaseRequestUser authorized for bucket access
username in interface CouchbaseRequestpublic String password()
CouchbaseRequestThe password associated with the bucket/ user
password in interface CouchbaseRequestpublic long creationTime()
CouchbaseMessageReturns the time in nanoseconds when the message was created.
creationTime in interface CouchbaseMessagepublic int incrementRetryCount()
CouchbaseRequestReturns the old retry count and increments it by one.
incrementRetryCount in interface CouchbaseRequestpublic int retryCount()
CouchbaseRequestReturns the current retry count.
retryCount in interface CouchbaseRequestpublic void retryAfter(long after)
CouchbaseRequestSets the initial retry after time for the request.
retryAfter in interface CouchbaseRequestpublic long retryAfter()
CouchbaseRequestGets the initial retry after time for the request.
retryAfter in interface CouchbaseRequestpublic void maxRetryDuration(long maxRetryDuration)
CouchbaseRequestSets the maximum retry duration for the request.
maxRetryDuration in interface CouchbaseRequestpublic long maxRetryDuration()
CouchbaseRequestReturns the maximum retry duration for the request.
maxRetryDuration in interface CouchbaseRequestpublic void retryDelay(Delay retryDelay)
CouchbaseRequestSets the retry delay config
retryDelay in interface CouchbaseRequestpublic Delay retryDelay()
CouchbaseRequestReturns the retry delay config
retryDelay in interface CouchbaseRequestCopyright © 2017 Couchbase, Inc.. All rights reserved.