Class AbstractBinaryMemcacheMessage
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.netty.handler.codec.memcache.AbstractMemcacheObject
io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheMessage
- All Implemented Interfaces:
DecoderResultProvider
,BinaryMemcacheMessage
,MemcacheMessage
,MemcacheObject
,ReferenceCounted
- Direct Known Subclasses:
DefaultBinaryMemcacheRequest
,DefaultBinaryMemcacheResponse
@UnstableApi
public abstract class AbstractBinaryMemcacheMessage
extends AbstractMemcacheObject
implements BinaryMemcacheMessage
Default implementation of a
BinaryMemcacheMessage
.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBinaryMemcacheMessage
(ByteBuf key, ByteBuf extras) Create a new instance with all properties set. -
Method Summary
Modifier and TypeMethodDescriptionlong
cas()
Returns the CAS identifier.(package private) void
Copies special metadata hold by this instance to the provided instancebyte
dataType()
Returns the data type of the message.protected void
Called onceAbstractReferenceCounted.refCnt()
is equals 0.extras()
Returns aByteBuf
representation of the optional extras.byte
Return the extras length of the message.key()
Returns the optional key of the document.short
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.retain()
Increases the reference count by1
.retain
(int increment) Increases the reference count by the specifiedincrement
.setCas
(long cas) Sets the CAS identifier.setDataType
(byte dataType) Sets the data type of the message.Sets the extras buffer on the message.(package private) BinaryMemcacheMessage
setExtrasLength
(byte extrasLength) Set the extras length of the message.Sets the key of the document.(package private) BinaryMemcacheMessage
setKeyLength
(short keyLength) Set the key length of the message.setMagic
(byte magic) Sets the magic byte.setOpaque
(int opaque) Sets the opaque value.setOpcode
(byte opcode) Sets the opcode for the message.setTotalBodyLength
(int totalBodyLength) Sets the total body length.int
Returns the total body length.touch()
Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class io.netty.handler.codec.memcache.AbstractMemcacheObject
decoderResult, setDecoderResult
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, release, release, setRefCnt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
Field Details
-
key
Contains the optional key. -
extras
Contains the optional extras. -
magic
private byte magic -
opcode
private byte opcode -
keyLength
private short keyLength -
extrasLength
private byte extrasLength -
dataType
private byte dataType -
totalBodyLength
private int totalBodyLength -
opaque
private int opaque -
cas
private long cas
-
-
Constructor Details
-
AbstractBinaryMemcacheMessage
Create a new instance with all properties set.- Parameters:
key
- the message key.extras
- the message extras.
-
-
Method Details
-
key
Description copied from interface:BinaryMemcacheMessage
Returns the optional key of the document.- Specified by:
key
in interfaceBinaryMemcacheMessage
- Returns:
- the key of the document.
-
extras
Description copied from interface:BinaryMemcacheMessage
Returns aByteBuf
representation of the optional extras.- Specified by:
extras
in interfaceBinaryMemcacheMessage
- Returns:
- the optional extras.
-
setKey
Description copied from interface:BinaryMemcacheMessage
Sets the key of the document.ReferenceCounted.release()
ownership ofkey
is transferred to thisBinaryMemcacheMessage
.- Specified by:
setKey
in interfaceBinaryMemcacheMessage
- Parameters:
key
- the key of the message.ReferenceCounted.release()
ownership is transferred to thisBinaryMemcacheMessage
.
-
setExtras
Description copied from interface:BinaryMemcacheMessage
Sets the extras buffer on the message.ReferenceCounted.release()
ownership ofextras
is transferred to thisBinaryMemcacheMessage
.- Specified by:
setExtras
in interfaceBinaryMemcacheMessage
- Parameters:
extras
- the extras buffer of the document.ReferenceCounted.release()
ownership is transferred to thisBinaryMemcacheMessage
.
-
magic
public byte magic()Description copied from interface:BinaryMemcacheMessage
Returns the magic byte for the message.- Specified by:
magic
in interfaceBinaryMemcacheMessage
- Returns:
- the magic byte.
-
setMagic
Description copied from interface:BinaryMemcacheMessage
Sets the magic byte.- Specified by:
setMagic
in interfaceBinaryMemcacheMessage
- Parameters:
magic
- the magic byte to use.- See Also:
-
cas
public long cas()Description copied from interface:BinaryMemcacheMessage
Returns the CAS identifier.- Specified by:
cas
in interfaceBinaryMemcacheMessage
- Returns:
- the CAS identifier.
-
setCas
Description copied from interface:BinaryMemcacheMessage
Sets the CAS identifier.- Specified by:
setCas
in interfaceBinaryMemcacheMessage
- Parameters:
cas
- the CAS identifier to use.
-
opaque
public int opaque()Description copied from interface:BinaryMemcacheMessage
Returns the opaque value.- Specified by:
opaque
in interfaceBinaryMemcacheMessage
- Returns:
- the opaque value.
-
setOpaque
Description copied from interface:BinaryMemcacheMessage
Sets the opaque value.- Specified by:
setOpaque
in interfaceBinaryMemcacheMessage
- Parameters:
opaque
- the opaque value to use.
-
totalBodyLength
public int totalBodyLength()Description copied from interface:BinaryMemcacheMessage
Returns the total body length. Note that this may be 0, since the body is optional.- Specified by:
totalBodyLength
in interfaceBinaryMemcacheMessage
- Returns:
- the total body length.
-
setTotalBodyLength
Description copied from interface:BinaryMemcacheMessage
Sets the total body length. Note that this may be 0, since the body length is optional.- Specified by:
setTotalBodyLength
in interfaceBinaryMemcacheMessage
- Parameters:
totalBodyLength
- the total body length.
-
dataType
public byte dataType()Description copied from interface:BinaryMemcacheMessage
Returns the data type of the message.- Specified by:
dataType
in interfaceBinaryMemcacheMessage
- Returns:
- the data type of the message.
-
setDataType
Description copied from interface:BinaryMemcacheMessage
Sets the data type of the message.- Specified by:
setDataType
in interfaceBinaryMemcacheMessage
- Parameters:
dataType
- the data type of the message.
-
extrasLength
public byte extrasLength()Description copied from interface:BinaryMemcacheMessage
Return the extras length of the message. This may be 0, since the extras content is optional.- Specified by:
extrasLength
in interfaceBinaryMemcacheMessage
- 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.
-
keyLength
public short keyLength()Description copied from interface:BinaryMemcacheMessage
Returns the key length of the message. This may return 0, since the key is optional.- Specified by:
keyLength
in interfaceBinaryMemcacheMessage
- 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.
-
opcode
public byte opcode()Description copied from interface:BinaryMemcacheMessage
Returns the opcode for the message.- Specified by:
opcode
in interfaceBinaryMemcacheMessage
- Returns:
- the opcode.
-
setOpcode
Description copied from interface:BinaryMemcacheMessage
Sets the opcode for the message.- Specified by:
setOpcode
in interfaceBinaryMemcacheMessage
- Parameters:
opcode
- the opcode to use.
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceBinaryMemcacheMessage
- Specified by:
retain
in interfaceMemcacheMessage
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classAbstractReferenceCounted
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceBinaryMemcacheMessage
- Specified by:
retain
in interfaceMemcacheMessage
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classAbstractReferenceCounted
-
deallocate
protected void deallocate()Description copied from class:AbstractReferenceCounted
Called onceAbstractReferenceCounted.refCnt()
is equals 0.- Specified by:
deallocate
in classAbstractReferenceCounted
-
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 interfaceBinaryMemcacheMessage
- Specified by:
touch
in interfaceMemcacheMessage
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classAbstractReferenceCounted
-
touch
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 interfaceBinaryMemcacheMessage
- Specified by:
touch
in interfaceMemcacheMessage
- Specified by:
touch
in interfaceReferenceCounted
-
copyMeta
Copies special metadata hold by this instance to the provided instance- Parameters:
dst
- The instance where to copy the metadata of this instance to
-