@PrivateApi public final class Packet extends HeapData implements OutboundFrame
Modifier and Type | Class and Description |
---|---|
static class |
Packet.Type |
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_JET_FLOW_CONTROL
Marks a Jet packet as Flow control
|
static int |
FLAG_OP_CONTROL
Marks an Operation packet as Operation control (like invocation-heartbeats)
|
static int |
FLAG_OP_RESPONSE
Marks an Operation packet as Response
|
static int |
FLAG_URGENT
Marks the packet as Urgent
|
static byte |
VERSION |
DATA_OFFSET, HEAP_DATA_OVERHEAD, PARTITION_HASH_OFFSET, payload, TYPE_OFFSET
Constructor and Description |
---|
Packet() |
Packet(byte[] payload) |
Packet(byte[] payload,
int partitionId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Connection |
getConn()
Gets the Connection this Packet was send with.
|
char |
getFlags() |
int |
getFrameLength()
Returns the frame length.
|
Packet.Type |
getPacketType() |
int |
getPartitionId()
Returns the partition ID of this packet.
|
int |
hashCode() |
boolean |
isFlagRaised(int flagsToCheck)
Returns
true if any of the flags supplied in the argument are set. |
boolean |
isUrgent()
Checks if this Frame is urgent.
|
Packet |
raiseFlags(int flagsToRaise)
Raises all the flags raised in the argument.
|
Packet |
resetFlagsTo(int flagsToSet)
Resets the entire
flags bitfield to the supplied value. |
Packet |
setConn(Connection conn)
Sets the Connection this Packet is send with.
|
Packet |
setPacketType(Packet.Type type)
Sets the packet type by updating the packet type bits in the
flags bitfield. |
String |
toString() |
copyTo, dataSize, getHeapCost, getPartitionHash, getType, hash64, hasPartitionHash, isJson, isPortable, toByteArray, totalSize
public static final byte VERSION
public static final int FLAG_URGENT
public static final int FLAG_OP_RESPONSE
public static final int FLAG_OP_CONTROL
public static final int FLAG_JET_FLOW_CONTROL
public Packet()
public Packet(byte[] payload)
public Packet(byte[] payload, int partitionId)
public Connection getConn()
public Packet setConn(Connection conn)
conn
- the connection.this
(for fluent interface)public Packet.Type getPacketType()
public Packet setPacketType(Packet.Type type)
flags
bitfield. Other bits
are unaffected.type
- the type to setthis
(for fluent interface)public Packet raiseFlags(int flagsToRaise)
flagsToRaise
- the flags to raisethis
(for fluent interface)public Packet resetFlagsTo(int flagsToSet)
flags
bitfield to the supplied value. This also affects the packet type bits.flagsToSet
- the flags. Only the least significant two bytes of the argument are used.this
(for fluent interface)public boolean isFlagRaised(int flagsToCheck)
true
if any of the flags supplied in the argument are set.flagsToCheck
- the flags to checktrue
if any of the flags is set, false
otherwise.public char getFlags()
char
.public int getPartitionId()
public boolean isUrgent()
OutboundFrame
isUrgent
in interface OutboundFrame
public int getFrameLength()
OutboundFrame
getFrameLength
in interface OutboundFrame
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.