@PrivateApi public final class Packet extends HeapData implements OutboundFrame
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_BIND |
static int |
FLAG_EVENT |
static int |
FLAG_OP |
static int |
FLAG_OP_CONTROL
A flag to indicate this is a special control packet for the operation system like invocation-heartbeats.
|
static int |
FLAG_RESPONSE |
static int |
FLAG_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.
|
short |
getFlags()
Returns the flags of the Packet.
|
int |
getPartitionId()
Returns the partition id of this packet.
|
int |
hashCode() |
boolean |
isFlagSet(int flag)
Checks if a flag is set.
|
boolean |
isUrgent()
Checks if this Frame is urgent.
|
int |
packetSize()
Returns an estimation of the packet, including its payload, in bytes.
|
boolean |
readFrom(ByteBuffer src) |
void |
reset() |
Packet |
setAllFlags(int flags)
Sets all flags at once.
|
void |
setConn(Connection conn)
Sets the Connection this Packet is send with.
|
Packet |
setFlag(int flag)
Sets a particular flag.
|
String |
toString() |
boolean |
writeTo(ByteBuffer dst) |
dataSize, getHeapCost, getPartitionHash, getType, hash64, hasPartitionHash, isPortable, toByteArray, totalSize
public static final byte VERSION
public static final int FLAG_OP
public static final int FLAG_RESPONSE
public static final int FLAG_EVENT
public static final int FLAG_URGENT
public static final int FLAG_BIND
public static final int FLAG_OP_CONTROL
public Packet()
public Packet(byte[] payload)
public Packet(byte[] payload, int partitionId)
public Connection getConn()
public void setConn(Connection conn)
conn
- the connection.public Packet setFlag(int flag)
flag
- the flag to setpublic Packet setAllFlags(int flags)
flags
- the flags.public boolean isFlagSet(int flag)
flag
- the flag to checkpublic short getFlags()
public int getPartitionId()
public void reset()
public boolean isUrgent()
OutboundFrame
isUrgent
in interface OutboundFrame
public boolean writeTo(ByteBuffer dst)
public boolean readFrom(ByteBuffer src)
public int packetSize()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.