Class RrdResourceAttributeUtils


  • public abstract class RrdResourceAttributeUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DS_PROPERTIES_FILE
      File name to look for in a resource directory for datasource attributes.
      static java.lang.String STRINGS_PROPERTIES_FILE_NAME
      File name to look for in a resource directory for string attributes.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.util.Set<OnmsAttribute> getAttributesAtRelativePath​(java.io.File rrdDirectory, java.lang.String relativePath, java.lang.String rrdFileSuffix)
      getAttributesAtRelativePath
      protected static java.util.Properties getDsProperties​(java.io.File directory)
      getDsProperties
      protected static java.util.Properties getProperties​(java.io.File file)
      getProperties
      protected static java.io.File getRrdFileForDs​(java.io.File directory, java.lang.String ds, java.lang.String extension)
      getRrdFileForDs
      protected static java.util.Properties getStringProperties​(java.io.File rrdDirectory, java.lang.String relativePath)
      getStringProperties
      protected static java.lang.String getStringProperty​(java.io.File directory, java.lang.String key)
      getStringProperty
      protected static void saveUpdatedProperties​(java.io.File propertiesFile, java.util.Properties props)
      saveUpdatedProperties
      protected static void updateDsProperties​(java.io.File resourceDir, java.util.Map<java.lang.String,​java.lang.String> dsNamesToRrdNames)
      updateDsProperties
      protected static void updateStringProperty​(java.io.File resourceDir, java.lang.String attrVal, java.lang.String attrName)
      updateStringProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DS_PROPERTIES_FILE

        public static final java.lang.String DS_PROPERTIES_FILE
        File name to look for in a resource directory for datasource attributes.
        See Also:
        Constant Field Values
      • STRINGS_PROPERTIES_FILE_NAME

        public static final java.lang.String STRINGS_PROPERTIES_FILE_NAME
        File name to look for in a resource directory for string attributes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RrdResourceAttributeUtils

        public RrdResourceAttributeUtils()
    • Method Detail

      • getAttributesAtRelativePath

        protected static java.util.Set<OnmsAttribute> getAttributesAtRelativePath​(java.io.File rrdDirectory,
                                                                                  java.lang.String relativePath,
                                                                                  java.lang.String rrdFileSuffix)

        getAttributesAtRelativePath

        Parameters:
        rrdDirectory - a File object.
        relativePath - a String object.
        Returns:
        a Set object.
      • getDsProperties

        protected static java.util.Properties getDsProperties​(java.io.File directory)

        getDsProperties

        Parameters:
        directory - a File object.
        Returns:
        a Properties object.
      • getRrdFileForDs

        protected static java.io.File getRrdFileForDs​(java.io.File directory,
                                                      java.lang.String ds,
                                                      java.lang.String extension)

        getRrdFileForDs

        Parameters:
        directory - a File object.
        ds - a String object.
        Returns:
        a File object.
      • getStringProperties

        protected static java.util.Properties getStringProperties​(java.io.File rrdDirectory,
                                                                  java.lang.String relativePath)

        getStringProperties

        Parameters:
        rrdDirectory - a File object.
        relativePath - a String object.
        Returns:
        a Properties object.
      • getProperties

        protected static java.util.Properties getProperties​(java.io.File file)

        getProperties

        Parameters:
        file - a File object.
        Returns:
        a Properties object.
      • saveUpdatedProperties

        protected static void saveUpdatedProperties​(java.io.File propertiesFile,
                                                    java.util.Properties props)
                                             throws java.io.FileNotFoundException,
                                                    java.io.IOException

        saveUpdatedProperties

        Parameters:
        propertiesFile - a File object.
        props - a Properties object.
        Throws:
        java.io.FileNotFoundException - if any.
        java.io.IOException - if any.
      • updateDsProperties

        protected static void updateDsProperties​(java.io.File resourceDir,
                                                 java.util.Map<java.lang.String,​java.lang.String> dsNamesToRrdNames)

        updateDsProperties

        Parameters:
        resourceDir - a File object.
        dsNamesToRrdNames - a Map object.
      • updateStringProperty

        protected static void updateStringProperty​(java.io.File resourceDir,
                                                   java.lang.String attrVal,
                                                   java.lang.String attrName)
                                            throws java.io.FileNotFoundException,
                                                   java.io.IOException

        updateStringProperty

        Parameters:
        resourceDir - a File object.
        attrVal - a String object.
        attrName - a String object.
        Throws:
        java.io.FileNotFoundException - if any.
        java.io.IOException - if any.
      • getStringProperty

        protected static java.lang.String getStringProperty​(java.io.File directory,
                                                            java.lang.String key)

        getStringProperty

        Parameters:
        directory - a File object.
        key - a String object.
        Returns:
        a String object.