org.licas.parsers.network

## Class NetworkParser

- java.lang.Object
- - org.licas.parsers.network.NetworkParser

-     public class NetworkParser
      extends java.lang.Object

  This class can be used to parse the registered servers running on a network to or from XML, so that it can be saved to a file and then reconstructed. This is a description of the distributed servers only and relates to their passwords and links, so that the network can be re-constructed. It is not a complete solution that saves everything.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkParser()` Create a new instance of NetworkParser.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.HashMap<java.lang.String,org.licas_xml.abs.Element>` | `parse(org.licas_xml.abs.Element networkDoc)` Parse the XML description of the network and load it onto the server.
    `org.licas_xml.abs.Element` | `serialize(org.licas_xml.abs.Element serverPath, PasswordHandler passwordHandler, ServiceLinks serviceLinks)` Serialise the server details with relation to the network.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NetworkParser

          public NetworkParser()

      Create a new instance of NetworkParser.

  - ### Method Detail

    - #### serialize

          public org.licas_xml.abs.Element serialize(org.licas_xml.abs.Element serverPath,
                                                     PasswordHandler passwordHandler,
                                                     ServiceLinks serviceLinks)
                                              throws java.lang.Exception

      Serialise the server details with relation to the network.
      Parameters:
        `serverPath` - the path description to the server.
        `passwordHandler` - the passwords for the servers.
        `serviceLinks` - all service links.
      Returns:
        an XML description of the network. This includes the links between the different network nodes.
      Throws:
        `java.lang.Exception` - any error.

    - #### parse

          public java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> parse(org.licas_xml.abs.Element networkDoc)
                                                                              throws java.lang.Exception

      Parse the XML description of the network and load it onto the server.
      Parameters:
        `networkDoc` - the network with related links can be described in a single document.
      Returns:
        a description of the registered servers, including passwords and links.
      Throws:
        `java.lang.Exception` - any error.