Interface BinaryMemcacheMessage
-
- All Superinterfaces:
DecoderResultProvider
,MemcacheMessage
,MemcacheObject
,ReferenceCounted
- All Known Subinterfaces:
BinaryMemcacheRequest
,BinaryMemcacheResponse
,FullBinaryMemcacheRequest
,FullBinaryMemcacheResponse
- All Known Implementing Classes:
AbstractBinaryMemcacheMessage
,DefaultBinaryMemcacheRequest
,DefaultBinaryMemcacheResponse
,DefaultFullBinaryMemcacheRequest
,DefaultFullBinaryMemcacheResponse
@UnstableApi public interface BinaryMemcacheMessage extends MemcacheMessage
An interface that defines a binary Memcache message, providing common properties forBinaryMemcacheRequest
andBinaryMemcacheResponse
. ABinaryMemcacheMessage
always consists of a header and optional extras or/and a key.- See Also:
BinaryMemcacheRequest
,BinaryMemcacheResponse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
cas()
Returns the CAS identifier.byte
dataType()
Returns the data type of the message.ByteBuf
extras()
Returns aByteBuf
representation of the optional extras.byte
extrasLength()
Return the extras length of the message.ByteBuf
key()
Returns the optional key of the document.short
keyLength()
Returns the key length of the message.byte
magic()
Returns the magic byte for the message.int
opaque()
Returns the opaque value.byte
opcode()
Returns the opcode for the message.BinaryMemcacheMessage
retain()
Increases the reference count by1
.BinaryMemcacheMessage
retain(int increment)
Increases the reference count by the specifiedincrement
.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
setKey(ByteBuf key)
Sets the key of the document.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.int
totalBodyLength()
Returns the total body length.BinaryMemcacheMessage
touch()
Records the current access location of this object for debugging purposes.BinaryMemcacheMessage
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
-
-
-
Method Detail
-
magic
byte magic()
Returns the magic byte for the message.- Returns:
- the magic byte.
-
setMagic
BinaryMemcacheMessage setMagic(byte magic)
Sets the magic byte.- Parameters:
magic
- the magic byte to use.- See Also:
for typesafe opcodes.
-
opcode
byte opcode()
Returns the opcode for the message.- Returns:
- the opcode.
-
setOpcode
BinaryMemcacheMessage setOpcode(byte code)
Sets the opcode for the message.- Parameters:
code
- the opcode to use.
-
keyLength
short keyLength()
Returns the key length of the message. This may return 0, since the key is optional.- Returns:
- the key length.
-
extrasLength
byte extrasLength()
Return the extras length of the message. This may be 0, since the extras content is optional.- Returns:
- the extras length.
-
dataType
byte dataType()
Returns the data type of the message.- Returns:
- the data type of the message.
-
setDataType
BinaryMemcacheMessage setDataType(byte dataType)
Sets the data type of the message.- Parameters:
dataType
- the data type of the message.
-
totalBodyLength
int totalBodyLength()
Returns the total body length. Note that this may be 0, since the body is optional.- Returns:
- the total body length.
-
setTotalBodyLength
BinaryMemcacheMessage setTotalBodyLength(int totalBodyLength)
Sets the total body length. Note that this may be 0, since the body length is optional.- Parameters:
totalBodyLength
- the total body length.
-
opaque
int opaque()
Returns the opaque value.- Returns:
- the opaque value.
-
setOpaque
BinaryMemcacheMessage setOpaque(int opaque)
Sets the opaque value.- Parameters:
opaque
- the opaque value to use.
-
cas
long cas()
Returns the CAS identifier.- Returns:
- the CAS identifier.
-
setCas
BinaryMemcacheMessage setCas(long cas)
Sets the CAS identifier.- Parameters:
cas
- the CAS identifier to use.
-
key
ByteBuf key()
Returns the optional key of the document.- Returns:
- the key of the document.
-
setKey
BinaryMemcacheMessage setKey(ByteBuf key)
Sets the key of the document.ReferenceCounted.release()
ownership ofkey
is transferred to thisBinaryMemcacheMessage
.- Parameters:
key
- the key of the message.ReferenceCounted.release()
ownership is transferred to thisBinaryMemcacheMessage
.
-
extras
ByteBuf extras()
Returns aByteBuf
representation of the optional extras.- Returns:
- the optional extras.
-
setExtras
BinaryMemcacheMessage setExtras(ByteBuf extras)
Sets the extras buffer on the message.ReferenceCounted.release()
ownership ofextras
is transferred to thisBinaryMemcacheMessage
.- Parameters:
extras
- the extras buffer of the document.ReferenceCounted.release()
ownership is transferred to thisBinaryMemcacheMessage
.
-
retain
BinaryMemcacheMessage retain()
Increases the reference count by1
.- Specified by:
retain
in interfaceMemcacheMessage
- Specified by:
retain
in interfaceReferenceCounted
-
retain
BinaryMemcacheMessage retain(int increment)
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceMemcacheMessage
- Specified by:
retain
in interfaceReferenceCounted
-
touch
BinaryMemcacheMessage touch()
Description copied from interface:ReferenceCounted
Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
. This method is a shortcut totouch(null)
.- Specified by:
touch
in interfaceMemcacheMessage
- Specified by:
touch
in interfaceReferenceCounted
-
touch
BinaryMemcacheMessage touch(java.lang.Object hint)
Description copied from interface:ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
.- Specified by:
touch
in interfaceMemcacheMessage
- Specified by:
touch
in interfaceReferenceCounted
-
-