com.microfocus.awm.control.toolexecution.internal

## Class LegacyToolExecutorContext

- java.lang.Object
- - com.microfocus.awm.control.toolexecution.internal.LegacyToolExecutorContext

- All Implemented Interfaces:
    IDynamicObject, IMassProcessingToolContext, IToolContext

      public class LegacyToolExecutorContext
      extends java.lang.Object
      implements IMassProcessingToolContext

  Tool context for tool executors using the old `IToolExecutor` interface. It does not return any `IToolInputParameter`s, since resolving input parameters might cause exceptions, effectively breaking backward compatibility.

  The reason for possible exceptions is the former lack of a clear way to define input parameters in models. Old `IToolExecutor` implementations were responsible to resolve parameters manually, which caused very "unique" implementations and modeled tool descriptors.

  Author:
    Micro Focus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LegacyToolExecutorContext(ToolDescriptor pToolDescriptor, IExecutionContext pContext)` Basic constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map<java.lang.String,java.lang.Object>` | `getAttributes()` Gets a list of all dynamic attributes and values.
    `java.lang.Object` | `getAttributeValue(java.lang.String pName)` Gets the value of an attribute with the given ID or name.
    `IExecutionContext` | `getExecutionContext()` Gets the `IExecutionContext` of the currently executed action.
    `IFunctionPackage` | `getFunctionPackage()` Gets the function package instance which defines the `ToolDescriptor` type.
    `java.util.List<IToolInputParameter>` | `getInputParameters()` Gets all input parameters of the tool context.
    `java.util.Collection<IToolInputParameter>` | `getInputParameters(java.lang.String pName)` Gets all input parameters of the tool context with the specified name.
    `ToolDescriptor` | `getModelObject()` Gets the model object.
    `java.util.List<IModeledToolOutputParameter>` | `getOutputParameters()` Gets all output parameters of the tool context.
    `java.util.Collection<IModeledToolOutputParameter>` | `getOutputParameters(java.lang.String pName)` Gets all output parameters of the tool context with the specified name.
    `java.util.List<IToolContext>` | `getSubContexts()` Returns the list of sub-contexts, representing the resources that are currently processed.

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

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

    - ### Methods inherited from interface com.microfocus.awm.model.toolexecution.IDynamicObject

      `getComplexAttributes`

- - ### Constructor Detail

    - #### LegacyToolExecutorContext

          public LegacyToolExecutorContext(ToolDescriptor pToolDescriptor,
                                           IExecutionContext pContext)

      Basic constructor.
      Parameters:
        `pToolDescriptor` - the tool descriptor
        `pContext` - execution context

  - ### Method Detail

    - #### getFunctionPackage

          public IFunctionPackage getFunctionPackage()

      Description copied from interface: `IToolContext`
      Gets the function package instance which defines the `ToolDescriptor` type.
      Specified by:
        `getFunctionPackage` in interface `IToolContext`
      Returns:
        the function package instance or `null` if it doesn't exist in the model

    - #### getModelObject

          public ToolDescriptor getModelObject()

      Description copied from interface: `IDynamicObject`
      Gets the model object.
      Specified by:
        `getModelObject` in interface `IDynamicObject`
      Specified by:
        `getModelObject` in interface `IToolContext`
      Returns:
        the model object

    - #### getExecutionContext

          public IExecutionContext getExecutionContext()

      Description copied from interface: `IToolContext`
      Gets the `IExecutionContext` of the currently executed action.
      Specified by:
        `getExecutionContext` in interface `IToolContext`
      Returns:
        the execution context

    - #### getInputParameters

          public java.util.List<IToolInputParameter> getInputParameters()

      Description copied from interface: `IToolContext`
      Gets all input parameters of the tool context.

      See `ToolUtility` for more methods to obtain specific input parameters.

      Specified by:
        `getInputParameters` in interface `IToolContext`
      Returns:
        all modeled input parameters
      See Also:
        `IToolInputParameter`

    - #### getInputParameters

          public java.util.Collection<IToolInputParameter> getInputParameters(java.lang.String pName)

      Description copied from interface: `IToolContext`
      Gets all input parameters of the tool context with the specified name.

      The name can either be the parameter's `id` attribute of the `toolType` extension or the fully qualified `id`, starting with the function package ID and ending with the parameter `id`.

      See `ToolUtility` for more methods to obtain specific input parameters.

      Specified by:
        `getInputParameters` in interface `IToolContext`
      Parameters:
        `pName` - name of the desired parameter(s)
      Returns:
        a collection of all parameters with the given name

    - #### getAttributeValue

          public java.lang.Object getAttributeValue(java.lang.String pName)

      Description copied from interface: `IDynamicObject`
      Gets the value of an attribute with the given ID or name. The fully qualified ID starts with the function package ID while the name is only the last ID qualifier.
      Specified by:
        `getAttributeValue` in interface `IDynamicObject`
      Parameters:
        `pName` - the attribute ID or name
      Returns:
        the attribute value or `null`

    - #### getAttributes

          public java.util.Map<java.lang.String,java.lang.Object> getAttributes()

      Description copied from interface: `IDynamicObject`
      Gets a list of all dynamic attributes and values.
      Specified by:
        `getAttributes` in interface `IDynamicObject`
      Returns:
        a list of all attributes and values

    - #### getOutputParameters

          public java.util.List<IModeledToolOutputParameter> getOutputParameters()

      Description copied from interface: `IToolContext`
      Gets all output parameters of the tool context.

      See `ToolUtility` for more methods to obtain specific output parameters.

      Specified by:
        `getOutputParameters` in interface `IToolContext`
      Returns:
        all modeled output parameters
      See Also:
        `IModeledToolOutputParameter`

    - #### getOutputParameters

          public java.util.Collection<IModeledToolOutputParameter> getOutputParameters(java.lang.String pName)

      Description copied from interface: `IToolContext`
      Gets all output parameters of the tool context with the specified name.

      The name can either be the parameter's `id` attribute of the `toolType` extension or the fully qualified `id`, starting with the function package ID and ending with the parameter `id`.

      See `ToolUtility` for more methods to obtain specific output parameters.

      Specified by:
        `getOutputParameters` in interface `IToolContext`
      Parameters:
        `pName` - name of the desired parameter(s)
      Returns:
        a collection of all parameters with the given name

    - #### getSubContexts

          public java.util.List<IToolContext> getSubContexts()

      Description copied from interface: `IMassProcessingToolContext`
      Returns the list of sub-contexts, representing the resources that are currently processed.
      Specified by:
        `getSubContexts` in interface `IMassProcessingToolContext`
      Returns:
        sub-contexts

Copyright © 2015 Micro Focus GmbH. All rights reserved.