com.microfocus.awm.core

## Class ResourceOperation

- java.lang.Object
- - com.microfocus.awm.core.ResourceOperation

- All Implemented Interfaces:
    IResourceOperation, java.lang.Cloneable

      public class ResourceOperation
      extends java.lang.Object
      implements IResourceOperation

  Resource operations are created by AWM tools during execution to update AWM elements according to changes on the represented software model. They are mainly used for not requiring to refresh element lists after executing actions for significantly improving performance and UI feedback.

  Example:
  An AWM element represents a remote resource. If a tool gets executed on the element which effectively deletes the corresponding remote resource, a `EResourceProcessingTypes.DELETE` resource operation can be created to delete the AWM element after the execution.

  A tool must add created resource operations in the execution context using `ToolExecutionStatus.putResourceOperation(ResourceOperation)` for AWM to process the operations.

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceOperation(EResourceProcessingTypes pOperation)` Constructs a new simple ResourceOperation.
    `ResourceOperation(EResourceProcessingTypes pOperation, java.lang.String pResName, boolean pRefresh, boolean pSelect)` Constructs a new ResourceOperation.
    `ResourceOperation(EResourceProcessingTypes pOperation, java.lang.String pResName, boolean pRefresh, boolean pSelect, java.util.Collection<IPropertyValue> pPropertyValues)` Constructs a new ResourceOperation.
    `ResourceOperation(EResourceProcessingTypes pOperation, java.lang.String pResName, boolean pRefresh, boolean pSelect, java.util.Map<Property,IPropertyValue> pPropsAndValues)` Deprecated. Use `ResourceOperation(EResourceProcessingTypes, String, boolean, boolean, Collection)` instead.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResourceOperation` | `clone()` Clones the resource operation.
    `java.util.Collection<IPropertyValue>` | `getPropertyValues()` Gets property values changed by the resource operation or containing the changed element ID.
    `java.lang.String` | `getResourceName()` Gets the logical affected resource name of the resource operation.
    `EResourceProcessingTypes` | `getType()` Gets the resource operation type.
    `boolean` | `isRefresh()` Whether the specified resource's `Get All Properties` action should be executed after the resource operation is handled.
    `boolean` | `isSelect()` Whether the specified resource should be selected in the UI after handling the resource operation.
    `void` | `setResourceName(java.lang.String pResName)`
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ResourceOperation

          public ResourceOperation(EResourceProcessingTypes pOperation,
                                   java.lang.String pResName,
                                   boolean pRefresh,
                                   boolean pSelect)

      Constructs a new ResourceOperation.
      Parameters:
        `pOperation` - - The `ResourceProcessingType`
        `pResName` - - The logical name of the resource
        `pRefresh` - - Whether the resource should be refreshed afterwards
        `pSelect` - - Whether the resource should be set selected in the corresponding TAURUS View

    - #### ResourceOperation

          @Deprecated
          public ResourceOperation(EResourceProcessingTypes pOperation,
                                                java.lang.String pResName,
                                                boolean pRefresh,
                                                boolean pSelect,
                                                java.util.Map<Property,IPropertyValue> pPropsAndValues)

      Deprecated. Use `ResourceOperation(EResourceProcessingTypes, String, boolean, boolean, Collection)` instead.
      Constructs a new ResourceOperation.
      Parameters:
        `pOperation` - - The `ResourceProcessingType`
        `pResName` - - The logical name of the resource
        `pRefresh` - - Whether the resource should be refreshed afterwards
        `pSelect` - - Whether the resource should be set selected in the corresponding TAURUS View
        `pPropsAndValues` - resource operation properties and values

    - #### ResourceOperation

          public ResourceOperation(EResourceProcessingTypes pOperation,
                                   java.lang.String pResName,
                                   boolean pRefresh,
                                   boolean pSelect,
                                   java.util.Collection<IPropertyValue> pPropertyValues)

      Constructs a new ResourceOperation.
      Parameters:
        `pOperation` - - The `ResourceProcessingType`
        `pResName` - - The logical name of the resource
        `pRefresh` - - Whether the resource should be refreshed afterwards
        `pSelect` - - Whether the resource should be set selected in the corresponding TAURUS View
        `pPropertyValues` - resource operation property values

    - #### ResourceOperation

          public ResourceOperation(EResourceProcessingTypes pOperation)

      Constructs a new simple ResourceOperation. The corresponding resource will not be selected or refreshed.
      Parameters:
        `pOperation` - - The `ResourceProcessingType`

  - ### Method Detail

    - #### getResourceName

          public java.lang.String getResourceName()

      Description copied from interface: `IResourceOperation`
      Gets the logical affected resource name of the resource operation. The name will be used to create or update a separate affected resource context.
      Specified by:
        `getResourceName` in interface `IResourceOperation`
      Returns:
        the logical name of the corresponding resource

    - #### setResourceName

          public void setResourceName(java.lang.String pResName)

      Parameters:
        `pResName` - the logical resource name to set

    - #### isRefresh

          public boolean isRefresh()

      Description copied from interface: `IResourceOperation`
      Whether the specified resource's `Get All Properties` action should be executed after the resource operation is handled.
      Specified by:
        `isRefresh` in interface `IResourceOperation`
      Returns:
        whether to corresponding resource should be refreshed afterwards

    - #### isSelect

          public boolean isSelect()

      Description copied from interface: `IResourceOperation`
      Whether the specified resource should be selected in the UI after handling the resource operation.
      Specified by:
        `isSelect` in interface `IResourceOperation`
      Returns:
        whether the resource should be selected in the UI

    - #### clone

          public ResourceOperation clone()

      Description copied from interface: `IResourceOperation`
      Clones the resource operation.
      Specified by:
        `clone` in interface `IResourceOperation`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        a copy of this instance

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getPropertyValues

          public java.util.Collection<IPropertyValue> getPropertyValues()

      Description copied from interface: `IResourceOperation`
      Gets property values changed by the resource operation or containing the changed element ID.
      Specified by:
        `getPropertyValues` in interface `IResourceOperation`
      Returns:
        the resource operation's property values. Can be empty.

    - #### getType

          public EResourceProcessingTypes getType()

      Description copied from interface: `IResourceOperation`
      Gets the resource operation type.
      Specified by:
        `getType` in interface `IResourceOperation`
      Returns:
        the resource operation type

Copyright © 2015 Micro Focus GmbH. All rights reserved.