|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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
|
Constructor Summary | |
---|---|
Packet()
|
|
Packet(Data data)
|
|
Packet(Data data,
int partitionId)
|
Method Summary | |
---|---|
boolean |
done()
|
Connection |
getConn()
Gets the Connection this Packet was send with. |
Data |
getData()
|
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 |
reset()
|
void |
setConn(Connection conn)
Sets the Connection this Packet is send with. |
void |
setData(Data data)
|
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 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()
public Packet(Data data)
public Packet(Data data, int partitionId)
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
public boolean writeTo(ByteBuffer destination)
SocketWritable
writeTo
in interface SocketWritable
destination
- the ByteBuffer to write to.
public boolean readFrom(ByteBuffer source)
readFrom
in interface SocketReadable
public int size()
public Data getData()
public void setData(Data data)
public boolean done()
public void reset()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |