@InterfaceStability.Committed @InterfaceAudience.Public public abstract class AbstractSubdocMutationRequest extends AbstractSubdocRequest implements BinarySubdocMutationRequest
Base class for all 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.
|
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, key, keyBytes, opaque, operationId, partition, partition
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
key, keyBytes, opaque, partition, partition
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)
Creates a new 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)
Creates a new 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
A 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
Sets whether missing nodes in the 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)
Modifies the request so that it requires the creation of missing intermediary nodes in the path if set to true.
createIntermediaryPath
- true if missing intermediary nodes in the path should be created, false if they should be considered as errors.public boolean xattr()
BinarySubdocMutationRequest
Access to extended attribute section of the couchbase document
xattr
in interface BinarySubdocMutationRequest
public void xattr(boolean xattr)
public long cas()
cas
in interface BinarySubdocMutationRequest
public boolean createDocument()
BinarySubdocMutationRequest
Create document if it does not exist. It is deprecated, use BinarySubdocMutationRequest.upsertDocument()
createDocument
in interface BinarySubdocMutationRequest
public void createDocument(boolean createDocument)
public boolean upsertDocument()
BinarySubdocMutationRequest
Upsert document if it does not exist
upsertDocument
in interface BinarySubdocMutationRequest
public void upsertDocument(boolean upsertDocument)
public boolean insertDocument()
BinarySubdocMutationRequest
Add document only if it does not exist
insertDocument
in interface BinarySubdocMutationRequest
public void insertDocument(boolean insertDocument)
Copyright © 2018 Couchbase, Inc.. All rights reserved.