|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfoservice.agreement.multicast.messages.AMessage
public abstract class AMessage
| Field Summary | |
|---|---|
private byte[] |
m_compressedData
|
protected java.lang.String |
m_consensusId
|
protected java.lang.String |
m_initiatorsId
|
protected java.lang.String |
m_lastCommonRandom
|
protected int |
m_messageType
|
protected java.lang.String |
m_proposal
|
protected java.lang.String |
m_senderId
|
protected boolean |
m_signatureOk
|
protected org.w3c.dom.Document |
m_xmlNode
|
| Fields inherited from interface anon.infoservice.IDistributable |
|---|
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING |
| Constructor Summary | |
|---|---|
protected |
AMessage(java.lang.String a_consensusId,
int a_messageType,
java.lang.String a_initiatorsId,
java.lang.String p_proposal,
java.lang.String lastCommonRandom)
Creates a new message. |
| Method Summary | |
|---|---|
protected abstract 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 |
private java.lang.String |
createConsensusId()
Creates a unique id for this broadcast |
java.lang.String |
getConsensusId()
Returns the unique id of the consensus this message belongs to |
java.lang.String |
getHashKey()
Returns a hash key for the message |
java.lang.String |
getId()
Returns a ID for this information. |
java.lang.String |
getInitiatorsId()
Returns the initiators id |
java.lang.String |
getLastCommonRandom()
Returns the last common random used as a round number |
int |
getMessageType()
Returns the type of this message. |
byte[] |
getPostData()
Returns the data to post to the other infoservice. |
int |
getPostEncoding()
Returns the content encoding of the post data. |
java.lang.String |
getPostFile()
Returns the filename (InfoService command) to which the data of this entry is posted at the other infoservice. |
java.lang.String |
getProposal()
Returns the proposal |
java.lang.String |
getSenderId()
Returns the senders id |
boolean |
isSignatureOK()
Indicates if the signature of this message has been correct |
void |
setConsensusId(java.lang.String a_id)
Sets the consensusId |
void |
setLastCommonRandom(java.lang.String lcr)
Sets the round number. |
void |
setProposal(java.lang.String a_proposal)
Sets the proposal |
void |
setSignatureOk(boolean a_ok)
Sets if the signature of this message has been ok |
void |
setXmlDocument(org.w3c.dom.Document a_node)
Sets an XML representation of this message |
java.lang.String |
toString()
Returns a string representation of this message |
org.w3c.dom.Document |
toXML()
Creates an XML representation of this message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String m_lastCommonRandom
protected java.lang.String m_consensusId
protected java.lang.String m_initiatorsId
protected int m_messageType
protected java.lang.String m_proposal
protected java.lang.String m_senderId
protected boolean m_signatureOk
protected org.w3c.dom.Document m_xmlNode
private byte[] m_compressedData
| Constructor Detail |
|---|
protected AMessage(java.lang.String a_consensusId,
int a_messageType,
java.lang.String a_initiatorsId,
java.lang.String p_proposal,
java.lang.String lastCommonRandom)
a_consensusId - The unique id of the consensus this message belongs toa_messageType - The type of the message (see
AgreementMessageTypes)a_initiatorsId - The id of the initiator if the consensusp_proposal - The proposal (i.e. broadcasted message)m_lastCommonRandom - The last commonly known random number as a round identifier| Method Detail |
|---|
protected abstract void appendCustomNodes(org.w3c.dom.Document a_doc,
org.w3c.dom.Node a_rootElem)
a_doc - The owner documenta_rootElem - The node to which the extra nodes should be addedprivate java.lang.String createConsensusId()
public java.lang.String getConsensusId()
IAgreementMessage
getConsensusId in interface IAgreementMessagepublic java.lang.String getHashKey()
getHashKey in interface IAgreementMessagepublic java.lang.String getId()
IDistributable
getId in interface IDistributablepublic java.lang.String getInitiatorsId()
public java.lang.String getLastCommonRandom()
public int getMessageType()
IAgreementMessage
getMessageType in interface IAgreementMessageAgreementMessageTypespublic byte[] getPostData()
IDistributable
getPostData in interface IDistributablepublic java.lang.String getPostFile()
IDistributable
getPostFile in interface IDistributablepublic int getPostEncoding()
IDistributable
getPostEncoding in interface IDistributablepublic java.lang.String getProposal()
public java.lang.String getSenderId()
public boolean isSignatureOK()
IAgreementMessage
isSignatureOK in interface IAgreementMessagetrue if the signature has been correct,
false otherwisepublic void setConsensusId(java.lang.String a_id)
a_id - public void setProposal(java.lang.String a_proposal)
a_proposal - The proposalpublic void setSignatureOk(boolean a_ok)
IAgreementMessage
setSignatureOk in interface IAgreementMessagepublic void setXmlDocument(org.w3c.dom.Document a_node)
IAgreementMessage
setXmlDocument in interface IAgreementMessagepublic java.lang.String toString()
toString in class java.lang.Objectpublic org.w3c.dom.Document toXML()
IAgreementMessage
toXML in interface IAgreementMessagepublic void setLastCommonRandom(java.lang.String lcr)
IAgreementMessage
setLastCommonRandom in interface IAgreementMessage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||