Package org.jgroups.protocols
Class UnicastHeader3
java.lang.Object
org.jgroups.Header
org.jgroups.protocols.UnicastHeader3
- All Implemented Interfaces:
Constructable<Header>,SizeStreamable,Streamable
Moved out of
UNICAST3 into separate class. Used to attach/remove headers (e.g. seqnos) from UNICAST3.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final byte(package private) shortstatic final byte(package private) booleanstatic final byte(package private) long(package private) int(package private) bytestatic final byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnicastHeader3(byte type) protectedUnicastHeader3(byte type, long seqno) protectedUnicastHeader3(byte type, long seqno, short conn_id, boolean first) -
Method Summary
Modifier and TypeMethodDescriptionshortconnId()copy()create()Creates an instance of the class implementing this interfacestatic UnicastHeader3createAckHeader(long seqno, short conn_id, int timestamp) static UnicastHeader3createCloseHeader(short conn_id) static UnicastHeader3createDataHeader(long seqno, short conn_id, boolean first) static UnicastHeader3createSendFirstSeqnoHeader(int timestamp) static UnicastHeader3booleanfirst()shortReturns the magic-ID.voidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedlongseqno()final intReturns the size (in bytes) of the marshalled objectinttimestamp(int ts) toString()bytetype()static Stringtype2Str(byte t) voidwriteTo(DataOutput out) The following types and fields are serialized:
-
Field Details
-
DATA
public static final byte DATA- See Also:
-
ACK
public static final byte ACK- See Also:
-
SEND_FIRST_SEQNO
public static final byte SEND_FIRST_SEQNO- See Also:
-
XMIT_REQ
public static final byte XMIT_REQ- See Also:
-
CLOSE
public static final byte CLOSE- See Also:
-
type
byte type -
seqno
long seqno -
conn_id
short conn_id -
first
boolean first -
timestamp
int timestamp
-
-
Constructor Details
-
UnicastHeader3
public UnicastHeader3() -
UnicastHeader3
protected UnicastHeader3(byte type) -
UnicastHeader3
protected UnicastHeader3(byte type, long seqno) -
UnicastHeader3
protected UnicastHeader3(byte type, long seqno, short conn_id, boolean first)
-
-
Method Details
-
getMagicId
public short getMagicId()Description copied from class:HeaderReturns the magic-ID. If defined in jg-magic-map.xml, the IDs need to be the same- Specified by:
getMagicIdin classHeader
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface -
createDataHeader
-
createAckHeader
-
createSendFirstSeqnoHeader
-
createXmitReqHeader
-
createCloseHeader
-
type
public byte type() -
seqno
public long seqno() -
connId
public short connId() -
first
public boolean first() -
timestamp
public int timestamp() -
timestamp
-
toString
-
type2Str
-
serializedSize
public final int serializedSize()Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object -
copy
-
writeTo
The following types and fields are serialized:| DATA | seqno | conn_id | first | | ACK | seqno | timestamp | | SEND_FIRST_SEQNO | timestamp | | CLOSE | conn_id |
- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Throws:
IOException
-