Package bftsmart.statemanagement
Interface ApplicationState
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
CSTState,DefaultApplicationState
public interface ApplicationState extends java.io.SerializableThis interface represents a state transfered from a replica to another. The state associated with the last checkpoint together with all the batches of messages received do far, comprises the sender's current state IMPORTANT: The hash state MUST ALWAYS be present, regardless if the replica is supposed to send the complete state or not
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)This method MUST be implemented.CertifiedDecisiongetCertifiedDecision(ServerViewController controller)Retrieves the certified decision for the last consensus present in this objectintgetLastCID()The consensus of the last batch of commands which the application was givenbyte[]getSerializedState()Byte array that must be a representation of the application statebyte[]getStateHash()Gets an secure hash of the application stateinthashCode()This method MUST be implemented.booleanhasState()Indicates if the sender replica had the state requested by the recovering replicavoidsetSerializedState(byte[] state)Sets a byte array that must be a representation of the application state
-
-
-
Method Detail
-
getLastCID
int getLastCID()
The consensus of the last batch of commands which the application was given- Returns:
- consensus of the last batch of commands which the application was given
-
getCertifiedDecision
CertifiedDecision getCertifiedDecision(ServerViewController controller)
Retrieves the certified decision for the last consensus present in this object- Parameters:
controller-- Returns:
- The certified decision for the last consensus present in this object
-
hasState
boolean hasState()
Indicates if the sender replica had the state requested by the recovering replica- Returns:
- true if the sender replica had the state requested by the recovering replica, false otherwise
-
setSerializedState
void setSerializedState(byte[] state)
Sets a byte array that must be a representation of the application state- Parameters:
state- a byte array that must be a representation of the application state
-
getSerializedState
byte[] getSerializedState()
Byte array that must be a representation of the application state- Returns:
- A byte array that must be a representation of the application state
-
getStateHash
byte[] getStateHash()
Gets an secure hash of the application state- Returns:
- Secure hash of the application state
-
equals
boolean equals(java.lang.Object obj)
This method MUST be implemented. However, the attribute returned by getSerializedState() should be ignored, and getStateHash() should be used instead- Overrides:
equalsin classjava.lang.Object
-
hashCode
int hashCode()
This method MUST be implemented. However, the attribute returned by getSerializedState() should be ignored, and getStateHash() should be used instead- Overrides:
hashCodein classjava.lang.Object
-
-