@InterfaceStability.Committed @InterfaceAudience.Public public abstract class AbstractSubdocRequest extends AbstractKeyValueRequest implements BinarySubdocRequest
BinarySubdocRequest
.Modifier and Type | Field and Description |
---|---|
static IllegalArgumentException |
EXCEPTION_EMPTY_PATH
An
IllegalArgumentException that is thrown by constructors when a empty path is provided on an operation
that doesn't allow them. |
static NullPointerException |
EXCEPTION_NULL_PATH
A
NullPointerException that is thrown by constructors when a null path is provided. |
DEFAULT_PARTITION
Constructor and Description |
---|
AbstractSubdocRequest(String key,
String path,
String bucket,
ByteBuf... restOfContent)
Creates a new
AbstractSubdocRequest . |
AbstractSubdocRequest(String key,
String path,
String bucket,
rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable,
ByteBuf... restOfContent)
Creates a new
AbstractSubdocRequest . |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUpAndThrow(RuntimeException e)
Utility method to ensure good cleanup when throwing an exception from a constructor.
|
ByteBuf |
content()
The
ByteBuf bearing the full content for this request. |
protected ByteBuf |
createContent(ByteBuf pathByteBuf,
ByteBuf... restOfContent) |
String |
path()
Returns the **path** inside a JSON document where values will be obtained/mutated.
|
int |
pathLength() |
afterSpanSet, hasSeenNotMyVbucket, key, keyBytes, opaque, operationId, partition, partition, sawNotMyVbucket
bucket, complete, creationTime, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, toString, username
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
opcode
hasSeenNotMyVbucket, key, keyBytes, opaque, partition, partition, sawNotMyVbucket
bucket, complete, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, username
creationTime
public static final NullPointerException EXCEPTION_NULL_PATH
NullPointerException
that is thrown by constructors when a null path is provided.public static final IllegalArgumentException EXCEPTION_EMPTY_PATH
IllegalArgumentException
that is thrown by constructors when a empty path is provided on an operation
that doesn't allow them.public AbstractSubdocRequest(String key, String path, String bucket, ByteBuf... restOfContent)
AbstractSubdocRequest
.key
- the key of the document.path
- the subdocument path to consider inside the document.bucket
- the bucket of the document.restOfContent
- the optional remainder of the content()
of the final protocol message, or null if not applicableNullPointerException
- if the path is null (see EXCEPTION_NULL_PATH
)public AbstractSubdocRequest(String key, String path, String bucket, rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable, ByteBuf... restOfContent)
AbstractSubdocRequest
.key
- the key of the document.path
- the subdocument path to consider inside the document.bucket
- the bucket of the document.observable
- the observable which receives responses.restOfContent
- the optional remainder of the content()
of the final protocol message, or null if not applicableNullPointerException
- if the path is null (see EXCEPTION_NULL_PATH
)protected void cleanUpAndThrow(RuntimeException e)
public String path()
BinarySubdocRequest
path
in interface BinarySubdocRequest
public int pathLength()
pathLength
in interface BinarySubdocRequest
BinarySubdocRequest.content()
(can serve as an offset from 0 to find the path in the content).public ByteBuf content()
BinarySubdocRequest
ByteBuf
bearing the full content for this request. The content is at a minimum comprised of the
BinarySubdocRequest.path()
as UTF8 bytes, and can also have any other relevant payload appended (eg. a JSON fragment for
mutative operations, see BinarySubdocMutationRequest.fragment()
).
This buffer is to be automatically released once the message has been written on the wire.content
in interface BinarySubdocRequest
Copyright © 2021 Couchbase, Inc.. All rights reserved.