infoservice.agreement.multicast.messages
Class CommitMessage

java.lang.Object
  extended by infoservice.agreement.multicast.messages.AMessage
      extended by infoservice.agreement.multicast.messages.CommitMessage
All Implemented Interfaces:
IDistributable, IAgreementMessage
Direct Known Subclasses:
ConfirmationMessage

public class CommitMessage
extends AMessage


Field Summary
private  java.util.Hashtable m_EchoMessages
           
private  InitMessage m_initMessage
           
 
Fields inherited from class infoservice.agreement.multicast.messages.AMessage
m_consensusId, m_initiatorsId, m_lastCommonRandom, m_messageType, m_proposal, m_senderId, m_signatureOk, m_xmlNode
 
Fields inherited from interface anon.infoservice.IDistributable
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING
 
Constructor Summary
CommitMessage(InitMessage a_msg, java.lang.String a_senderId, java.util.Hashtable a_echoMessages)
          Creates a new CommitMessage.
 
Method Summary
protected  void appendCustomNodes(org.w3c.dom.Document a_doc, org.w3c.dom.Node a_rootElem)
          Subclasses can add some extra nodes into the xml representation of this message by implementing this method
 java.util.Hashtable getEchoMessages()
          Returns the set of EchoMessages contained in this CommitMessage
 java.lang.String getHashKey()
          Returns a hash key for the message
 InitMessage getInitMessage()
          Returns the InitMessage contained in this message
 void setEchoMessages(java.util.Hashtable a_echoMessages)
          Sets the Hashtable of EchoMessage contained in this CommitMessage
 java.lang.String toString()
          Returns a string representation of this message
 
Methods inherited from class infoservice.agreement.multicast.messages.AMessage
getConsensusId, getId, getInitiatorsId, getLastCommonRandom, getMessageType, getPostData, getPostEncoding, getPostFile, getProposal, getSenderId, isSignatureOK, setConsensusId, setLastCommonRandom, setProposal, setSignatureOk, setXmlDocument, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_EchoMessages

private java.util.Hashtable m_EchoMessages

m_initMessage

private InitMessage m_initMessage
Constructor Detail

CommitMessage

public CommitMessage(InitMessage a_msg,
                     java.lang.String a_senderId,
                     java.util.Hashtable a_echoMessages)
Creates a new CommitMessage. It contains a set of at least 2/3n+1 (n=count of InfoServices) EchoMessages signed by different InfoServices.

Parameters:
a_msg - The InitMessage to be committed
a_senderId - The sender of this CommitMessage (should be the same as the initiatorsId in the InitMessage
a_echoMessages - The EchoMessages
Method Detail

getEchoMessages

public java.util.Hashtable getEchoMessages()
Returns the set of EchoMessages contained in this CommitMessage

Returns:
A Hashtable containing the EchoMessages

getHashKey

public java.lang.String getHashKey()
Returns a hash key for the message

Specified by:
getHashKey in interface IAgreementMessage
Overrides:
getHashKey in class AMessage
Returns:
The hashkey

getInitMessage

public InitMessage getInitMessage()
Returns the InitMessage contained in this message

Returns:
The InitMessage

setEchoMessages

public void setEchoMessages(java.util.Hashtable a_echoMessages)
Sets the Hashtable of EchoMessage contained in this CommitMessage

Parameters:
a_echoMessages - The Hashtable of EchoMessage

toString

public java.lang.String toString()
Returns a string representation of this message

Overrides:
toString in class AMessage
Returns:
The string represenation

appendCustomNodes

protected void appendCustomNodes(org.w3c.dom.Document a_doc,
                                 org.w3c.dom.Node a_rootElem)
Description copied from class: AMessage
Subclasses can add some extra nodes into the xml representation of this message by implementing this method

Specified by:
appendCustomNodes in class AMessage
Parameters:
a_doc - The owner document
a_rootElem - The node to which the extra nodes should be added