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 Summary
Constructors Modifier Constructor Description UnicastHeader()
protected
UnicastHeader(byte type)
protected
UnicastHeader(byte type, long seqno)
protected
UnicastHeader(byte type, long seqno, short conn_id, boolean first)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description short
connId()
UnicastHeader
connId(short c)
UnicastHeader
copy()
java.util.function.Supplier<? extends Header>
create()
Creates an instance of the class implementing this interfacestatic UnicastHeader
createAckHeader(long seqno, short conn_id, int timestamp)
static UnicastHeader
createCloseHeader(short conn_id)
static UnicastHeader
createDataHeader(long seqno, short conn_id, boolean first)
static UnicastHeader
createSendFirstSeqnoHeader(int timestamp)
static UnicastHeader
createXmitReqHeader()
boolean
first()
short
getMagicId()
Returns the magic-ID.void
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedlong
seqno()
int
serializedSize()
Returns the size (in bytes) of the marshalled objectint
timestamp()
UnicastHeader
timestamp(int ts)
java.lang.String
toString()
byte
type()
static java.lang.String
type2Str(byte t)
void
writeTo(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:Header
Returns the magic-ID. If defined in jg-magic-map.xml, the IDs need to be the same- Specified by:
getMagicId
in classHeader
-
create
public java.util.function.Supplier<? extends Header> create()
Description copied from interface:Constructable
Creates an instance of the class implementing this interface
-
createDataHeader
public static UnicastHeader createDataHeader(long seqno, short conn_id, boolean first)
-
createAckHeader
public static UnicastHeader createAckHeader(long seqno, short conn_id, int timestamp)
-
createSendFirstSeqnoHeader
public static UnicastHeader createSendFirstSeqnoHeader(int timestamp)
-
createXmitReqHeader
public static UnicastHeader createXmitReqHeader()
-
createCloseHeader
public static UnicastHeader createCloseHeader(short conn_id)
-
type
public byte type()
-
seqno
public long seqno()
-
connId
public short connId()
-
connId
public UnicastHeader connId(short c)
-
first
public boolean first()
-
timestamp
public int timestamp()
-
timestamp
public UnicastHeader timestamp(int ts)
-
type2Str
public static java.lang.String type2Str(byte t)
-
serializedSize
public final int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object
-
copy
public UnicastHeader copy()
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
The 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.IOException
Description copied from interface:Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Throws:
java.io.IOException
-
-