public class BinaryTranscoder extends AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
Constructor and Description |
---|
BinaryTranscoder() |
Modifier and Type | Method and Description |
---|---|
Class<BinaryDocument> |
documentType() |
protected BinaryDocument |
doDecode(String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
int expiry,
int flags,
ResponseStatus status)
Perform the decoding of the received response.
|
protected Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,Integer> |
doEncode(BinaryDocument document)
Perform the encoding of the request document.
|
BinaryDocument |
newDocument(String id,
int expiry,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas)
Creates a new Document with the passed in information.
|
BinaryDocument |
newDocument(String id,
int expiry,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
MutationToken mutationToken)
Default implementation for backwards compatibility.
|
protected boolean |
shouldAutoReleaseOnDecode()
Flag method to auto release decoded buffers.
|
protected boolean |
shouldAutoReleaseOnError()
Flag method to auto release buffers on decoding error.
|
decode, encode
protected BinaryDocument doDecode(String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, int expiry, int flags, ResponseStatus status) throws Exception
AbstractTranscoder
doDecode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
id
- the id of the document.content
- the encoded content of the document.cas
- the cas value of the document.expiry
- the expiration time of the document.flags
- the flags set on the document.status
- the response status.Exception
- if something goes wrong during the decode process.protected Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,Integer> doEncode(BinaryDocument document) throws Exception
AbstractTranscoder
doEncode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
document
- the document to encode.Exception
- if something goes wrong during the encode process.public BinaryDocument newDocument(String id, int expiry, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas)
Transcoder
Transcoder.newDocument(String, int, Object, long, MutationToken)
).id
- the id of the document.expiry
- the document expiration.content
- the document content.cas
- the documents cas value.public BinaryDocument newDocument(String id, int expiry, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, MutationToken mutationToken)
AbstractTranscoder
newDocument
in interface Transcoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
newDocument
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
id
- the id of the document.expiry
- the document expiration.content
- the document content.cas
- the documents cas value.mutationToken
- the documents mutation token.public Class<BinaryDocument> documentType()
protected boolean shouldAutoReleaseOnDecode()
AbstractTranscoder
shouldAutoReleaseOnDecode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
ByteBuf
passed to
decode
method is to be released automatically on success (default behaviour)protected boolean shouldAutoReleaseOnError()
AbstractTranscoder
shouldAutoReleaseOnError
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
ByteBuf
passed to
decode
method is to be released automatically in case of error (default behaviour)Copyright © 2015 Couchbase, Inc.