@InterfaceStability.Committed @InterfaceAudience.Public public class MultiMutationResponse extends AbstractKeyValueResponse
The response for a BinarySubdocMultiMutationRequest
. Error status other than ResponseStatus.SUBDOC_MULTI_PATH_FAILURE
denote an error at document level, while the later denotes an error at sub-document level. In this case, look at firstErrorStatus()
to determine which sub-document error happened.
Constructor and Description |
---|
MultiMutationResponse(ResponseStatus status,
short serverStatusCode,
String bucket,
BinarySubdocMultiMutationRequest request,
long cas,
MutationToken mutationToken)
Creates a unsuccessful
MultiMutationResponse that failed at document level. |
MultiMutationResponse(ResponseStatus status,
short serverStatusCode,
String bucket,
int firstErrorIndex,
short firstErrorStatusCode,
BinarySubdocMultiMutationRequest request,
long cas,
MutationToken mutationToken)
Creates a
MultiMutationResponse that failed at subdocument level. |
MultiMutationResponse(String bucket,
BinarySubdocMultiMutationRequest request,
long cas,
MutationToken token,
List<MultiResult<Mutation>> responses)
Creates an successful
MultiMutationResponse . |
Modifier and Type | Method and Description |
---|---|
long |
cas() |
int |
firstErrorIndex() |
ResponseStatus |
firstErrorStatus() |
MutationToken |
mutationToken() |
BinarySubdocMultiMutationRequest |
request()
Stub method implementation which needs to be overridden by all responses that support cloning.
|
List<MultiResult<Mutation>> |
responses() |
bucket, content, refCnt, release, release, retain, retain, serverDuration, serverDuration, serverStatusCode, toString
creationTime, status, statusDetails, statusDetails
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
status, statusDetails, statusDetails
creationTime
public MultiMutationResponse(ResponseStatus status, short serverStatusCode, String bucket, int firstErrorIndex, short firstErrorStatusCode, BinarySubdocMultiMutationRequest request, long cas, MutationToken mutationToken)
Creates a MultiMutationResponse
that failed at subdocument level. The status, expected to be ResponseStatus.SUBDOC_MULTI_PATH_FAILURE
, denotes that at least one MutationCommand
failed.
status
- the status of the request (SUBDOC_MULTI_PATH_FAILURE).serverStatusCode
- the status code of the whole request.bucket
- the bucket on which the request happened.firstErrorIndex
- the zero-based index of the first MutationCommand
that failed (in case failure is due to one or more commands).firstErrorStatusCode
- the status code for the first MutationCommand
that failed (in case failure is due to one or more commands).request
- the original BinarySubdocMultiMutationRequest
.cas
- the CAS value of the document after mutations.mutationToken
- the MutationToken
of the document after mutations, if available. Null otherwise.public MultiMutationResponse(ResponseStatus status, short serverStatusCode, String bucket, BinarySubdocMultiMutationRequest request, long cas, MutationToken mutationToken)
Creates a unsuccessful MultiMutationResponse
that failed at document level.
First error index is set to -1 and first error status is set to ResponseStatus.FAILURE
.
status
- the failed status of the request.serverStatusCode
- the status code of the whole request.bucket
- the bucket on which the request happened.request
- the original BinarySubdocMultiMutationRequest
.cas
- the CAS value of the document after mutations.mutationToken
- the MutationToken
of the document after mutations, if available. Null otherwise.public MultiMutationResponse(String bucket, BinarySubdocMultiMutationRequest request, long cas, MutationToken token, List<MultiResult<Mutation>> responses)
Creates an successful MultiMutationResponse
.
bucket
- the bucket on which the request happened.request
- the original BinarySubdocMultiMutationRequest
.cas
- the CAS value of the document after mutations.token
- the MutationToken
of the document after mutations, if available. Null otherwise.responses
- the list of MultiResult<Mutation>
for each command. Some may include a value.public BinarySubdocMultiMutationRequest request()
AbstractCouchbaseResponse
Stub method implementation which needs to be overridden by all responses that support cloning.
request
in interface CouchbaseResponse
request
in class AbstractCouchbaseResponse
public long cas()
public MutationToken mutationToken()
MutationToken
corresponding to a mutation of the document, if it was mutated and tokens are activated.public int firstErrorIndex()
MutationCommand
that failed, or -1 if none failed or the whole request failed due to another factor (eg. key doesn’t exist).public ResponseStatus firstErrorStatus()
ResponseStatus
of the first MutationCommand
that failed, ResponseStatus.SUCCESS
if none failed or ResponseStatus.FAILURE
if the whole request failed due to another factor (eg. key doesn’t exist).public List<MultiResult<Mutation>> responses()
MultiResult<Mutation>
, giving the individual result of each MutationCommand
.Copyright © 2018 Couchbase, Inc.. All rights reserved.