com.microfocus.awm.model

## Interface IResource

- All Superinterfaces:
    org.eclipse.core.runtime.IAdaptable
  All Known Subinterfaces:
    IActiveTaurusApplication, IElement, IElementList, IElementListEntry, IFileResource, IFilter, ITableResource, ITaurusApplication, ITaurusSystem
  All Known Implementing Classes:
    AbstractElementListEntry, AbstractTaurusApplication, AbstractTaurusSystem, ActiveTaurusApplication, ConfiguredTaurusSystem, DefaultConfigurationSystem, Element, ElementList, ElementListEntry, FileResource, Filter, LocalTaurusSystem, MasterConfigurationApplication, Resource, TableResource

      public interface IResource
      extends org.eclipse.core.runtime.IAdaptable

  Super interface for all AWM managed resources.
  AWM resources...
- are identified by their ID (`getID()`).
- can have properties & property values.
- can have child resources and a parent resource.
Most resources are also cached persistently by AWM.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChildResource(IResource pRes)` Deprecated. use `addResourceChild(IResource)` instead. `addChildResource(IResource)` calls `addResourceChild(IResource)` without a return value.
    `void` | `addPropertyValue(IPropertyValue pPropertyValue)` Set the value of the property associated with the given property value in this resource to the given property value.
    `boolean` | `addResourceChild(IResource pRes)` Adds a resource to the list of children resources.
    `void` | `delete()` Removes this resource and all its children resources from cache.
    `java.util.Map<Property,IPropertyValue>` | `getAllPropertyValues()` Get all property values of this resource.
    `java.util.List<? super IResource>` | `getChildrenResources()` Deprecated. This method is deprecated since the List interface provided a bad performance. Use get `getResourceChildren()` instead. `getChildrenResources()` returns a copy of the `Collection` returned by `getResourceChildren()`.
    `java.lang.String` | `getID()` Gets the unique ID of the resource.
    `java.lang.String` | `getName()` Gets the name of the resource.
    `IResource` | `getParentResource()` Returns the parent of this resource or `null` if there is none.
    `IPropertyValue` | `getPropertyValue(Property pProperty)` Get the value of the given property in this resource.
    `IPropertyValue` | `getPropertyValueFromHierarchy(Property pProperty)` Returns a property value of this resource and (if existent) parent resources.
    `java.util.Collection<? super IResource>` | `getResourceChildren()` Returns an unmodifiable `Collection` of child resources.
    `boolean` | `removeResourceChild(IResource pRes)` Removes a resource of the list of children resources.
    `void` | `setName(java.lang.String pName)` Sets the name of the resource.
    `void` | `setPropertyValues(java.util.Collection<IPropertyValue> pPropertyValues)` Sets the property values of this resource.

    - ### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

      `getAdapter`

- - ### Method Detail

    - #### getID

          java.lang.String getID()

      Gets the unique ID of the resource.
      Returns:
        the resource ID.

    - #### getName

          java.lang.String getName()

      Gets the name of the resource.
      Returns:
        the resource name

    - #### setName

          void setName(java.lang.String pName)

      Sets the name of the resource.
      Parameters:
        `pName` - the new resource name

    - #### getPropertyValue

          IPropertyValue getPropertyValue(Property pProperty)

      Get the value of the given property in this resource.
      Parameters:
        `pProperty` - TAURUS property
      Returns:
        value of the given property in this resource

    - #### getPropertyValueFromHierarchy

          IPropertyValue getPropertyValueFromHierarchy(Property pProperty)

      Returns a property value of this resource and (if existent) parent resources. If this resource already contains the desired property value, this method does nothing but calling `getPropertyValue(Property)`. Otherwise `getParentResource()` will be called recursively until `getPropertyValue(Property)` returns a value or the root parent is reached.
      Parameters:
        `pProperty` - the desired property
      Returns:
        an `IPropertyValue` or `null` if the value cannot be found in the hierarchy.

    - #### getAllPropertyValues

          java.util.Map<Property,IPropertyValue> getAllPropertyValues()

      Get all property values of this resource.

      Modifying the returned map will have no effect on the resource.

      Returns:
        all property values of this resource

    - #### addPropertyValue

          void addPropertyValue(IPropertyValue pPropertyValue)

      Set the value of the property associated with the given property value in this resource to the given property value.
      Parameters:
        `pPropertyValue` - the new property value

    - #### setPropertyValues

          void setPropertyValues(java.util.Collection<IPropertyValue> pPropertyValues)

      Sets the property values of this resource.
      Parameters:
        `pPropertyValues` - the new property values

    - #### getParentResource

          IResource getParentResource()

      Returns the parent of this resource or `null` if there is none.

      Note: Parent/Child relationships will only be maintained if the "Linked Element List" attribute ( `ActionDescriptor.isLinkElementList()`) is set to `true`.

      Returns:
        the parent resource or `null`.

    - #### getChildrenResources

          @Deprecated
          java.util.List<? super IResource> getChildrenResources()

      Deprecated. This method is deprecated since the List interface provided a bad performance. Use get `getResourceChildren()` instead. `getChildrenResources()` returns a copy of the `Collection` returned by `getResourceChildren()`.
      Returns a list of child resources. Can be an empty list if there are no child resources.

      Note: Parent/Child relationships will only be maintained if the "Linked Element List" attribute ( `ActionDescriptor.isLinkElementList()`) is set to `true`.

      Returns:
        a list of children resources. Can be empty.

    - #### getResourceChildren

          java.util.Collection<? super IResource> getResourceChildren()

      Returns an unmodifiable `Collection` of child resources. Can be an empty `Collection` if there are no child resources.

      Note: Parent/Child relationships will only be maintained if the "Linked Element List" attribute ( `ActionDescriptor.isLinkElementList()`) is set to `true`.

      Returns:
        an unmodifiable `Collection` of children resources. Can be empty.

    - #### removeResourceChild

          boolean removeResourceChild(IResource pRes)

      Removes a resource of the list of children resources. Does nothing if the given resource is not a child of this resource.
      Parameters:
        `pRes` - the `IResource` to be added as child of this resource.
      Returns:
        `true` if an element was removed as a result of this call
      See Also:
        `getResourceChildren()`

    - #### addResourceChild

          boolean addResourceChild(IResource pRes)

      Adds a resource to the list of children resources. Does nothing if the given resource is already a child of this resource.
      Parameters:
        `pRes` - the `IResource` to be added as child of this resource.
      Returns:
        `true` if an element was added as a result of this call
      See Also:
        `getResourceChildren()`

    - #### addChildResource

          @Deprecated
          void addChildResource(IResource pRes)

      Deprecated. use `addResourceChild(IResource)` instead. `addChildResource(IResource)` calls `addResourceChild(IResource)` without a return value.
      Adds a resource to the list of children resources. Does nothing if the given resource is already a child of this resource.
      Parameters:
        `pRes` - the `IResource` to be added as child of this resource.
      See Also:
        `getResourceChildren()`

    - #### delete

          void delete()
               throws TaurusCoreException

      Removes this resource and all its children resources from cache.
      Will not delete the physical resource on the target system.
      Throws:
        `TaurusCoreException` - if the deletion of the resource fails
      See Also:
        `getChildrenResources()`

Copyright © 2015 Micro Focus GmbH. All rights reserved.