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 ofUNICAST3
into separate class. Used to attach/remove headers (e.g. seqnos) fromUNICAST3
.- Since:
- 4.0
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Modifier Constructor Description UnicastHeader3()
protected
UnicastHeader3(byte type)
protected
UnicastHeader3(byte type, long seqno)
protected
UnicastHeader3(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()
UnicastHeader3
copy()
java.util.function.Supplier<? extends Header>
create()
Creates an instance of the class implementing this interfacestatic UnicastHeader3
createAckHeader(long seqno, short conn_id, int timestamp)
static UnicastHeader3
createCloseHeader(short conn_id)
static UnicastHeader3
createDataHeader(long seqno, short conn_id, boolean first)
static UnicastHeader3
createSendFirstSeqnoHeader(int timestamp)
static UnicastHeader3
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()
UnicastHeader3
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 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:SizeStreamable
Returns the size (in bytes) of the marshalled object
-
copy
public UnicastHeader3 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
-
-