Package org.jgroups.protocols.tom
Class ToaHeader
- java.lang.Object
-
- org.jgroups.Header
-
- org.jgroups.protocols.tom.ToaHeader
-
- All Implemented Interfaces:
Constructable<Header>,SizeStreamable,Streamable
public class ToaHeader extends Header
The header for the Total Order Anycast (TOA) protocol- Since:
- 3.1
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description static byteDATA_MESSAGEstatic byteFINAL_MESSAGEstatic bytePROPOSE_MESSAGEstatic byteSINGLE_DESTINATION_MESSAGE
-
Constructor Summary
Constructors Constructor Description ToaHeader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Supplier<? extends Header>create()Creates an instance of the class implementing this interfacestatic ToaHeadercreateSingleDestinationHeader(MessageID messageID)shortgetMagicId()Returns the magic-ID.MessageIDgetMessageID()longgetSequencerNumber()bytegetType()longgetViewId()static ToaHeadernewDataMessageHeader(MessageID messageID, long viewId)static ToaHeadernewFinalMessageHeader(MessageID messageID, long sequenceNumber)static ToaHeadernewProposeMessageHeader(MessageID messageID, long sequencerNumber)voidreadFrom(java.io.DataInput in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedintserializedSize()Returns the size (in bytes) of the marshalled objectToaHeadersetSequencerNumber(long sequencerNumber)java.lang.StringtoString()voidwriteTo(java.io.DataOutput out)Write the entire state of the current object (including superclasses) to outstream.
-
-
-
Field Detail
-
DATA_MESSAGE
public static final byte DATA_MESSAGE
- See Also:
- Constant Field Values
-
PROPOSE_MESSAGE
public static final byte PROPOSE_MESSAGE
- See Also:
- Constant Field Values
-
FINAL_MESSAGE
public static final byte FINAL_MESSAGE
- See Also:
- Constant Field Values
-
SINGLE_DESTINATION_MESSAGE
public static final byte SINGLE_DESTINATION_MESSAGE
- 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
-
getMessageID
public MessageID getMessageID()
-
getSequencerNumber
public long getSequencerNumber()
-
setSequencerNumber
public ToaHeader setSequencerNumber(long sequencerNumber)
-
getType
public byte getType()
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription 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.IOExceptionjava.lang.ClassNotFoundException
-
newDataMessageHeader
public static ToaHeader newDataMessageHeader(MessageID messageID, long viewId)
-
newProposeMessageHeader
public static ToaHeader newProposeMessageHeader(MessageID messageID, long sequencerNumber)
-
newFinalMessageHeader
public static ToaHeader newFinalMessageHeader(MessageID messageID, long sequenceNumber)
-
createSingleDestinationHeader
public static ToaHeader createSingleDestinationHeader(MessageID messageID)
-
getViewId
public long getViewId()
-
-