Class UnicastHeader
java.lang.Object
org.jgroups.Header
org.jgroups.protocols.UnicastHeader
- All Implemented Interfaces:
Constructable<Header>, SizeStreamable, Streamable
Header for subclasses of
ReliableUnicast, e.g. UNICAST4.- Since:
- 5.4
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnicastHeader(byte type) protectedUnicastHeader(byte type, long seqno) protectedUnicastHeader(byte type, long seqno, short conn_id, boolean first) -
Method Summary
Modifier and TypeMethodDescriptionshortconnId()connId(short c) copy()create()Creates an instance of the class implementing this interfacestatic UnicastHeadercreateAckHeader(long seqno, short conn_id, int timestamp) static UnicastHeadercreateCloseHeader(short conn_id) static UnicastHeadercreateDataHeader(long seqno, short conn_id, boolean first) static UnicastHeadercreateSendFirstSeqnoHeader(int timestamp) static UnicastHeaderbooleanfirst()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:
-
-
Constructor Details
-
UnicastHeader
public UnicastHeader() -
UnicastHeader
protected UnicastHeader(byte type) -
UnicastHeader
protected UnicastHeader(byte type, long seqno) -
UnicastHeader
protected UnicastHeader(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- Returns:
- Supplier
-
createDataHeader
-
createAckHeader
-
createSendFirstSeqnoHeader
-
createXmitReqHeader
-
createCloseHeader
-
type
public byte type() -
seqno
public long seqno() -
connId
public short connId() -
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
-