Interface BinaryMemcacheMessage
- All Superinterfaces:
MemcacheMessage
,MemcacheObject
,ReferenceCounted
- All Known Subinterfaces:
BinaryMemcacheRequest
,BinaryMemcacheResponse
,FullBinaryMemcacheRequest
,FullBinaryMemcacheResponse
- All Known Implementing Classes:
AbstractBinaryMemcacheMessage
,DefaultBinaryMemcacheRequest
,DefaultBinaryMemcacheResponse
,DefaultFullBinaryMemcacheRequest
,DefaultFullBinaryMemcacheResponse
public interface BinaryMemcacheMessage extends MemcacheMessage
An interface that defines a binary Memcache message, providing common properties for
BinaryMemcacheRequest
and BinaryMemcacheResponse
.
A BinaryMemcacheMessage
always consists of a header and optional extras or/and
a key.- See Also:
BinaryMemcacheRequest
,BinaryMemcacheResponse
-
Method Summary
Modifier and Type Method Description long
getCAS()
Returns the CAS identifier.byte
getDataType()
Returns the data type of the message.ByteBuf
getExtras()
Returns aByteBuf
representation of the optional extras.byte
getExtrasLength()
Return the extras length of the message.ByteBuf
getFramingExtras()
Returns aByteBuf
representation of the optional framing extras.byte
getFramingExtrasLength()
Return the framing extras length of the message.byte[]
getKey()
Returns the optional key of the document.short
getKeyLength()
Returns the key length of the message.byte
getMagic()
Returns the magic byte for the message.int
getOpaque()
Returns the opaque value.byte
getOpcode()
Returns the opcode for the message.int
getTotalBodyLength()
Returns the total body length.BinaryMemcacheMessage
setCAS(long cas)
Sets the CAS identifier.BinaryMemcacheMessage
setDataType(byte dataType)
Sets the data type of the message.BinaryMemcacheMessage
setExtras(ByteBuf extras)
Sets the extras buffer on the message.BinaryMemcacheMessage
setExtrasLength(byte extrasLength)
Set the extras length of the message.BinaryMemcacheMessage
setFramingExtras(ByteBuf framingExtras)
Sets the framing extras buffer on the message.BinaryMemcacheMessage
setFramingExtrasLength(byte framingExtrasLength)
Set the framing extras length of the message.BinaryMemcacheMessage
setKey(byte[] key)
Sets the key of the document.BinaryMemcacheMessage
setKeyLength(short keyLength)
Set the key length of the message.BinaryMemcacheMessage
setMagic(byte magic)
Sets the magic byte.BinaryMemcacheMessage
setOpaque(int opaque)
Sets the opaque value.BinaryMemcacheMessage
setOpcode(byte code)
Sets the opcode for the message.BinaryMemcacheMessage
setTotalBodyLength(int totalBodyLength)
Sets the total body length.Methods inherited from interface com.couchbase.client.deps.io.netty.handler.codec.memcache.MemcacheObject
getDecoderResult, setDecoderResult
-
Method Details
-
getMagic
byte getMagic()Returns the magic byte for the message.- Returns:
- the magic byte.
-
setMagic
Sets the magic byte.- Parameters:
magic
- the magic byte to use.- See Also:
for typesafe opcodes.
-
getOpcode
byte getOpcode()Returns the opcode for the message.- Returns:
- the opcode.
-
setOpcode
Sets the opcode for the message.- Parameters:
code
- the opcode to use.
-
getKeyLength
short getKeyLength()Returns the key length of the message. This may return 0, since the key is optional.- Returns:
- the key length.
-
setKeyLength
Set the key length of the message. This may be 0, since the key is optional.- Parameters:
keyLength
- the key length to use.
-
getExtrasLength
byte getExtrasLength()Return the extras length of the message. This may be 0, since the extras content is optional.- Returns:
- the extras length.
-
setExtrasLength
Set the extras length of the message. This may be 0, since the extras content is optional.- Parameters:
extrasLength
- the extras length.
-
getDataType
byte getDataType()Returns the data type of the message.- Returns:
- the data type of the message.
-
setDataType
Sets the data type of the message.- Parameters:
dataType
- the data type of the message.
-
getTotalBodyLength
int getTotalBodyLength()Returns the total body length. Note that this may be 0, since the body is optional.- Returns:
- the total body length.
-
setTotalBodyLength
Sets the total body length. Note that this may be 0, since the body length is optional.- Parameters:
totalBodyLength
- the total body length.
-
getOpaque
int getOpaque()Returns the opaque value.- Returns:
- the opaque value.
-
setOpaque
Sets the opaque value.- Parameters:
opaque
- the opqaue value to use.
-
getCAS
long getCAS()Returns the CAS identifier.- Returns:
- the CAS identifier.
-
setCAS
Sets the CAS identifier.- Parameters:
cas
- the CAS identifier to use.
-
getKey
byte[] getKey()Returns the optional key of the document.- Returns:
- the key of the document.
-
setKey
Sets the key of the document.- Parameters:
key
- the key of the message.
-
getExtras
ByteBuf getExtras()Returns aByteBuf
representation of the optional extras.- Returns:
- the optional extras.
-
setExtras
Sets the extras buffer on the message.- Parameters:
extras
- the extras buffer of the document.
-
getFramingExtras
ByteBuf getFramingExtras()Returns aByteBuf
representation of the optional framing extras.- Returns:
- the optional framing extras.
-
setFramingExtras
Sets the framing extras buffer on the message.- Parameters:
framingExtras
- the framing extras buffer of the document.
-
getFramingExtrasLength
byte getFramingExtrasLength()Return the framing extras length of the message. This may be 0, since the extras content is optional.- Returns:
- the framing extras length.
-
setFramingExtrasLength
Set the framing extras length of the message. This may be 0, since the extras content is optional.- Parameters:
framingExtrasLength
- the framing extras length.
-