org.licas.parsers.network

## Class SoaParser

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

-     public class SoaParser
      extends java.lang.Object

  This class can be used to parse a whole service configuration, or SOA, to or from XML, so that it can be saved to a file and then reconstructed. This is configuration for the services running on a single local server. This is not a complete solution, but can be used for testing purposes, for example, to repeat test runs over the same set of services.
  Author:
    Kieran Greer

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>` | `parse(java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> networkDocs, java.lang.String password, java.lang.String adminKey)` Parse the XML description of the network and load it onto the server.
    `java.util.HashMap<java.lang.String,org.licas_xml.abs.Element>` | `serialize(java.lang.String password, java.lang.String adminKey)` Serialise the whole network into XML.
    `void` | `serializeService(Service theService, org.licas_xml.abs.Element servicesElem)` Serialise the object of type ServiceMeta into XML.

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

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

- - ### Constructor Detail

    - #### SoaParser

          public SoaParser()

      Create a new instance of SoaParser.

  - ### Method Detail

    - #### serialize

          public java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> serialize(java.lang.String password,
                                                                                         java.lang.String adminKey)
                                                                                  throws java.lang.Exception

      Serialise the whole network into XML.
      Parameters:
        `password` - the password to access the server.
        `adminKey` - the admin key for the server.
      Returns:
        an XML description of the network. This is stored as a set of XML documents, one for each parsed part. This includes the passwords as a separate list, the service information and the links as a separate list.
      Throws:
        `java.lang.Exception` - any error.

    - #### serializeService

          public void serializeService(Service theService,
                                       org.licas_xml.abs.Element servicesElem)
                                throws java.lang.Exception

      Serialise the object of type ServiceMeta into XML.
      Parameters:
        `theService` - a direct reference to the service object.
        `servicesElem` - the root services element to add service metadata to.
      Throws:
        `java.lang.Exception` - any error.

    - #### parse

          public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> parse(java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> networkDocs,
                                                                                                 java.lang.String password,
                                                                                                 java.lang.String adminKey)
                                                                                          throws java.lang.Exception

      Parse the XML description of the network and load it onto the server.
      Parameters:
        `networkDocs` - a list of XML-based documents that describe the network structure. The network file is identified as having the key value 'Const.NETWORK' element, while the links document has a root 'Const.LINKS' element. The network file at least must be present. Value is an XML element.
        `password` - the password to access the server.
        `adminKey` - the server admin key.
      Returns:
        the password related values. Keys are the nextService ids of type String and values are password/service related values of type ArrayList of Objects.
      Throws:
        `java.lang.Exception` - any error.