Class SubArrayRequest
java.lang.Object
com.couchbase.client.core.message.AbstractCouchbaseRequest
com.couchbase.client.core.message.kv.AbstractKeyValueRequest
com.couchbase.client.core.message.kv.subdoc.simple.AbstractSubdocRequest
com.couchbase.client.core.message.kv.subdoc.simple.AbstractSubdocMutationRequest
com.couchbase.client.core.message.kv.subdoc.simple.SubArrayRequest
- All Implemented Interfaces:
CouchbaseMessage
,CouchbaseRequest
,BinaryRequest
,BinarySubdocMutationRequest
,BinarySubdocRequest
@Committed @Public public class SubArrayRequest extends AbstractSubdocMutationRequest
A request covering all sub-document array operations (see
SubArrayRequest.ArrayOperation
).- Since:
- 1.2
- Author:
- Simon Baslé
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubArrayRequest.ArrayOperation
-
Field Summary
Fields inherited from class com.couchbase.client.core.message.kv.subdoc.simple.AbstractSubdocRequest
EXCEPTION_EMPTY_PATH, EXCEPTION_NULL_PATH
Fields inherited from class com.couchbase.client.core.message.kv.AbstractKeyValueRequest
DEFAULT_PARTITION
-
Constructor Summary
Constructors Constructor Description SubArrayRequest(String key, String path, SubArrayRequest.ArrayOperation arrayOp, ByteBuf fragment, String bucket)
Creates a newSubArrayRequest
of type arrayOp.SubArrayRequest(String key, String path, SubArrayRequest.ArrayOperation arrayOp, ByteBuf fragment, String bucket, int expiration, long cas)
Creates a newSubArrayRequest
of type arrayOp. -
Method Summary
Modifier and Type Method Description SubArrayRequest.ArrayOperation
arrayOperation()
byte
opcode()
Methods inherited from class com.couchbase.client.core.message.kv.subdoc.simple.AbstractSubdocMutationRequest
cas, createDocument, createDocument, createIntermediaryPath, createIntermediaryPath, expandMacros, expandMacros, expiration, fragment, insertDocument, insertDocument, upsertDocument, upsertDocument, xattr, xattr
Methods inherited from class com.couchbase.client.core.message.kv.subdoc.simple.AbstractSubdocRequest
cleanUpAndThrow, content, createContent, path, pathLength
Methods inherited from class com.couchbase.client.core.message.kv.AbstractKeyValueRequest
afterSpanSet, key, keyBytes, opaque, operationId, partition, partition
Methods inherited from class com.couchbase.client.core.message.AbstractCouchbaseRequest
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.couchbase.client.core.message.kv.BinaryRequest
key, keyBytes, opaque, partition, partition
Methods inherited from interface com.couchbase.client.core.message.kv.subdoc.BinarySubdocRequest
content, path, pathLength
Methods inherited from interface com.couchbase.client.core.message.CouchbaseMessage
creationTime
Methods inherited from interface com.couchbase.client.core.message.CouchbaseRequest
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
-
Constructor Details
-
SubArrayRequest
public SubArrayRequest(String key, String path, SubArrayRequest.ArrayOperation arrayOp, ByteBuf fragment, String bucket, int expiration, long cas)Creates a newSubArrayRequest
of type arrayOp.- Parameters:
key
- the key of the document.path
- the subdocument path to consider inside the document.arrayOp
- the specificSubArrayRequest.ArrayOperation
to perform.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 operation- Throws:
NullPointerException
- if the path is null (seeAbstractSubdocRequest.EXCEPTION_NULL_PATH
)IllegalArgumentException
- if the operation isSubArrayRequest.ArrayOperation.INSERT
and path is empty (seeAbstractSubdocRequest.EXCEPTION_EMPTY_PATH
)
-
SubArrayRequest
public SubArrayRequest(String key, String path, SubArrayRequest.ArrayOperation arrayOp, ByteBuf fragment, String bucket)Creates a newSubArrayRequest
of type arrayOp.- Parameters:
key
- the key of the document.path
- the subdocument path to consider inside the document.arrayOp
- the specificSubArrayRequest.ArrayOperation
to perform.fragment
- the fragment of valid JSON to mutate into at the site denoted by the path.bucket
- the bucket of the document.- Throws:
NullPointerException
- if the path is null (seeAbstractSubdocRequest.EXCEPTION_NULL_PATH
)IllegalArgumentException
- if the operation isSubArrayRequest.ArrayOperation.INSERT
and path is empty (seeAbstractSubdocRequest.EXCEPTION_EMPTY_PATH
)
-
-
Method Details
-
opcode
public byte opcode()- Returns:
- the opcode of the operation
- See Also:
KeyValueHandler.OP_SUB_GET and other OP_SUB_ constants for the list of opcodes
-
arrayOperation
- Returns:
- the more specific
SubArrayRequest.ArrayOperation
this request describes.
-