public abstract class AbstractBinaryMemcacheMessage extends AbstractMemcacheObject implements BinaryMemcacheMessage
Default implementation of a BinaryMemcacheMessage
.
Modifier | Constructor and Description |
---|---|
protected |
AbstractBinaryMemcacheMessage(byte[] key,
ByteBuf extras)
Create a new instance with all properties set.
|
Modifier and Type | Method and Description |
---|---|
long |
getCAS()
Returns the CAS identifier.
|
byte |
getDataType()
Returns the data type of the message.
|
ByteBuf |
getExtras()
Returns a
ByteBuf representation of the optional extras. |
byte |
getExtrasLength()
Return the 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.
|
int |
refCnt() |
boolean |
release() |
boolean |
release(int decrement) |
BinaryMemcacheMessage |
retain() |
BinaryMemcacheMessage |
retain(int increment) |
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 |
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 opcode)
Sets the opcode for the message.
|
BinaryMemcacheMessage |
setTotalBodyLength(int totalBodyLength)
Sets the total body length.
|
getDecoderResult, setDecoderResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDecoderResult, setDecoderResult
protected AbstractBinaryMemcacheMessage(byte[] key, ByteBuf extras)
Create a new instance with all properties set.
key
- the message key.extras
- the message extras.public byte[] getKey()
BinaryMemcacheMessage
Returns the optional key of the document.
getKey
in interface BinaryMemcacheMessage
public ByteBuf getExtras()
BinaryMemcacheMessage
Returns a ByteBuf
representation of the optional extras.
getExtras
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setKey(byte[] key)
BinaryMemcacheMessage
Sets the key of the document.
setKey
in interface BinaryMemcacheMessage
key
- the key of the message.public BinaryMemcacheMessage setExtras(ByteBuf extras)
BinaryMemcacheMessage
Sets the extras buffer on the message.
setExtras
in interface BinaryMemcacheMessage
extras
- the extras buffer of the document.public byte getMagic()
BinaryMemcacheMessage
Returns the magic byte for the message.
getMagic
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setMagic(byte magic)
BinaryMemcacheMessage
Sets the magic byte.
setMagic
in interface BinaryMemcacheMessage
magic
- the magic byte to use.for typesafe opcodes.
public long getCAS()
BinaryMemcacheMessage
Returns the CAS identifier.
getCAS
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setCAS(long cas)
BinaryMemcacheMessage
Sets the CAS identifier.
setCAS
in interface BinaryMemcacheMessage
cas
- the CAS identifier to use.public int getOpaque()
BinaryMemcacheMessage
Returns the opaque value.
getOpaque
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setOpaque(int opaque)
BinaryMemcacheMessage
Sets the opaque value.
setOpaque
in interface BinaryMemcacheMessage
opaque
- the opqaue value to use.public int getTotalBodyLength()
BinaryMemcacheMessage
Returns the total body length.
Note that this may be 0, since the body is optional.getTotalBodyLength
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setTotalBodyLength(int totalBodyLength)
BinaryMemcacheMessage
Sets the total body length.
Note that this may be 0, since the body length is optional.setTotalBodyLength
in interface BinaryMemcacheMessage
totalBodyLength
- the total body length.public byte getDataType()
BinaryMemcacheMessage
Returns the data type of the message.
getDataType
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setDataType(byte dataType)
BinaryMemcacheMessage
Sets the data type of the message.
setDataType
in interface BinaryMemcacheMessage
dataType
- the data type of the message.public byte getExtrasLength()
BinaryMemcacheMessage
Return the extras length of the message.
This may be 0, since the extras content is optional.getExtrasLength
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setExtrasLength(byte extrasLength)
BinaryMemcacheMessage
Set the extras length of the message.
This may be 0, since the extras content is optional.setExtrasLength
in interface BinaryMemcacheMessage
extrasLength
- the extras length.public short getKeyLength()
BinaryMemcacheMessage
Returns the key length of the message.
This may return 0, since the key is optional.getKeyLength
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setKeyLength(short keyLength)
BinaryMemcacheMessage
Set the key length of the message.
This may be 0, since the key is optional.setKeyLength
in interface BinaryMemcacheMessage
keyLength
- the key length to use.public byte getOpcode()
BinaryMemcacheMessage
Returns the opcode for the message.
getOpcode
in interface BinaryMemcacheMessage
public BinaryMemcacheMessage setOpcode(byte opcode)
BinaryMemcacheMessage
Sets the opcode for the message.
setOpcode
in interface BinaryMemcacheMessage
opcode
- the opcode to use.public int refCnt()
refCnt
in interface ReferenceCounted
public BinaryMemcacheMessage retain()
retain
in interface ReferenceCounted
public BinaryMemcacheMessage retain(int increment)
retain
in interface ReferenceCounted
public boolean release()
release
in interface ReferenceCounted
public boolean release(int decrement)
release
in interface ReferenceCounted
Copyright © 2016 Couchbase, Inc.. All rights reserved.