Package org.jgroups.protocols
Class UnicastHeader3
- java.lang.Object
-
- org.jgroups.Header
-
- org.jgroups.protocols.UnicastHeader3
-
- All Implemented Interfaces:
Constructable<Header>,SizeStreamable,Streamable
public class UnicastHeader3 extends Header
Moved out ofUNICAST3into separate class. Used to attach/remove headers (e.g. seqnos) fromUNICAST3.- Since:
- 4.0
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Modifier Constructor Description UnicastHeader3()protectedUnicastHeader3(byte type)protectedUnicastHeader3(byte type, long seqno)protectedUnicastHeader3(byte type, long seqno, short conn_id, boolean first)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description shortconnId()UnicastHeader3copy()java.util.function.Supplier<? extends Header>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 UnicastHeader3createXmitReqHeader()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()UnicastHeader3timestamp(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
-
DATA
public static final byte DATA
- See Also:
- Constant Field Values
-
ACK
public static final byte ACK
- See Also:
- Constant Field Values
-
SEND_FIRST_SEQNO
public static final byte SEND_FIRST_SEQNO
- See Also:
- Constant Field Values
-
XMIT_REQ
public static final byte XMIT_REQ
- See Also:
- Constant Field Values
-
CLOSE
public static final byte CLOSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public java.util.function.Supplier<? extends Header> create()
Description copied from interface:ConstructableCreates an instance of the class implementing this interface
-
createDataHeader
public static UnicastHeader3 createDataHeader(long seqno, short conn_id, boolean first)
-
createAckHeader
public static UnicastHeader3 createAckHeader(long seqno, short conn_id, int timestamp)
-
createSendFirstSeqnoHeader
public static UnicastHeader3 createSendFirstSeqnoHeader(int timestamp)
-
createXmitReqHeader
public static UnicastHeader3 createXmitReqHeader()
-
createCloseHeader
public static UnicastHeader3 createCloseHeader(short conn_id)
-
type
public byte type()
-
seqno
public long seqno()
-
connId
public short connId()
-
first
public boolean first()
-
timestamp
public int timestamp()
-
timestamp
public UnicastHeader3 timestamp(int ts)
-
type2Str
public static java.lang.String type2Str(byte t)
-
serializedSize
public final int serializedSize()
Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object
-
copy
public UnicastHeader3 copy()
-
writeTo
public 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
-
readFrom
public 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
-
-