Package org.jgroups.protocols
Class UnicastHeader
- java.lang.Object
- 
- org.jgroups.Header
- 
- org.jgroups.protocols.UnicastHeader
 
 
- 
- All Implemented Interfaces:
- Constructable<Header>,- SizeStreamable,- Streamable
 
 public class UnicastHeader extends Header Header for subclasses ofReliableUnicast, e.g.UNICAST4.- Since:
- 5.4
- Author:
- Bela Ban
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description UnicastHeader()protectedUnicastHeader(byte type)protectedUnicastHeader(byte type, long seqno)protectedUnicastHeader(byte type, long seqno, short conn_id, boolean first)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description shortconnId()UnicastHeaderconnId(short c)UnicastHeadercopy()java.util.function.Supplier<? extends Header>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 UnicastHeadercreateXmitReqHeader()booleanfirst()shortgetMagicId()Returns the magic-ID.voidreadFrom(java.io.DataInput in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedlongseqno()intserializedSize()Returns the size (in bytes) of the marshalled objectinttimestamp()UnicastHeadertimestamp(int ts)java.lang.StringtoString()bytetype()static java.lang.Stringtype2Str(byte t)voidwriteTo(java.io.DataOutput out)The following types and fields are serialized:
 
- 
- 
- 
Field Detail- 
DATApublic static final byte DATA - See Also:
- Constant Field Values
 
 - 
ACKpublic static final byte ACK - See Also:
- Constant Field Values
 
 - 
SEND_FIRST_SEQNOpublic static final byte SEND_FIRST_SEQNO - See Also:
- Constant Field Values
 
 - 
XMIT_REQpublic static final byte XMIT_REQ - See Also:
- Constant Field Values
 
 - 
CLOSEpublic static final byte CLOSE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getMagicIdpublic 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 class- Header
 
 - 
createpublic java.util.function.Supplier<? extends Header> create() Description copied from interface:ConstructableCreates an instance of the class implementing this interface
 - 
createDataHeaderpublic static UnicastHeader createDataHeader(long seqno, short conn_id, boolean first) 
 - 
createAckHeaderpublic static UnicastHeader createAckHeader(long seqno, short conn_id, int timestamp) 
 - 
createSendFirstSeqnoHeaderpublic static UnicastHeader createSendFirstSeqnoHeader(int timestamp) 
 - 
createXmitReqHeaderpublic static UnicastHeader createXmitReqHeader() 
 - 
createCloseHeaderpublic static UnicastHeader createCloseHeader(short conn_id) 
 - 
typepublic byte type() 
 - 
seqnopublic long seqno() 
 - 
connIdpublic short connId() 
 - 
connIdpublic UnicastHeader connId(short c) 
 - 
firstpublic boolean first() 
 - 
timestamppublic int timestamp() 
 - 
timestamppublic UnicastHeader timestamp(int ts) 
 - 
type2Strpublic static java.lang.String type2Str(byte t) 
 - 
serializedSizepublic final int serializedSize() Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object
 - 
copypublic UnicastHeader copy() 
 - 
writeTopublic void writeTo(java.io.DataOutput out) throws java.io.IOExceptionThe following types and fields are serialized:| DATA | seqno | conn_id | first | | ACK | seqno | timestamp | | SEND_FIRST_SEQNO | timestamp | | CLOSE | conn_id | - Throws:
- java.io.IOException
 
 - 
readFrompublic void readFrom(java.io.DataInput in) throws java.io.IOExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Throws:
- java.io.IOException
 
 
- 
 
-