org.licas

## Class AdminInfo

- java.lang.Object
- - org.licas.AdminInfo

-     public class AdminInfo
      extends java.lang.Object

  This class stores information created by the administrator of the service. The service can be initialised with an XML document that describe aspects of its service and data, including how to configure the AI aspects and provide levels of security. If considering security, then each service is accessed through method invocation, but each method can be protected by a password. Security levels can be specified, with methods defined at each level. The administrator can also specify contracts and policy scripts for the service. A contract can be used to specify the conditions that must be agreed upon for the service (or method) to be invoked. Some of the metadata that the system uses is generated automatically. For example, the method descriptions are read from the service class type, using `Reflection`. These descriptions can then be overridden by the service initialisation admin document, if different security levels are required.

  Data is read as the first nested element under the `Data` tag name. The `Other_Meta` tag is recognised as a slot for other metadata and the `Policy` tag is recognised as a slot for an autonomous service's policy or control script. This optional metadata is added to the `additional` hash list, as separate XML elements with optional keywords. These XML elements can then be retrieved from the 'additional' hash list directly, by using the appropriate key. See the admin user guide for further details.

  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.HashMap<java.lang.String,org.licas_xml.abs.Element>` | `additional` List of additional XML sections.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addLevelOrder(java.lang.String theLevel)` Add another level to the end of the list.
    `AdminInfo` | `cloneAdminInfo()` Return a cloned copy of this admin info object.
    `java.util.HashMap<java.lang.String,org.licas_xml.abs.Element>` | `getAccessLevels()` Get the access levels for each method.
    `java.util.HashMap<java.lang.String,org.licas_xml.abs.Element>` | `getAdditional()` Additional metadata elements not necessarily processed directly in the base services.
    `java.lang.String` | `getAdminFilePath()` Get the file path for the admin xml file.
    `java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>` | `getAllExclude()` Get the excluded levels values.
    `java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>` | `getAllGroups()` Get the groups the levels are put into.
    `org.licas_xml.abs.Element` | `getAutonomicManagerAdmin()` Get the configuration description for the autonomic manager.
    `java.lang.String` | `getCategory()` Get the service category.
    `org.licas_xml.abs.Element` | `getData()` Get the data value.
    `org.licas_xml.abs.Element` | `getDescription()` Get the description value.
    `static java.util.ArrayList<java.lang.String>` | `getDistinctAdminTagNames()` Get a list of element names that are recognised as distinct script types.
    `org.licas_xml.abs.Element` | `getInstanceValues()` Get the variable instance values script.
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getLevelGroups()` Get the access levels with related groups.
    `java.util.ArrayList<java.lang.String>` | `getLevelOrder()` Get the level order.
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getLevelPasswords()` Get the passwords stored for each access level.
    `org.licas_xml.abs.Element` | `getLoadServices()` Get the metadata defining the services to load.
    `boolean` | `getMetaAccessAllowed()` Get the value indicating if access to the service metadata is allowed.
    `boolean` | `getNestedAccessAllowed()` Get the value indicating if access to the nested services is allowed.
    `org.licas_xml.abs.Element` | `getOtherMeta()` Get the metadata specific to this service.
    `org.licas_xml.abs.Element` | `getSerializeValues()` Get the variable serialize values script.
    `org.licas_xml.abs.Element` | `getServicelevelContracts()` Get the service level contracts value.
    `java.lang.String` | `getType()` Get the service type.
    `java.lang.String` | `getUuid()` Get the service uuid.
    `boolean` | `hasAccessLevel(java.lang.String levelKey)` Return true if the access level exists.
    `static boolean` | `isDistinctAdminTag(java.lang.String elementName)` Return true if the element name is a recognised admin tag name that gets processed and stored in the default classes.
    `void` | `setAccessLevels(java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> theAccessLevels)` Set the method access levels.
    `void` | `setAdminFilePath(java.lang.String thisAdminFile)` Set the file path for the admin xml file.
    `void` | `setAllExclude(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> theAllExclude)` Set the excluded levels values.
    `void` | `setAllGroups(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> theAllGroups)` Set the level groups.
    `void` | `setAutonomicManagerAdmin(org.licas_xml.abs.Element theAutoManAdmin)` Set the configuration description for the autonomic manager.
    `void` | `setCategory(java.lang.String theCategory)` Set the service category.
    `void` | `setData(org.licas_xml.abs.Element dataXml)` Set the data value.
    `void` | `setDescription(org.licas_xml.abs.Element theDescription)` Set the description value.
    `void` | `setInstanceValues(org.licas_xml.abs.Element theInstanceValues)` Set the variable instance values script.
    `void` | `setLevelGroups(java.util.HashMap<java.lang.String,java.lang.String> theLevelGroups)` Set the groups for each level.
    `void` | `setLevelOrder(java.util.ArrayList<java.lang.String> theLevelOrder)` Set the level order.
    `void` | `setLevelPasswords(java.util.HashMap<java.lang.String,java.lang.String> theLevelPasswords)` Store the level passwords with the level names.
    `void` | `setLoadServices(org.licas_xml.abs.Element theLoadServices)` Set the services to load value.
    `void` | `setMetaAccessAllowed(boolean thisMetaAccessAllowed)` Set the values indicating if access to service metadata is allowed or blocked.
    `void` | `setNestedAccessAllowed(boolean thisNestedAccessAllowed)` Set the values indicating if access to nested services is allowed or blocked.
    `void` | `setOtherMeta(org.licas_xml.abs.Element otherMetaXml)` Set the additional other metadata values.
    `void` | `setSeializeValues(org.licas_xml.abs.Element theSerializeValues)` Set the variable serialize values script.
    `void` | `setServiceLevelContracts(org.licas_xml.abs.Element theServiceLevelAdmin)` Set the service level agreements value.
    `void` | `setType(java.lang.String theType)` Set the service type.
    `void` | `setUuid(java.lang.String theUuid)` Set the service uuid.

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

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

