|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.nio.serialization.DataAdapter com.hazelcast.nio.Packet
public final class Packet
A Packet is a piece of data send over the line.
Field Summary | |
---|---|
static int |
HEADER_BIND
|
static int |
HEADER_EVENT
|
static int |
HEADER_OP
|
static int |
HEADER_RESPONSE
|
static int |
HEADER_URGENT
|
static int |
HEADER_WAN_REPLICATION
|
static byte |
VERSION
|
Fields inherited from class com.hazelcast.nio.serialization.DataAdapter |
---|
context, data |
Constructor Summary | |
---|---|
Packet(Data value,
int partitionId,
PortableContext context)
|
|
Packet(Data value,
PortableContext context)
|
|
Packet(PortableContext context)
|
Method Summary | |
---|---|
Connection |
getConn()
Gets the Connection this Packet was send with. |
short |
getHeader()
Returns the header of the Packet. |
int |
getPartitionId()
Returns the partition id of this packet. |
boolean |
isHeaderSet(int bit)
|
boolean |
isUrgent()
Checks if this SocketWritable is urgent. |
boolean |
readFrom(ByteBuffer source)
|
void |
setConn(Connection conn)
Sets the Connection this Packet is send with. |
void |
setHeader(int bit)
|
int |
size()
Returns an estimation of the packet, including its payload, in bytes. |
String |
toString()
|
boolean |
writeTo(ByteBuffer destination)
Asks the SocketWritable to write its content to the destination ByteBuffer. |
Methods inherited from class com.hazelcast.nio.serialization.DataAdapter |
---|
done, getData, getDataSize, isStatusSet, reset, setData, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte VERSION
public static final int HEADER_OP
public static final int HEADER_RESPONSE
public static final int HEADER_EVENT
public static final int HEADER_WAN_REPLICATION
public static final int HEADER_URGENT
public static final int HEADER_BIND
Constructor Detail |
---|
public Packet(PortableContext context)
public Packet(Data value, PortableContext context)
public Packet(Data value, int partitionId, PortableContext context)
Method Detail |
---|
public Connection getConn()
public void setConn(Connection conn)
conn
- the connection.public void setHeader(int bit)
public boolean isHeaderSet(int bit)
public short getHeader()
public int getPartitionId()
public boolean isUrgent()
SocketWritable
isUrgent
in interface SocketWritable
isUrgent
in class DataAdapter
public boolean writeTo(ByteBuffer destination)
SocketWritable
writeTo
in interface SocketWritable
writeTo
in class DataAdapter
destination
- the ByteBuffer to write to.
public boolean readFrom(ByteBuffer source)
readFrom
in interface SocketReadable
readFrom
in class DataAdapter
public int size()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |