Interface CouchbaseRequest
-
- All Superinterfaces:
CouchbaseMessage
- All Known Subinterfaces:
AnalyticsRequest
,BinaryRequest
,BinaryStoreRequest
,BinarySubdocMultiLookupRequest
,BinarySubdocMultiMutationRequest
,BinarySubdocMutationRequest
,BinarySubdocRequest
,ClusterRequest
,ConfigRequest
,InternalRequest
,PrelocatedRequest
,QueryRequest
,SearchRequest
,ViewRequest
- All Known Implementing Classes:
AbstractCouchbaseRequest
,AbstractKeyValueRequest
,AbstractSubdocMutationRequest
,AbstractSubdocRequest
,AddNodeRequest
,AddServiceRequest
,AnalyticsHandler.KeepAliveRequest
,AnalyticsHandlerV2.KeepAliveRequest
,AnalyticsQueryResultRequest
,AnalyticsQueryStatusRequest
,AppendRequest
,BucketConfigRequest
,BucketsConfigRequest
,BucketStreamingRequest
,CloseBucketRequest
,ClusterConfigRequest
,CounterRequest
,DiagnosticsRequest
,DisconnectRequest
,FlushRequest
,GenericAnalyticsRequest
,GenericQueryRequest
,GetAllMutationTokensRequest
,GetBucketConfigRequest
,GetClusterConfigRequest
,GetConfigProviderRequest
,GetDesignDocumentRequest
,GetDesignDocumentsRequest
,GetRequest
,GetSearchIndexRequest
,GetUsersRequest
,InsertBucketRequest
,InsertRequest
,KeyValueHandler.KeepAliveRequest
,NoopRequest
,ObserveRequest
,ObserveSeqnoRequest
,OpenBucketRequest
,PingRequest
,PingRequest
,PingRequest
,PingRequest
,PrependRequest
,QueryHandler.KeepAliveRequest
,QueryHandlerV2.KeepAliveRequest
,RawAnalyticsRequest
,RawQueryRequest
,RemoveBucketRequest
,RemoveDesignDocumentRequest
,RemoveNodeRequest
,RemoveRequest
,RemoveSearchIndexRequest
,RemoveServiceRequest
,RemoveUserRequest
,ReplaceRequest
,ReplicaGetRequest
,RestApiRequest
,SearchHandler.KeepAliveRequest
,SearchQueryRequest
,SeedNodesRequest
,SignalConfigReload
,SignalFlush
,StatRequest
,SubArrayRequest
,SubCounterRequest
,SubDeleteRequest
,SubDictAddRequest
,SubDictUpsertRequest
,SubExistRequest
,SubGetCountRequest
,SubGetRequest
,SubMultiLookupRequest
,SubMultiMutationRequest
,SubReplaceRequest
,TouchRequest
,UnlockRequest
,UpdateBucketRequest
,UpsertDesignDocumentRequest
,UpsertRequest
,UpsertSearchIndexRequest
,UpsertUserRequest
,ViewHandler.KeepAliveRequest
,ViewQueryRequest
public interface CouchbaseRequest extends CouchbaseMessage
High-Level marker interface for allCouchbaseRequest
s.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
bucket()
The associated bucket name for this request.void
complete()
Completes the underlying state holder.String
dispatchHostname()
void
dispatchHostname(String hostname)
void
emit(CouchbaseResponse response)
Emits theCouchbaseResponse
into the underlying state holder (like a subject) without completing it as per contract.void
fail(Throwable throwable)
Fails theCouchbaseResponse
on the state holder as per contract.int
incrementRetryCount()
Returns the old retry count and increments it by one.boolean
isActive()
Checks if the request is unsubscribed on a timeoutString
lastLocalId()
void
lastLocalId(String localId)
String
lastLocalSocket()
void
lastLocalSocket(String local)
String
lastRemoteSocket()
void
lastRemoteSocket(String remote)
long
maxRetryDuration()
Returns the maximum retry duration for the request.void
maxRetryDuration(long duration)
Sets the maximum retry duration for the request.rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse>
observable()
Get the underlyingObservable
.String
operationId()
A unique operation id, used for tracing purposes.String
password()
The password associated with the bucket/ userlong
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 configvoid
retryDelay(Delay delay)
Sets the retry delay configio.opentracing.Span
span()
Returns theSpan
for this request if set.void
span(io.opentracing.Span span, CoreEnvironment env)
Allows to set a custom span that should be used.void
subscriber(rx.Subscriber subscriber)
Optionally add subscriber to check for the timeoutsvoid
succeed(CouchbaseResponse response)
Emits theCouchbaseResponse
into the underlying state holder (like a subject) and completes it as well per contract.String
username()
User authorized for bucket access-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseMessage
creationTime
-
-
-
-
Method Detail
-
observable
rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable()
Get the underlyingObservable
.- Returns:
- the observable which will complete the response.
-
emit
void emit(CouchbaseResponse response)
Emits theCouchbaseResponse
into the underlying state holder (like a subject) without completing it as per contract.- Parameters:
response
- the response to emit.
-
complete
void complete()
Completes the underlying state holder.
-
succeed
void succeed(CouchbaseResponse response)
Emits theCouchbaseResponse
into the underlying state holder (like a subject) and completes it as well per contract. Its basically a shortcut foremit(CouchbaseResponse)
followed bycomplete()
.- Parameters:
response
- the response to emit and complete.
-
fail
void fail(Throwable throwable)
Fails theCouchbaseResponse
on the state holder as per contract.- Parameters:
throwable
- the throwable to fail the response with.
-
bucket
String bucket()
The associated bucket name for this request.- Returns:
- the bucket name.
-
username
String username()
User authorized for bucket access
-
password
String password()
The password associated with the bucket/ user- Returns:
- the password.
-
incrementRetryCount
int incrementRetryCount()
Returns the old retry count and increments it by one.- Returns:
- the old retryCount.
-
retryCount
int retryCount()
Returns the current retry count.- Returns:
- the current retry count.
-
retryAfter
void retryAfter(long after)
Sets the initial retry after time for the request.- Parameters:
after
-
-
retryAfter
long retryAfter()
Gets the initial retry after time for the request.
-
maxRetryDuration
void maxRetryDuration(long duration)
Sets the maximum retry duration for the request.- Parameters:
duration
-
-
maxRetryDuration
long maxRetryDuration()
Returns the maximum retry duration for the request.- Returns:
- duration
-
retryDelay
void retryDelay(Delay delay)
Sets the retry delay config- Parameters:
delay
-
-
retryDelay
Delay retryDelay()
Returns the retry delay config- Returns:
- delay
-
isActive
@Private @Uncommitted boolean isActive()
Checks if the request is unsubscribed on a timeout- Returns:
- false if timed out, else true
-
subscriber
@Private @Uncommitted void subscriber(rx.Subscriber subscriber)
Optionally add subscriber to check for the timeouts
-
dispatchHostname
String dispatchHostname()
-
dispatchHostname
void dispatchHostname(String hostname)
-
span
io.opentracing.Span span()
Returns theSpan
for this request if set.- Returns:
- the span used.
-
span
void span(io.opentracing.Span span, CoreEnvironment env)
Allows to set a custom span that should be used.- Parameters:
span
- the span to use.env
- the core env used for context-sensitive stuff, may be null.
-
operationId
String operationId()
A unique operation id, used for tracing purposes. May or may not be null depending on the service implementation.- Returns:
- the operation id or null.
-
lastLocalSocket
String lastLocalSocket()
-
lastRemoteSocket
String lastRemoteSocket()
-
lastLocalId
String lastLocalId()
-
lastLocalSocket
void lastLocalSocket(String local)
-
lastRemoteSocket
void lastRemoteSocket(String remote)
-
lastLocalId
void lastLocalId(String localId)
-
-