org.licas.autonomic.script

## Class ObjectsMap

- java.lang.Object
- - org.licas.autonomic.script.ObjectsMap

-     public class ObjectsMap
      extends java.lang.Object

  Stores mapping and functions from object keys to instances.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.HashMap<java.lang.Object,java.lang.Object>` | `objectsMap` The mapped objects

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear the mapped list.
    `java.lang.Object` | `clone()` Create a clone of this object.
    `boolean` | `containsKey(java.lang.Object key)` Return true if the objects list contains the specified key.
    `java.lang.Object` | `get(java.lang.Object key)` Get a value from the mapped list.
    `java.util.HashMap<java.lang.Object,java.lang.Object>` | `getObjectsMap()` Get the list of mapped objects.
    `protected java.lang.String[]` | `getPasswords(org.licas_xml.abs.Element servicePath, PasswordHandler passwordHandler)` Determine the passwords for both the local server and the service in question.
    `protected java.lang.String[]` | `getPasswords(java.lang.String serviceID, PasswordHandler passwordHandler)` Determine the passwords for both the local server and the service in question.
    `protected boolean` | `isVariableKey(java.lang.String keyWord)` Return true if the keyword is a known mapping to a variable.
    `void` | `mapToParams(java.util.ArrayList<ParamInfo> paramList, java.util.HashMap<java.lang.String,java.lang.String> eventVars)` Replace any `null` values in the parameter list with values in the map if they exist.
    `void` | `mapToVars(java.util.ArrayList<?> paramList)` Replace any `null` values in the parameter list with values in the map if they exist.
    `void` | `put(java.lang.Object key, java.lang.Object value)` Ann an object to the map list.
    `void` | `setObjectsMap(java.util.HashMap<java.lang.Object,java.lang.Object> theObjectsMap)` Set the list of mapped objects.
    `void` | `varsToMap(java.util.ArrayList<java.lang.Object> paramList)` Remove any key-value pairs that use the known variable key name and add to the list of mapped objects.

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

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

- - ### Field Detail

    - #### objectsMap

          protected java.util.HashMap<java.lang.Object,java.lang.Object> objectsMap

      The mapped objects

  - ### Constructor Detail

    - #### ObjectsMap

          public ObjectsMap()

      Create a new instance of ObjectsMap.

  - ### Method Detail

    - #### varsToMap

          public void varsToMap(java.util.ArrayList<java.lang.Object> paramList)

      Remove any key-value pairs that use the known variable key name and add to the list of mapped objects.
      Parameters:
        `paramList` - the list of input parameters from the input message info object.

    - #### mapToVars

          public void mapToVars(java.util.ArrayList<?> paramList)

      Replace any `null` values in the parameter list with values in the map if they exist.
      Parameters:
        `paramList` - the list of input parameters from the input message info object.

    - #### mapToParams

          public void mapToParams(java.util.ArrayList<ParamInfo> paramList,
                                  java.util.HashMap<java.lang.String,java.lang.String> eventVars)

      Replace any `null` values in the parameter list with values in the map if they exist. This is a specific mapping from the event itself.
      Parameters:
        `paramList` - the list of input parameters from the input message info object.
        `eventVars` - list of key-value pairs from the event method itself.

    - #### getPasswords

          protected java.lang.String[] getPasswords(java.lang.String serviceID,
                                                    PasswordHandler passwordHandler)

      Determine the passwords for both the local server and the service in question. The `passwordHandler` is tried first. If the password is missing, then the mapped lit is tried.
      Parameters:
        `serviceID` - the service uuid.
        `passwordHandler` - list of passwords stored for the parent engine and service.
      Returns:
        the two passwords: server-service, where null means it is missing.

    - #### getPasswords

          protected java.lang.String[] getPasswords(org.licas_xml.abs.Element servicePath,
                                                    PasswordHandler passwordHandler)

      Determine the passwords for both the local server and the service in question. The `passwordHandler` is tried first. If the password is missing, then the mapped lit is tried.
      Parameters:
        `servicePath` - full uri path description for the service.
        `passwordHandler` - list of passwords stored for the parent engine and service.
      Returns:
        the two passwords: server-service, where null means it is missing.

    - #### setObjectsMap

          public void setObjectsMap(java.util.HashMap<java.lang.Object,java.lang.Object> theObjectsMap)

      Set the list of mapped objects.
      Parameters:
        `theObjectsMap` - key-value pairs.

    - #### getObjectsMap

          public java.util.HashMap<java.lang.Object,java.lang.Object> getObjectsMap()

      Get the list of mapped objects.
      Returns:
        the value of objectMaps.

    - #### clear

          public void clear()

      Clear the mapped list.

    - #### containsKey

          public boolean containsKey(java.lang.Object key)

      Return true if the objects list contains the specified key.
      Parameters:
        `key` - the key value.
      Returns:
        true if list contains the key value.

    - #### put

          public void put(java.lang.Object key,
                          java.lang.Object value)

      Ann an object to the map list.
      Parameters:
        `key` - object key value.
        `value` - object value.

    - #### get

          public java.lang.Object get(java.lang.Object key)

      Get a value from the mapped list.
      Parameters:
        `key` - object key value.
      Returns:
        object value.

    - #### isVariableKey

          protected boolean isVariableKey(java.lang.String keyWord)

      Return true if the keyword is a known mapping to a variable.
      Parameters:
        `keyWord` - the keyword.
      Returns:
        true if maps to a known variable type.

    - #### clone

          public java.lang.Object clone()

      Create a clone of this object.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        a light clone of this object.