@InterfaceStability.Committed @InterfaceAudience.Public public abstract class AbstractSubdocMutationRequest extends AbstractSubdocRequest implements BinarySubdocMutationRequest
BinarySubdocMutationRequest
.EXCEPTION_EMPTY_PATH, EXCEPTION_NULL_PATH
DEFAULT_PARTITION
Modifier | Constructor and Description |
---|---|
protected |
AbstractSubdocMutationRequest(String key,
String path,
ByteBuf fragment,
String bucket,
int expiration,
long cas)
Creates a new
AbstractSubdocMutationRequest . |
protected |
AbstractSubdocMutationRequest(String key,
String path,
ByteBuf fragment,
String bucket,
int expiration,
long cas,
rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable)
Creates a new
AbstractSubdocMutationRequest . |
Modifier and Type | Method and Description |
---|---|
long |
cas() |
boolean |
createDocument()
Create document if it does not exist.
|
void |
createDocument(boolean createDocument) |
boolean |
createIntermediaryPath()
Sets whether missing nodes in the
BinarySubdocRequest.path() should be created as part of this mutation, when possible. |
void |
createIntermediaryPath(boolean createIntermediaryPath)
Modifies the request so that it requires the creation of missing intermediary nodes in the path if set to true.
|
boolean |
expandMacros()
Sets whether macros such as ${Mutation.CAS} should be expanded
|
void |
expandMacros(boolean expandMacros) |
int |
expiration() |
ByteBuf |
fragment()
A
ByteBuf containing the JSON fragment for the mutation. |
boolean |
insertDocument()
Add document only if it does not exist
|
void |
insertDocument(boolean insertDocument) |
boolean |
upsertDocument()
Upsert document if it does not exist
|
void |
upsertDocument(boolean upsertDocument) |
boolean |
xattr()
Access to extended attribute section of the couchbase document
|
void |
xattr(boolean xattr) |
cleanUpAndThrow, content, createContent, path, 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
content, opcode, path, pathLength
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
protected AbstractSubdocMutationRequest(String key, String path, ByteBuf fragment, String bucket, int expiration, long cas)
AbstractSubdocMutationRequest
.key
- the key of the document.path
- the subdocument path to consider inside the document.fragment
- the fragment of valid JSON to mutate into at the site denoted by the path.bucket
- the bucket of the document.expiration
- the TTL of the whole enclosing document.cas
- the cas value for the operationNullPointerException
- if the path is null (see AbstractSubdocRequest.EXCEPTION_NULL_PATH
)protected AbstractSubdocMutationRequest(String key, String path, ByteBuf fragment, String bucket, int expiration, long cas, rx.subjects.Subject<CouchbaseResponse,CouchbaseResponse> observable)
AbstractSubdocMutationRequest
.key
- the key of the document.path
- the subdocument path to consider inside the document.fragment
- the fragment of valid JSON to mutate into at the site denoted by the path.bucket
- the bucket of the document.expiration
- the TTL of the whole enclosing document.cas
- the cas value for the operationobservable
- the observable which receives responses.NullPointerException
- if the path is null (see AbstractSubdocRequest.EXCEPTION_NULL_PATH
)public int expiration()
expiration
in interface BinarySubdocMutationRequest
public ByteBuf fragment()
BinarySubdocMutationRequest
ByteBuf
containing the JSON fragment for the mutation. It is appended to the BinarySubdocRequest.content()
.
This buffer is to be automatically released once the content has been written on the wire.fragment
in interface BinarySubdocMutationRequest
public boolean createIntermediaryPath()
BinarySubdocMutationRequest
BinarySubdocRequest.path()
should be created as part of this mutation, when possible.
This is represented as an additional flag on the wire.createIntermediaryPath
in interface BinarySubdocMutationRequest
public void createIntermediaryPath(boolean createIntermediaryPath)
createIntermediaryPath
- true if missing intermediary nodes in the path should be created, false if they
should be considered as errors.public boolean xattr()
BinarySubdocMutationRequest
xattr
in interface BinarySubdocMutationRequest
public void xattr(boolean xattr)
public boolean expandMacros()
BinarySubdocMutationRequest
expandMacros
in interface BinarySubdocMutationRequest
public void expandMacros(boolean expandMacros)
public long cas()
cas
in interface BinarySubdocMutationRequest
public boolean createDocument()
BinarySubdocMutationRequest
BinarySubdocMutationRequest.upsertDocument()
createDocument
in interface BinarySubdocMutationRequest
public void createDocument(boolean createDocument)
public boolean upsertDocument()
BinarySubdocMutationRequest
upsertDocument
in interface BinarySubdocMutationRequest
public void upsertDocument(boolean upsertDocument)
public boolean insertDocument()
BinarySubdocMutationRequest
insertDocument
in interface BinarySubdocMutationRequest
public void insertDocument(boolean insertDocument)
Copyright © 2021 Couchbase, Inc.. All rights reserved.