Package net.spy.memcached.tapmessage
Class ResponseMessage
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.tapmessage.BaseMessage
-
- net.spy.memcached.tapmessage.ResponseMessage
-
public class ResponseMessage extends BaseMessage
A representation of a tap stream message sent from a tap stream server.
-
-
Field Summary
Fields Modifier and Type Field Description private long
checkpoint
private static int
ENGINE_PRIVATE_OFFSET
private short
engineprivate
private java.util.List<TapResponseFlag>
flags
private static int
FLAGS_OFFSET
private static int
ITEM_EXPIRY_OFFSET
private static int
ITEM_FLAGS_OFFSET
private int
itemexpiry
private int
itemflags
private byte[]
key
private static int
KEY_OFFSET
private byte
reserved1
private static int
RESERVED1_OFFSET
private byte
reserved2
private static int
RESERVED2_OFFSET
private byte
reserved3
private static int
RESERVED3_OFFSET
private byte[]
revid
private byte
ttl
private static int
TTL_OFFSET
private byte[]
value
private int
vbucketstate
-
Fields inherited from class net.spy.memcached.tapmessage.BaseMessage
cas, datatype, extralength, HEADER_LENGTH, keylength, magic, opaque, opcode, totalbody, vbucket
-
-
Constructor Summary
Constructors Constructor Description ResponseMessage(byte[] b)
Creates a ResponseMessage from binary data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Object
deserialize()
Attempt to get the object represented by the given serialized bytes.java.nio.ByteBuffer
getBytes()
Creates a ByteBuffer representation of the message.long
getCheckpoint()
Gets the checkpoint of the vbucket.long
getEnginePrivate()
Gets the value of the engine private field.java.util.List<TapResponseFlag>
getFlags()
Gets the value of the flags field.long
getItemExpiry()
Gets the value of the item expiry field.int
getItemFlags()
Gets the value of the items flag field.java.lang.String
getKey()
Gets the value of the key field.protected int
getReserved1()
Gets the value of the reserved1 field.protected int
getReserved2()
Gets the value of the reserved2 field.protected int
getReserved3()
Gets the value of the reserved3 field.byte[]
getRevID()
Gets the value of the revid field.int
getTTL()
Gets the value of the time to live field.byte[]
getValue()
Gets the value of the value field.int
getVBucketState()
Gets the state of the vbucket.java.lang.String
toString()
-
Methods inherited from class net.spy.memcached.tapmessage.BaseMessage
decodeInt, decodeIntHostOrder, decodeLong, decodeShort, getCas, getDatatype, getExtralength, getKeylength, getMagic, getMessageLength, getOpaque, getOpcode, getTotalbody, getVbucket, setCas, setDatatype, setExtralength, setMagic, setOpaque, setOpcode, setTotalbody, setVbucket
-
-
-
-
Field Detail
-
ENGINE_PRIVATE_OFFSET
private static final int ENGINE_PRIVATE_OFFSET
- See Also:
- Constant Field Values
-
FLAGS_OFFSET
private static final int FLAGS_OFFSET
- See Also:
- Constant Field Values
-
TTL_OFFSET
private static final int TTL_OFFSET
- See Also:
- Constant Field Values
-
RESERVED1_OFFSET
private static final int RESERVED1_OFFSET
- See Also:
- Constant Field Values
-
RESERVED2_OFFSET
private static final int RESERVED2_OFFSET
- See Also:
- Constant Field Values
-
RESERVED3_OFFSET
private static final int RESERVED3_OFFSET
- See Also:
- Constant Field Values
-
ITEM_FLAGS_OFFSET
private static final int ITEM_FLAGS_OFFSET
- See Also:
- Constant Field Values
-
ITEM_EXPIRY_OFFSET
private static final int ITEM_EXPIRY_OFFSET
- See Also:
- Constant Field Values
-
KEY_OFFSET
private static final int KEY_OFFSET
- See Also:
- Constant Field Values
-
engineprivate
private final short engineprivate
-
flags
private final java.util.List<TapResponseFlag> flags
-
ttl
private final byte ttl
-
reserved1
private final byte reserved1
-
reserved2
private final byte reserved2
-
reserved3
private final byte reserved3
-
itemflags
private final int itemflags
-
itemexpiry
private int itemexpiry
-
vbucketstate
private final int vbucketstate
-
checkpoint
private final long checkpoint
-
key
private final byte[] key
-
value
private final byte[] value
-
revid
private final byte[] revid
-
-
Method Detail
-
getEnginePrivate
public long getEnginePrivate()
Gets the value of the engine private field. Not returned in a no-op message.- Returns:
- The engine private data.
-
getFlags
public java.util.List<TapResponseFlag> getFlags()
Gets the value of the flags field. Not returned in a no-op message.- Returns:
- The flags data.
-
getTTL
public int getTTL()
Gets the value of the time to live field. Not returned in a no-op message.- Returns:
- The time to live value;
-
getReserved1
protected int getReserved1()
Gets the value of the reserved1 field. Not returned in a no-op message.- Returns:
- The reserved1 data.
-
getReserved2
protected int getReserved2()
Gets the value of the reserved2 field. Not returned in a no-op message.- Returns:
- The reserved2 data.
-
getReserved3
protected int getReserved3()
Gets the value of the reserved3 field. Not returned in a no-op message.- Returns:
- The reserved3 data.
-
getVBucketState
public int getVBucketState()
Gets the state of the vbucket. Only returned with a tap vbucket state message.- Returns:
- the vbucket state
-
getCheckpoint
public long getCheckpoint()
Gets the checkpoint of the vbucket. Only returned with a start/end checkpoint message.- Returns:
- the checkpoint
-
getItemFlags
public int getItemFlags()
Gets the value of the items flag field. Only returned with a tap mutation message.- Returns:
- The items flag data.
-
getItemExpiry
public long getItemExpiry()
Gets the value of the item expiry field. Only returned with a tap mutation message.- Returns:
- The item expiry data.
-
getKey
public java.lang.String getKey()
Gets the value of the key field. Only returned with a tap mutation or tap delete message.- Returns:
- The key data.
-
getValue
public byte[] getValue()
Gets the value of the value field. Only returned with a tap mutation message.- Returns:
- The value data.
-
getRevID
public byte[] getRevID()
Gets the value of the revid field. Only returned with a tap mutation message.- Returns:
- The revid of the document.
-
getBytes
public java.nio.ByteBuffer getBytes()
Description copied from class:BaseMessage
Creates a ByteBuffer representation of the message.- Specified by:
getBytes
in classBaseMessage
- Returns:
- The ByteBuffer representation of the message.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
deserialize
private java.lang.Object deserialize()
Attempt to get the object represented by the given serialized bytes.
-
-