|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.client.impl.protocol.util.Flyweight
com.hazelcast.client.impl.protocol.util.ParameterFlyweight
com.hazelcast.client.impl.protocol.ClientMessage
public class ClientMessage
Client Message is the carrier framed data as defined below.
Any request parameter, response or event data will be carried in the payload.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R| Frame Length | +-------------+---------------+---------------------------------+ | Version |B|E| Flags | Type | +-------------+---------------+---------------------------------+ | CorrelationId | +---------------------------------------------------------------+ |R| PartitionId | +-----------------------------+---------------------------------+ | Data Offset | | +-----------------------------+ | | Message Payload Data ... | ...
Field Summary | |
---|---|
static short |
BEGIN_AND_END_FLAGS
Begin and End Flags |
static short |
BEGIN_FLAG
Begin Flag |
static short |
END_FLAG
End Flag |
static int |
HEADER_SIZE
ClientMessage Fixed Header size in bytes |
static short |
LISTENER_EVENT_FLAG
Listener Event Flag |
static short |
VERSION
Current protocol version |
Fields inherited from class com.hazelcast.client.impl.protocol.util.Flyweight |
---|
buffer, INITIAL_BUFFER_CAPACITY |
Constructor Summary | |
---|---|
ClientMessage()
|
|
ClientMessage(boolean encode,
byte[] buffer,
int offset,
int length)
|
|
ClientMessage(boolean encode,
MutableDirectBuffer buffer,
int offset)
|
Method Summary | |
---|---|
ClientMessage |
addFlag(short flags)
Sets the flags field value. |
static ClientMessage |
create()
|
static ClientMessage |
createForDecode(byte[] buffer,
int offset,
int length)
|
static ClientMessage |
createForDecode(int initialCapacity)
|
static ClientMessage |
createForDecode(MutableDirectBuffer buffer,
int offset)
|
static ClientMessage |
createForEncode(byte[] buffer,
int offset,
int length)
|
static ClientMessage |
createForEncode(int initialCapacity)
|
int |
getCorrelationId()
Returns the correlation id field. |
int |
getDataOffset()
Returns the setDataOffset field. |
short |
getFlags()
Returns the flags field value. |
int |
getFrameLength()
Returns the frame length field. |
int |
getMessageType()
Returns the message type field. |
int |
getPartitionId()
Returns the partition id field. |
ClientMessage |
getPayloadData(byte[] payload)
Reads from the ClientMessage payload data region and writes into the payload array. |
short |
getVersion()
Returns the version field value. |
boolean |
isComplete()
Checks the frame size and total data size to validate the message size. |
boolean |
isFlagSet(short flag)
|
boolean |
isUrgent()
Checks if this SocketWritable is urgent. |
ClientMessage |
putPayloadData(byte[] payload)
Copy data into the payload data region located at data Offset. |
boolean |
readFrom(ByteBuffer source)
|
ClientMessage |
setCorrelationId(int correlationId)
Sets the correlation id field. |
ClientMessage |
setDataOffset(int dataOffset)
Sets the dataOffset field. |
ClientMessage |
setFrameLength(int length)
Sets the frame length field. |
ClientMessage |
setMessageType(int type)
Sets the message type field. |
ClientMessage |
setPartitionId(int partitionId)
Sets the partition id field. |
ClientMessage |
setVersion(short version)
Sets the version field value. |
String |
toString()
|
ClientMessage |
updateFrameLength()
|
void |
wrapForDecode(byte[] buffer,
int offset,
int length)
|
void |
wrapForEncode(byte[] buffer,
int offset,
int length)
|
boolean |
writeTo(ByteBuffer destination)
Asks the SocketWritable to write its content to the destination ByteBuffer. |
Methods inherited from class com.hazelcast.client.impl.protocol.util.ParameterFlyweight |
---|
getBoolean, getByte, getByteArray, getData, getDataList, getDataSet, getDouble, getFloat, getInt, getLong, getShort, getStringUtf8, index, index, set, set, set, set, set, set, set, set, set, set, set, wrap, wrap |
Methods inherited from class com.hazelcast.client.impl.protocol.util.Flyweight |
---|
buffer, ensureCapacity, offset, offset, uint16Get, uint16Put, uint32Get, uint32Put, uint8Get, uint8Put, wrap, wrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short VERSION
public static final short BEGIN_FLAG
public static final short END_FLAG
public static final short BEGIN_AND_END_FLAGS
public static final short LISTENER_EVENT_FLAG
public static final int HEADER_SIZE
Constructor Detail |
---|
public ClientMessage()
public ClientMessage(boolean encode, byte[] buffer, int offset, int length)
public ClientMessage(boolean encode, MutableDirectBuffer buffer, int offset)
Method Detail |
---|
public static ClientMessage create()
public static ClientMessage createForEncode(int initialCapacity)
public static ClientMessage createForDecode(int initialCapacity)
public static ClientMessage createForEncode(byte[] buffer, int offset, int length)
public static ClientMessage createForDecode(byte[] buffer, int offset, int length)
public static ClientMessage createForDecode(MutableDirectBuffer buffer, int offset)
public void wrapForEncode(byte[] buffer, int offset, int length)
public void wrapForDecode(byte[] buffer, int offset, int length)
public short getVersion()
public ClientMessage setVersion(short version)
version
- The value to set in the version field.
public boolean isFlagSet(short flag)
flag
- Check this flag to see if it is set.
public short getFlags()
public ClientMessage addFlag(short flags)
flags
- The value to set in the flags field.
public int getMessageType()
public ClientMessage setMessageType(int type)
type
- The value to set in the message type field.
public int getFrameLength()
public ClientMessage setFrameLength(int length)
length
- The value to set in the frame length field.
public int getCorrelationId()
public ClientMessage setCorrelationId(int correlationId)
correlationId
- The value to set in the correlation id field.
public int getPartitionId()
public ClientMessage setPartitionId(int partitionId)
partitionId
- The value to set in the partitions id field.
public int getDataOffset()
public ClientMessage setDataOffset(int dataOffset)
dataOffset
- The value to set in the dataOffset field.
public ClientMessage putPayloadData(byte[] payload)
payload
- The data being copied into the ClientMessage payload data region.
public ClientMessage getPayloadData(byte[] payload)
payload
- The payload array into which the payload data region in the ClientMessage will be copied.
public ClientMessage updateFrameLength()
public boolean writeTo(ByteBuffer destination)
SocketWritable
writeTo
in interface SocketWritable
destination
- the ByteBuffer to write to.
public boolean readFrom(ByteBuffer source)
readFrom
in interface SocketReadable
public boolean isComplete()
public boolean isUrgent()
SocketWritable
isUrgent
in interface SocketWritable
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |