org.licas.autonomic.script

## Class AutoEngineInfo

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

-     public class AutoEngineInfo
      extends java.lang.Object

  This class stores a set of info objects that the `AutoEngine` uses to evaluate a single policy event.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `alwaysTrue` True if the evaluation function is always true
    `boolean` | `controlLoop` True if a control loop element
    `AutoOut` | `effOutput` Actions to carry out if the evaluation is true.
    `protected AutoEngine` | `engine` The engine that executes the info scripts
    `java.lang.Object` | `evaluator`
    `java.lang.String` | `eventID` Unique ID for the auto info object and related script event
    `protected AutoEngineInfo` | `next`
    `protected AutoEngineInfo` | `parent` Traversal to an executable element may be required
    `AutoIn` | `senInput` Input evaluation conditions for the effector list to be selected

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutoEngineInfo(AutoEngine theEngine)` Create a new instance of AutoEngineInfo.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canExecute()` Return true if this info object can be executed.
    `boolean` | `createInfo(org.dcs.query_process.model.event.Script_Event eventElem, org.dcs.query_process.model.Script_Model scriptModel, ObjectsMap objectsMap)` Create the info object and convert the script descriptions into the appropriate objects for executing the process event.
    `AutoOut` | `getEffOutput()` Get the saved effector actions list, as `AutoEngineInfo` objects.
    `java.lang.Object` | `getMethodReply()` Get the method reply.
    `boolean` | `hasEffOutput()` Return true if an effector filter method list is added to this element.
    `protected static java.lang.Object` | `parseToObject(org.dcs.query_process.model.Script_Element scriptElem, org.dcs.query_process.model.Script_Model scriptModel)` Parse the value related to the script element into a Java object.
    `java.lang.String` | `toString()` Create and return a string-based description of this AutoInfo object.

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

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

- - ### Field Detail

    - #### controlLoop

          public boolean controlLoop

      True if a control loop element

    - #### alwaysTrue

          public boolean alwaysTrue

      True if the evaluation function is always true

    - #### eventID

          public java.lang.String eventID

      Unique ID for the auto info object and related script event

    - #### evaluator

          public java.lang.Object evaluator

    - #### senInput

          public AutoIn senInput

      Input evaluation conditions for the effector list to be selected

    - #### effOutput

          public AutoOut effOutput

      Actions to carry out if the evaluation is true. List of type AutoEngineInfo

    - #### engine

          protected AutoEngine engine

      The engine that executes the info scripts

    - #### parent

          protected AutoEngineInfo parent

      Traversal to an executable element may be required

    - #### next

          protected AutoEngineInfo next

  - ### Constructor Detail

    - #### AutoEngineInfo

          public AutoEngineInfo(AutoEngine theEngine)

      Create a new instance of AutoEngineInfo.
      Parameters:
        `theEngine` - the engine that executes this info object.

  - ### Method Detail

    - #### createInfo

          public boolean createInfo(org.dcs.query_process.model.event.Script_Event eventElem,
                                    org.dcs.query_process.model.Script_Model scriptModel,
                                    ObjectsMap objectsMap)
                             throws java.lang.Exception

      Create the info object and convert the script descriptions into the appropriate objects for executing the process event. If the script element does not contain the correct entry, then try its sub-elements.
      Parameters:
        `eventElem` - the process event element.
        `scriptModel` - the whole script model, with access to all element types.
        `objectsMap` - list of already created objects from script elements.
      Returns:
        true if info retrieved OK, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### parseToObject

          protected static java.lang.Object parseToObject(org.dcs.query_process.model.Script_Element scriptElem,
                                                          org.dcs.query_process.model.Script_Model scriptModel)
                                                   throws java.lang.Exception

      Parse the value related to the script element into a Java object.
      Parameters:
        `scriptElem` - the element with the initial definition.
        `scriptModel` - the whole script model, with access to all element types.
      Returns:
        the parsed object, or null if the operation is not possible.
      Throws:
        `java.lang.Exception` - any error.

    - #### canExecute

          public boolean canExecute()

      Return true if this info object can be executed.
      Returns:
        true if method and evaluator exist, false otherwise.

    - #### getMethodReply

          public java.lang.Object getMethodReply()

      Get the method reply. This can be stored in a child element that is executed.
      Returns:
        the method reply, can be nested if this is a control loop.

    - #### hasEffOutput

          public boolean hasEffOutput()

      Return true if an effector filter method list is added to this element.
      Returns:
        true if effector list is added, false otherwise.

    - #### getEffOutput

          public AutoOut getEffOutput()

      Get the saved effector actions list, as `AutoEngineInfo` objects.
      Returns:
        the value of effOutput.

    - #### toString

          public java.lang.String toString()

      Create and return a string-based description of this AutoInfo object.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string-based description of this object.