universal
Class AckWriteMessage

java.lang.Object
  |
  +--universal.Message
        |
        +--universal.WriteMessage
              |
              +--universal.AckWriteMessage
All Implemented Interfaces:
java.io.Serializable

public class AckWriteMessage
extends universal.WriteMessage

Used for creating an AckWriteMessage.
An AckWriteMessage is sent during the consensus by all the replicated server
to the leader to acknowledge the WriteMessage that the leader has sent.

See Also:
Serialized Form

Field Summary
 boolean permission
          the variable permission is not useful in a case of the crashStop model but could be used in the crashRecovery.
 
Fields inherited from class universal.WriteMessage
batchno, Kpj, roundno, value
 
Fields inherited from class universal.Message
ACK_READ_MSG, ACK_WRITE_MSG, AM_ALIVE_MSG, mid, msgType, NACK_READ_MSG, NACK_WRITE_MSG, READ_MSG, senderid, WRITE_MSG
 
Constructor Summary
AckWriteMessage(int batchno, int roundno, boolean permission)
          To create an AckWriteMessage
 
Method Summary
static universal.WriteMessage decode(java.io.DataInputStream dis)
          If you want to decode an AckWriteMessage, you should call the method Decode of the superclass Message, not this one.
 byte[] encode()
          If you want to encode a WriteMessage, you should call this method not the one from the superclass.
 boolean equals(java.lang.Object obj)
          Compares two objects for equality.
 java.lang.String toString()
           
 
Methods inherited from class universal.Message
decode, msgId, msgType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permission

public boolean permission
the variable permission is not useful in a case of the crashStop model but could be used in the crashRecovery.

Constructor Detail

AckWriteMessage

public AckWriteMessage(int batchno,
                       int roundno,
                       boolean permission)
To create an AckWriteMessage

Parameters:
batchno - the place in the total order for which the consensus is actually made
roundno - the round number for this consensus
permission - not use in the crashStopModel
Method Detail

decode

public static universal.WriteMessage decode(java.io.DataInputStream dis)
If you want to decode an AckWriteMessage, you should call the method Decode of the superclass Message, not this one.

Returns:
an AckWriteMessage but as a type of WriteMessage(superclass)

encode

public byte[] encode()
If you want to encode a WriteMessage, you should call this method not the one from the superclass.

Overrides:
encode in class universal.WriteMessage
Returns:
an array of byte which contains all the information of this AckWriteMessage

equals

public boolean equals(java.lang.Object obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Overrides:
equals in class universal.WriteMessage
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable

toString

public java.lang.String toString()
Overrides:
toString in class universal.WriteMessage