public class ClientMessage extends MessageFlyweight implements OutboundFrame
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 + | | +---------------------------------------------------------------+ | PartitionId | +-----------------------------+---------------------------------+ | Data Offset | | +-----------------------------+ | | Message Payload Data ... | ...
Modifier and Type | Field and Description |
---|---|
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
|
buffer
Constructor and Description |
---|
ClientMessage() |
Modifier and Type | Method and Description |
---|---|
ClientMessage |
addFlag(short flags)
Sets the flags field value.
|
static ClientMessage |
create() |
static ClientMessage |
createForDecode(ClientProtocolBuffer buffer,
int offset) |
static ClientMessage |
createForEncode(ClientProtocolBuffer buffer,
int offset) |
static ClientMessage |
createForEncode(int initialCapacity) |
static int |
findSuitableMessageSize(int desiredMessageSize) |
long |
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.
|
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 |
isRetryable() |
boolean |
isUrgent()
Checks if this Frame is urgent.
|
boolean |
readFrom(ByteBuffer src) |
ClientMessage |
setCorrelationId(long 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.
|
void |
setRetryable(boolean isRetryable) |
ClientMessage |
setVersion(short version)
Sets the version field value.
|
String |
toString() |
ClientMessage |
updateFrameLength() |
protected void |
wrapForDecode(ClientProtocolBuffer buffer,
int offset) |
protected void |
wrapForEncode(ClientProtocolBuffer buffer,
int offset) |
boolean |
writeTo(ByteBuffer dst) |
buffer, getBoolean, getByte, getByteArray, getData, getDataList, getDataSet, getInt, getLong, getMapEntry, getStringUtf8, index, index, int32Get, int32Set, int64Get, int64Set, set, set, set, set, set, set, set, set, set, uint16Get, uint16Put, uint32Get, uint32Put, uint8Get, uint8Put, wrap
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
public static ClientMessage create()
public static ClientMessage createForEncode(int initialCapacity)
public static int findSuitableMessageSize(int desiredMessageSize)
public static ClientMessage createForEncode(ClientProtocolBuffer buffer, int offset)
public static ClientMessage createForDecode(ClientProtocolBuffer buffer, int offset)
protected void wrapForEncode(ClientProtocolBuffer buffer, int offset)
protected void wrapForDecode(ClientProtocolBuffer buffer, int offset)
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 long getCorrelationId()
public ClientMessage setCorrelationId(long 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 updateFrameLength()
public boolean writeTo(ByteBuffer dst)
public boolean readFrom(ByteBuffer src)
public boolean isComplete()
public boolean isUrgent()
OutboundFrame
isUrgent
in interface OutboundFrame
public void setRetryable(boolean isRetryable)
public boolean isRetryable()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.