- - ### Field Detail

    - #### additional

          protected java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> additional

      List of additional XML sections. These are indexed by the first element name and stored as separate elements. They might not be processed in a default service class, but might be recognised by other standard derived classes, for example the `Event` element.

  - ### Constructor Detail

    - #### AdminInfo

          public AdminInfo()

      Create a new instance of AdminInfo.

  - ### Method Detail

    - #### hasAccessLevel

          public boolean hasAccessLevel(java.lang.String levelKey)

      Return true if the access level exists.
      Parameters:
        `levelKey` - the access level key.
      Returns:
        true if an access level with the key name exists.

    - #### setAdminFilePath

          public void setAdminFilePath(java.lang.String thisAdminFile)

      Set the file path for the admin xml file.
      Parameters:
        `thisAdminFile` - the admin document file path.

    - #### getAdminFilePath

          public java.lang.String getAdminFilePath()

      Get the file path for the admin xml file.
      Returns:
        the value of adminFile.

    - #### setUuid

          public void setUuid(java.lang.String theUuid)

      Set the service uuid.
      Parameters:
        `theUuid` - the service uuid.

    - #### getUuid

          public java.lang.String getUuid()

      Get the service uuid.
      Returns:
        the value of uuid.

    - #### setType

          public void setType(java.lang.String theType)

      Set the service type.
      Parameters:
        `theType` - the service type.

    - #### getType

          public java.lang.String getType()

      Get the service type.
      Returns:
        the value of type.

    - #### setCategory

          public void setCategory(java.lang.String theCategory)

      Set the service category.
      Parameters:
        `theCategory` - the service category.

    - #### getCategory

          public java.lang.String getCategory()

      Get the service category.
      Returns:
        the value of category.

    - #### setMetaAccessAllowed

          public void setMetaAccessAllowed(boolean thisMetaAccessAllowed)

      Set the values indicating if access to service metadata is allowed or blocked.
      Parameters:
        `thisMetaAccessAllowed` - if true access is allowed but still requires the password. If false access is blocked for any condition.

    - #### getMetaAccessAllowed

          public boolean getMetaAccessAllowed()

      Get the value indicating if access to the service metadata is allowed.
      Returns:
        true access is allowed but still requires the password, or false access is blocked for any condition.

    - #### setNestedAccessAllowed

          public void setNestedAccessAllowed(boolean thisNestedAccessAllowed)

      Set the values indicating if access to nested services is allowed or blocked.
      Parameters:
        `thisNestedAccessAllowed` - if true access is allowed but still requires the password. If false access is blocked for any condition.

    - #### getNestedAccessAllowed

          public boolean getNestedAccessAllowed()

      Get the value indicating if access to the nested services is allowed.
      Returns:
        true access is allowed but still requires the password, or false access is blocked for any condition.

    - #### setDescription

          public void setDescription(org.licas_xml.abs.Element theDescription)

      Set the description value.
      Parameters:
        `theDescription` - the description of the service.

    - #### getDescription

          public org.licas_xml.abs.Element getDescription()

      Get the description value.
      Returns:
        the value of description.

    - #### setAutonomicManagerAdmin

          public void setAutonomicManagerAdmin(org.licas_xml.abs.Element theAutoManAdmin)

      Set the configuration description for the autonomic manager.
      Parameters:
        `theAutoManAdmin` - the description of the autonomic manager config.

    - #### getAutonomicManagerAdmin

          public org.licas_xml.abs.Element getAutonomicManagerAdmin()

      Get the configuration description for the autonomic manager.
      Returns:
        the value of autoManAdmin.

    - #### setServiceLevelContracts

          public void setServiceLevelContracts(org.licas_xml.abs.Element theServiceLevelAdmin)

      Set the service level agreements value.
      Parameters:
        `theServiceLevelAdmin` - the description of the service levels.

    - #### getServicelevelContracts

          public org.licas_xml.abs.Element getServicelevelContracts()

      Get the service level contracts value.
      Returns:
        the value of serviceLevelAdmin.

    - #### setLoadServices

          public void setLoadServices(org.licas_xml.abs.Element theLoadServices)

      Set the services to load value.
      Parameters:
        `theLoadServices` - the metadata related to the services to load.

    - #### getLoadServices

          public org.licas_xml.abs.Element getLoadServices()

      Get the metadata defining the services to load.
      Returns:
        the value of loadServices.

    - #### setData

          public void setData(org.licas_xml.abs.Element dataXml)
                       throws java.lang.Exception

      Set the data value.
      Parameters:
        `dataXml` - the service data.
      Throws:
        `java.lang.Exception` - any error.

    - #### getData

          public org.licas_xml.abs.Element getData()

      Get the data value.
      Returns:
        the value of data.

    - #### setOtherMeta

          public void setOtherMeta(org.licas_xml.abs.Element otherMetaXml)

      Set the additional other metadata values.
      Parameters:
        `otherMetaXml` - the additional metadata not included as default.

    - #### getOtherMeta

          public org.licas_xml.abs.Element getOtherMeta()

      Get the metadata specific to this service.
      Returns:
        the value of meta.

    - #### getAdditional

          public java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> getAdditional()

      Additional metadata elements not necessarily processed directly in the base services.
      Returns:
        the value of additional.

    - #### setInstanceValues

          public void setInstanceValues(org.licas_xml.abs.Element theInstanceValues)

      Set the variable instance values script.
      Parameters:
        `theInstanceValues` - description of actual variable instance values.

    - #### getInstanceValues

          public org.licas_xml.abs.Element getInstanceValues()

      Get the variable instance values script.
      Returns:
        the value of instanceValues.

    - #### setSeializeValues

          public void setSeializeValues(org.licas_xml.abs.Element theSerializeValues)

      Set the variable serialize values script.
      Parameters:
        `theSerializeValues` - description of actual variable serialize values.

    - #### getSerializeValues

          public org.licas_xml.abs.Element getSerializeValues()

      Get the variable serialize values script.
      Returns:
        the value of serializeValues.

    - #### addLevelOrder

          public boolean addLevelOrder(java.lang.String theLevel)

      Add another level to the end of the list.
      Parameters:
        `theLevel` - the name of the access level to add.
      Returns:
        true if added or false if it already exists.

    - #### setLevelOrder

          public void setLevelOrder(java.util.ArrayList<java.lang.String> theLevelOrder)

      Set the level order.
      Parameters:
        `theLevelOrder` - the level order. Values are level names of type String.

    - #### getLevelOrder

          public java.util.ArrayList<java.lang.String> getLevelOrder()

      Get the level order.
      Returns:
        the value of levelOrder. Values are level names of type String.

    - #### setLevelPasswords

          public void setLevelPasswords(java.util.HashMap<java.lang.String,java.lang.String> theLevelPasswords)

      Store the level passwords with the level names.
      Parameters:
        `theLevelPasswords` - the passwords for each level. Keys are the level names of type String and values are the access passwords of type String.

    - #### getLevelPasswords

          public java.util.HashMap<java.lang.String,java.lang.String> getLevelPasswords()

      Get the passwords stored for each access level.
      Returns:
        the value of levelPasswords. Keys are the level names of type String and values are the access passwords of type String.

    - #### setAccessLevels

          public void setAccessLevels(java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> theAccessLevels)

      Set the method access levels.
      Parameters:
        `theAccessLevels` - the access levels for each method. Keys are the access levels of type String and values are descriptions of the methods at each level of type String.

    - #### getAccessLevels

          public java.util.HashMap<java.lang.String,org.licas_xml.abs.Element> getAccessLevels()

      Get the access levels for each method.
      Returns:
        the value of accessLevels. Keys are the access levels of type String and values are descriptions of the methods at each level of type String.

    - #### setLevelGroups

          public void setLevelGroups(java.util.HashMap<java.lang.String,java.lang.String> theLevelGroups)

      Set the groups for each level.
      Parameters:
        `theLevelGroups` - the access levels with related groups. Keys are the access levels of type String and values are the associated group names of type String.

    - #### getLevelGroups

          public java.util.HashMap<java.lang.String,java.lang.String> getLevelGroups()

      Get the access levels with related groups.
      Returns:
        the value of levelGroups. Keys are the access levels of type String and values are the associated group names of type String.

    - #### setAllGroups

          public void setAllGroups(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> theAllGroups)

      Set the level groups.
      Parameters:
        `theAllGroups` - the groups the levels are put into. Keys are the group names of type String and values are the access levels in that group of type ArrayList of Strings.

    - #### getAllGroups

          public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getAllGroups()

      Get the groups the levels are put into.
      Returns:
        the value of allGroups. Keys are the group names of type String and values are the access levels in that group of type ArrayList of Strings.

    - #### setAllExclude

          public void setAllExclude(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> theAllExclude)

      Set the excluded levels values.
      Parameters:
        `theAllExclude` - the excluded levels values. Keys are the access levels of type String and values are the excluded access levels of type ArrayList of Strings.

    - #### getAllExclude

          public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getAllExclude()

      Get the excluded levels values.
      Returns:
        the value of allExclude. Keys are the access levels of type String and values are the excluded access levels of type ArrayList of Strings.

    - #### cloneAdminInfo

          public AdminInfo cloneAdminInfo()

      Return a cloned copy of this admin info object.
      Returns:
        a copy of this object with each structure cloned.

    - #### isDistinctAdminTag

          public static boolean isDistinctAdminTag(java.lang.String elementName)

      Return true if the element name is a recognised admin tag name that gets processed and stored in the default classes. Additional tags like `Event` is not recognised.
      Parameters:
        `elementName` - the name of the element.
      Returns:
        true if it is recognised as an admin element.

    - #### getDistinctAdminTagNames

          public static java.util.ArrayList<java.lang.String> getDistinctAdminTagNames()

      Get a list of element names that are recognised as distinct script types.
      Returns:
        a list of element tag names. Additional tags like `Event` is not returned.