no.ntnu.item.router.utilities
Class GuiXmlWriter

java.lang.Object
  extended by no.ntnu.item.router.utilities.GuiXmlWriter

public class GuiXmlWriter
extends java.lang.Object

This is a class with functionality for informing the user about the current network situation. When this class is called, it will write certain parameters to file. This file will be read by the apache server that hosts the Web UI.

Author:
Kristian Haugene

Constructor Summary
GuiXmlWriter()
           
 
Method Summary
private  void addAvaliableVideoBitrates(SilverlightMeasurement latestMeasurement, org.w3c.dom.Document document, org.w3c.dom.Element sessionElem)
          A method for adding all the avaliable video bit rates to the sessionElement.
private  void addBitRateStatistics(ServiceSession serviceSession, org.w3c.dom.Document document, org.w3c.dom.Element sessionElem)
          Method for adding bit rate statistics to the sessionElem
private  void addChildElement(org.w3c.dom.Document document, org.w3c.dom.Element parent, java.lang.String name, java.lang.String value)
          Method that makes and adds a child element to a already existing parent.
private  void addServiceSession(ServiceSession serviceSession, org.w3c.dom.Document document, org.w3c.dom.Element root)
          Method for adding a serviceSession to the root element
private  java.lang.String getHumanReadableTimeStamp(SilverlightMeasurement latestMeasurement)
          This method extracts a human readable time stamp on the form hh:mm:ss from a SilverlightMeasurement TODO Remove this method if it will never be used, also remove commented line where this method is used earlier in the code
 void writeXml(ServiceSessionBank serviceSessionBank)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiXmlWriter

public GuiXmlWriter()
Method Detail

writeXml

public void writeXml(ServiceSessionBank serviceSessionBank)

addServiceSession

private void addServiceSession(ServiceSession serviceSession,
                               org.w3c.dom.Document document,
                               org.w3c.dom.Element root)
Method for adding a serviceSession to the root element

Parameters:
serviceSession - the session to add
document - for element creation
root - to append the element to

addAvaliableVideoBitrates

private void addAvaliableVideoBitrates(SilverlightMeasurement latestMeasurement,
                                       org.w3c.dom.Document document,
                                       org.w3c.dom.Element sessionElem)
A method for adding all the avaliable video bit rates to the sessionElement.

Parameters:
latestMeasurement - to retrieve list of bit rates
document - for element creation
sessionElem - where the bit rates should be added

addBitRateStatistics

private void addBitRateStatistics(ServiceSession serviceSession,
                                  org.w3c.dom.Document document,
                                  org.w3c.dom.Element sessionElem)
Method for adding bit rate statistics to the sessionElem

Parameters:
serviceSession - to retrieve the measurements from
document - for element creation
sessionElem - where the statistics are to be added

addChildElement

private void addChildElement(org.w3c.dom.Document document,
                             org.w3c.dom.Element parent,
                             java.lang.String name,
                             java.lang.String value)
Method that makes and adds a child element to a already existing parent.

Parameters:
document - for creation of elements
parent - parent node
name - the name of the new child
value - value of the child elements

getHumanReadableTimeStamp

private java.lang.String getHumanReadableTimeStamp(SilverlightMeasurement latestMeasurement)
This method extracts a human readable time stamp on the form hh:mm:ss from a SilverlightMeasurement TODO Remove this method if it will never be used, also remove commented line where this method is used earlier in the code

Parameters:
latestMeasurement - to read the time stamp from
Returns:
a string representation on the form of hh:mm:ss