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
Modifier | Constructor and Description |
---|---|
protected |
ClientMessage() |
Modifier and Type | Method and Description |
---|---|
boolean |
acquiresResource() |
ClientMessage |
addFlag(short flags)
Sets the flags field value.
|
ClientMessage |
copy() |
static ClientMessage |
create() |
static ClientMessage |
createForDecode(ClientProtocolBuffer buffer,
int offset) |
static ClientMessage |
createForEncode(ClientProtocolBuffer buffer,
int offset) |
static ClientMessage |
createForEncode(int initialCapacity) |
boolean |
equals(Object o) |
Connection |
getConnection() |
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.
|
String |
getOperationName() |
int |
getPartitionId()
Returns the partition ID field.
|
short |
getVersion()
Returns the version field value.
|
int |
hashCode() |
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) |
void |
setAcquiresResource(boolean acquiresResource) |
void |
setConnection(Connection connection) |
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.
|
void |
setOperationName(String operationName) |
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, getInt, getLong, 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 Connection getConnection()
public void setConnection(Connection connection)
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()
getFrameLength
in interface OutboundFrame
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 boolean isRetryable()
public boolean acquiresResource()
public void setAcquiresResource(boolean acquiresResource)
public void setRetryable(boolean isRetryable)
public void setOperationName(String operationName)
public String getOperationName()
public static ClientMessage create()
public static ClientMessage createForEncode(int initialCapacity)
public static ClientMessage createForEncode(ClientProtocolBuffer buffer, int offset)
public static ClientMessage createForDecode(ClientProtocolBuffer buffer, int offset)
public ClientMessage copy()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.