Package bftsmart.statemanagement
Class SMMessage
- java.lang.Object
-
- bftsmart.communication.SystemMessage
-
- bftsmart.statemanagement.SMMessage
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
- Direct Known Subclasses:
CSTSMMessage
,StandardSMMessage
public abstract class SMMessage extends SystemMessage
This class represents a message used in the state transfer protocol- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description boolean
TRIGGER_SM_LOCALLY
-
Fields inherited from class bftsmart.communication.SystemMessage
authenticated, sender
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SMMessage()
protected
SMMessage(int sender, int cid, int type, ApplicationState state, View view, int regency, int leader)
Constructs a SMMessage
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCID()
Retrieves the consensus ID up to which the sender needs to be updatedint
getLeader()
Retrieves the leader that the replica had when sending the stateint
getRegency()
Retrieves the regency that the replica had when sending the stateApplicationState
getState()
Retrieves the state logint
getType()
Retrieves the type of the messageView
getView()
Retrieves the state logvoid
readExternal(java.io.ObjectInput in)
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class bftsmart.communication.SystemMessage
getSender
-
-
-
-
Constructor Detail
-
SMMessage
protected SMMessage(int sender, int cid, int type, ApplicationState state, View view, int regency, int leader)
Constructs a SMMessage- Parameters:
sender
- Process Id of the sendercid
- Consensus ID up to which the sender needs to be updatedtype
- Message typereplica
- Replica that should send the statestate
- State log
-
SMMessage
protected SMMessage()
-
-
Method Detail
-
getState
public ApplicationState getState()
Retrieves the state log- Returns:
- The state Log
-
getView
public View getView()
Retrieves the state log- Returns:
- The state Log
-
getType
public int getType()
Retrieves the type of the message- Returns:
- The type of the message
-
getCID
public int getCID()
Retrieves the consensus ID up to which the sender needs to be updated- Returns:
- The consensus ID up to which the sender needs to be updated
-
getRegency
public int getRegency()
Retrieves the regency that the replica had when sending the state- Returns:
- The regency that the replica had when sending the state
-
getLeader
public int getLeader()
Retrieves the leader that the replica had when sending the state- Returns:
- The leader that the replica had when sending the state
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classSystemMessage
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classSystemMessage
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-