de.fhkl.zw.mkup.rattrap
Class XMLConnections

java.lang.Object
  extended by de.fhkl.zw.mkup.rattrap.XMLConnections

public class XMLConnections
extends java.lang.Object

This class provides access to the xml file which stores the connections to the server.

Author:
Martin Schultz

Constructor Summary
XMLConnections()
          The constructor reads the XML file.
 
Method Summary
 java.util.List getConnections()
           
 org.jdom.Document getDoc()
           
 org.jdom.Element getRoot()
           
 void idrefresh()
          After deleting a connection the remaining connection ids must be reordered.
 void removeEntry(java.lang.String id)
          Removes a connection entry from the xml file.
 void updateRoot(org.jdom.Element update)
          The methods updates the root element, if there are new or deleted elements(connections).
 void writeToFile()
          Saves the xml file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLConnections

public XMLConnections()
The constructor reads the XML file.

Method Detail

removeEntry

public void removeEntry(java.lang.String id)
Removes a connection entry from the xml file.

Parameters:
id: - The id of the connection.

idrefresh

public void idrefresh()
After deleting a connection the remaining connection ids must be reordered.


writeToFile

public void writeToFile()
Saves the xml file.


updateRoot

public void updateRoot(org.jdom.Element update)
The methods updates the root element, if there are new or deleted elements(connections).

Parameters:
update -

getDoc

public org.jdom.Document getDoc()
Returns:
the document.

getRoot

public org.jdom.Element getRoot()
Returns:
the root element

getConnections

public java.util.List getConnections()
Returns:
All children of root in a List.