Interface Resource

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getInstance()
      Returns a unique name for the instance of this resource.
      java.lang.String getLabel​(CollectionResource resource)
      Returns a unique label for the instance of this resource.
      Resource getParent()  
      ResourcePath getPath​(CollectionResource resource)
      Retrieves the path of the resource, relative to the repository root.
      java.util.Date getTimestamp()
      Returns the Date to use for attributes associated with this resource.
      java.lang.String getTypeName()
      Returns the type name associated with the resource.
      java.lang.String getUnmodifiedInstance()
      Returns the original unmodified unique name for the instance of this resource.
      Resource resolve()
      Used to lookup additional resource related information that may not have been available when the resource was created, and optionally return a new resource.
    • Method Detail

      • getTypeName

        java.lang.String getTypeName()
        Returns the type name associated with the resource. Used for thresholding.
        Returns:
        type name
      • getInstance

        java.lang.String getInstance()
        Returns a unique name for the instance of this resource. Used by the IndexStorageStrategy
        Returns:
        instance name
      • getUnmodifiedInstance

        java.lang.String getUnmodifiedInstance()
        Returns the original unmodified unique name for the instance of this resource. Used by the ObjectNameStorageStrategy
        Returns:
        instance name
      • getLabel

        java.lang.String getLabel​(CollectionResource resource)
        Returns a unique label for the instance of this resource. This label is used by threshd to generate a unique id on a per resource basis, grouped by node. See CollectionResourceWrapper
        Returns:
        a String object.
      • getPath

        ResourcePath getPath​(CollectionResource resource)
        Retrieves the path of the resource, relative to the repository root.
        Parameters:
        resource - Used by the GenericTypeResource in order to determine the instance name.
        Returns:
        relative path
      • getTimestamp

        java.util.Date getTimestamp()
        Returns the Date to use for attributes associated with this resource.
        Returns:
        a Date or null if the current time should be used.
      • resolve

        Resource resolve()

        Used to lookup additional resource related information that may not have been available when the resource was created, and optionally return a new resource.

        See DeferredGenericTypeResource.resolve().

        This method should only be called when running in the context of the OpenNMS JVM (and not the Minion).

        Returns:
        possibly a new resource, or this same instance if no resolving was performed