Class UpsertRequest
java.lang.Object
com.couchbase.client.core.message.AbstractCouchbaseRequest
com.couchbase.client.core.message.kv.AbstractKeyValueRequest
com.couchbase.client.core.message.kv.UpsertRequest
- All Implemented Interfaces:
CouchbaseMessage
,CouchbaseRequest
,BinaryRequest
,BinaryStoreRequest
public class UpsertRequest extends AbstractKeyValueRequest implements BinaryStoreRequest
Insert or update a document.
- Since:
- 1.0
- Author:
- Michael Nitschinger
-
Field Summary
Fields inherited from class com.couchbase.client.core.message.kv.AbstractKeyValueRequest
DEFAULT_PARTITION
-
Constructor Summary
Constructors Constructor Description UpsertRequest(String key, ByteBuf content, int exp, int flags, String bucket)
UpsertRequest(String key, ByteBuf content, int exp, int flags, String bucket, boolean json)
Creates a newUpsertRequest
.UpsertRequest(String key, ByteBuf content, String bucket)
Creates a newUpsertRequest
.UpsertRequest(String key, ByteBuf content, String bucket, boolean json)
-
Method Summary
Modifier and Type Method Description ByteBuf
content()
The content of the document.int
expiration()
Returns the expiration time for this document.int
flags()
Returns the flags for this document.boolean
isJson()
Methods inherited from class com.couchbase.client.core.message.kv.AbstractKeyValueRequest
afterSpanSet, hasSeenNotMyVbucket, key, keyBytes, opaque, operationId, partition, partition, sawNotMyVbucket
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
hasSeenNotMyVbucket, key, keyBytes, opaque, partition, partition, sawNotMyVbucket
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
-
UpsertRequest
-
UpsertRequest
Creates a newUpsertRequest
.- Parameters:
key
- the key of the document.content
- the content of the document.bucket
- the name of the bucket.
-
UpsertRequest
-
UpsertRequest
Creates a newUpsertRequest
.- Parameters:
key
- the key of the document.content
- the content of the document.exp
- the expiration time.flags
- optional flags.bucket
- the the name of the bucket.
-
-
Method Details
-
expiration
public int expiration()Returns the expiration time for this document.- Specified by:
expiration
in interfaceBinaryStoreRequest
- Returns:
- the expiration time.
-
flags
public int flags()Returns the flags for this document.- Specified by:
flags
in interfaceBinaryStoreRequest
- Returns:
- the flags.
-
content
The content of the document.- Specified by:
content
in interfaceBinaryStoreRequest
- Returns:
- the content.
-
isJson
public boolean isJson()- Specified by:
isJson
in interfaceBinaryStoreRequest
-