Interface ApplicationState

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    CSTState, DefaultApplicationState

    public interface ApplicationState
    extends java.io.Serializable
    This 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
      boolean equals​(java.lang.Object obj)
      This method MUST be implemented.
      CertifiedDecision getCertifiedDecision​(ServerViewController controller)
      Retrieves the certified decision for the last consensus present in this object
      int getLastCID()
      The consensus of the last batch of commands which the application was given
      byte[] getSerializedState()
      Byte array that must be a representation of the application state
      byte[] getStateHash()
      Gets an secure hash of the application state
      int hashCode()
      This method MUST be implemented.
      boolean hasState()
      Indicates if the sender replica had the state requested by the recovering replica
      void setSerializedState​(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:
        equals in class java.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:
        hashCode in class java.lang.Object