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 all CouchbaseRequests.
Since:
1.0
Author:
Michael Nitschinger
  • Method Details

    • observable

      rx.subjects.Subject<CouchbaseResponse,​CouchbaseResponse> observable()
      Get the underlying Observable.
      Returns:
      the observable which will complete the response.
    • emit

      void emit​(CouchbaseResponse response)
      Emits the CouchbaseResponse 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 the CouchbaseResponse into the underlying state holder (like a subject) and completes it as well per contract. Its basically a shortcut for emit(CouchbaseResponse) followed by complete().
      Parameters:
      response - the response to emit and complete.
    • fail

      void fail​(Throwable throwable)
      Fails the CouchbaseResponse 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 the Span 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)