universal
Class ReadMessage

java.lang.Object
  |
  +--universal.Message
        |
        +--universal.ReadMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AckReadMessage, NackReadMessage

public class ReadMessage
extends Message

Used for creating ReadMessage.
A ReadMessage is sent during the consensus by the leader to all the replicated servers
to say that it wants to choose a request for this position in the total order.
The replicated servers are going to answer by an AckReadMessage if they don't have already read or write for a bigger round number. If they have already write for a smaller round number the AckReadMessage contains the value that has already been written.
If they have read or write for a bigger round number they send a NackReadMessage.

See Also:
Serialized Form

Field Summary
 int batchno
          batchno the place in the total order for which the consensus is actually made
 int roundno
          roundno the round number for this consensus.
 
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
ReadMessage(int batchno, int roundno)
           
 
Method Summary
static universal.ReadMessage decode(java.io.DataInputStream dis)
          When you want to decode a ReadMessage you have to call the decode function of the superclass Message.
 byte[] encode()
          When you want to encode a ReadMessage you should call this function.
 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

roundno

public int roundno
roundno the round number for this consensus.


batchno

public int batchno
batchno the place in the total order for which the consensus is actually made

Constructor Detail

ReadMessage

public ReadMessage(int batchno,
                   int roundno)
Parameters:
batchno - the place in the total order for which the consensus is actually made
roundno - the round number for this consensus.
Method Detail

decode

public static universal.ReadMessage decode(java.io.DataInputStream dis)
When you want to decode a ReadMessage you have to call the decode function of the superclass Message.


encode

public byte[] encode()
When you want to encode a ReadMessage you should call this function.

Overrides:
encode in class Message

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 java.lang.Object
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 java.lang.Object