Class ResourceTypeUtils


  • public abstract class ResourceTypeUtils
    extends Object

    ResourceTypeUtils class.

    • Field Detail

      • DEFAULT_RRD_ROOT

        public static final File DEFAULT_RRD_ROOT
        Default folder where RRD files are stored. Working directory defaults to $OPENNMS_HOME, so we can find these in $OPENNMS_HOME/share/rrd.
      • RESPONSE_DIRECTORY

        public static final String RESPONSE_DIRECTORY
        Directory name of where latency data is stored.
        See Also:
        Constant Field Values
      • STATUS_DIRECTORY

        public static final String STATUS_DIRECTORY
        Directory name of where status data is stored.
        See Also:
        Constant Field Values
      • SNMP_DIRECTORY

        public static final String SNMP_DIRECTORY
        Directory name of where all other collected data is stored.
        See Also:
        Constant Field Values
      • FOREIGN_SOURCE_DIRECTORY

        public static final String FOREIGN_SOURCE_DIRECTORY
        Directory name of where stored-by-foreign-source data is stored.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceTypeUtils

        public ResourceTypeUtils()
    • Method Detail

      • isStoreByGroup

        public static boolean isStoreByGroup()

        isStoreByGroup

        Returns:
        a boolean.
      • isStoreByForeignSource

        public static boolean isStoreByForeignSource()

        isStoreByForeignSource

        Returns:
        a boolean.
      • isResponseTime

        public static boolean isResponseTime​(String relativePath)

        isResponseTime

        Parameters:
        relativePath - a String object.
        Returns:
        a boolean.
      • isStatus

        public static boolean isStatus​(String relativePath)
      • getRelativeNodeSourceDirectory

        public static File getRelativeNodeSourceDirectory​(String nodeSource)
        Parameters:
        nodeSource - a String object.
        Returns:
        a File object.
      • getFsAndFidFromNodeSource

        public static String[] getFsAndFidFromNodeSource​(String nodeSource)
      • getNodeFromResource

        public static OnmsNode getNodeFromResource​(OnmsResource resource)
        Convenience method for retrieving the OnmsNode entity from an abstract resource.
        Throws:
        org.springframework.orm.ObjectRetrievalFailureException - on failure
      • getNodeFromResourceRoot

        public static OnmsNode getNodeFromResourceRoot​(OnmsResource resource)
        Convenience method for retrieving the OnmsNode entity from an abstract resource's ancestor.
        Throws:
        org.springframework.orm.ObjectRetrievalFailureException - on failure
      • getResourcePathWithRepository

        public static ResourcePath getResourcePathWithRepository​(RrdRepository repository,
                                                                 ResourcePath resource)
        Retrieves the ResourcePath relative to rrd.base.dir.
      • getNumPathElementsToNodeLevel

        public static int getNumPathElementsToNodeLevel​(ResourcePath path)
        Returns the number of elements that correspond to the "node resource" for the given path.
        Parameters:
        path - resource path
        Returns:
        number of elements or -1 if the given path does not map to a node