edu.ntnu.ecosim.management
Class XMLHandler

java.lang.Object
  extended by edu.ntnu.ecosim.management.XMLHandler

public class XMLHandler
extends java.lang.Object

The Class XMLHandler is responsible for parsing and generating the XML Documents that are used as communication format between the simulator and surrounding framework.


Constructor Summary
protected XMLHandler(Market m, SimulationManager sm)
          The Constructor.
 
Method Summary
protected  org.w3c.dom.Document createErrorMessage(java.lang.String msg)
          Method to create an error message with the specified content in the necessary format.
protected  org.w3c.dom.Document createFinalResults(java.lang.String information)
          Method to generate the final results to send to the result receiver.
protected  org.w3c.dom.Document createTempResults(java.lang.String time)
          Creates the temporary results document.
protected  org.w3c.dom.Document generateStatusResponse(java.lang.String status, java.lang.String information)
          Generate status response message.
protected  org.w3c.dom.Document receiveSetup(org.w3c.dom.Document setupdoc)
          Receive the setup document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLHandler

protected XMLHandler(Market m,
                     SimulationManager sm)
The Constructor.

Parameters:
m - the m
Method Detail

createErrorMessage

protected org.w3c.dom.Document createErrorMessage(java.lang.String msg)
Method to create an error message with the specified content in the necessary format.

Parameters:
msg - The message to include
Returns:
A document ready to send to the result receiver

createFinalResults

protected org.w3c.dom.Document createFinalResults(java.lang.String information)
Method to generate the final results to send to the result receiver.

Parameters:
information - Information to add to the final results message
Returns:
A document ready to send to the result receiver

createTempResults

protected org.w3c.dom.Document createTempResults(java.lang.String time)
Creates the temporary results document.

Parameters:
time - the time at which the document is created
Returns:
the document to send

generateStatusResponse

protected org.w3c.dom.Document generateStatusResponse(java.lang.String status,
                                                      java.lang.String information)
Generate status response message.

Parameters:
information - the extra information to add, describing the status
status - the status of the simulator
Returns:
the document containing the information of the response

receiveSetup

protected org.w3c.dom.Document receiveSetup(org.w3c.dom.Document setupdoc)
Receive the setup document.

Parameters:
setupdoc - the document containing setup information
Returns:
A document conaining information about the status of the simulator after setup