infoservice.agreement.paxos.integration
Class InfoServiceMessageFactory

java.lang.Object
  extended by infoservice.agreement.paxos.integration.InfoServiceMessageFactory

public class InfoServiceMessageFactory
extends java.lang.Object


Constructor Summary
InfoServiceMessageFactory()
           
 
Method Summary
private static boolean checkOriginator(org.w3c.dom.Node a_node, java.lang.String a_sender)
          Checks the originator of the message, i.e.
private static boolean checkProofs(CollectMessage message)
          Checks the signatures of the attached FreezeProofMessages
private static FreezeProofMessage createFreezeProof(org.w3c.dom.Node rootNode)
          Creates a FreezeProofMessage off the given node
static PaxosMessage decode(byte[] a_data)
          Decodes the given POST data and creates a PaxosMessage off it
private static boolean isSane(org.w3c.dom.Document a_doc, PaxosMessage a_msg)
          Checks if the sender of the message also signed the message, i.e.
private static PaxosMessage parseDocument(org.w3c.dom.Document a_doc)
          Parses the given document to a PaxosMessage
private static void parseProofs(org.w3c.dom.Node rootNode, CollectMessage message)
          Parse the given node for FreezeProofMessages and add them to the given CollectMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoServiceMessageFactory

public InfoServiceMessageFactory()
Method Detail

decode

public static PaxosMessage decode(byte[] a_data)
Decodes the given POST data and creates a PaxosMessage off it

Parameters:
a_data - The POST data to be decoded
Returns:
A PaxosMessage or null if there has been an error

parseDocument

private static PaxosMessage parseDocument(org.w3c.dom.Document a_doc)
Parses the given document to a PaxosMessage

Parameters:
a_doc -
Returns:

parseProofs

private static void parseProofs(org.w3c.dom.Node rootNode,
                                CollectMessage message)
Parse the given node for FreezeProofMessages and add them to the given CollectMessage

Parameters:
rootNode - The node containing the proofs
message - The CollectMessage to which to add the FreezeProofs

createFreezeProof

private static FreezeProofMessage createFreezeProof(org.w3c.dom.Node rootNode)
Creates a FreezeProofMessage off the given node

Parameters:
rootNode - The node to be parsed
Returns:
A FreezeProofMessage

isSane

private static boolean isSane(org.w3c.dom.Document a_doc,
                              PaxosMessage a_msg)
Checks if the sender of the message also signed the message, i.e. the senders id equals the subjectKeyIdentifier of the attached certificate

Parameters:
a_doc -
a_msg -
Returns:

checkProofs

private static boolean checkProofs(CollectMessage message)
Checks the signatures of the attached FreezeProofMessages

Parameters:
message -
Returns:

checkOriginator

private static boolean checkOriginator(org.w3c.dom.Node a_node,
                                       java.lang.String a_sender)
Checks the originator of the message, i.e. if the senders id equals the subjectKeyIdentifier of the attached certificate

Parameters:
a_node -
a_sender -
Returns: