Package org.opennms.netmgt.dao.support
Class RrdResourceAttributeUtils
- java.lang.Object
-
- org.opennms.netmgt.dao.support.RrdResourceAttributeUtils
-
public abstract class RrdResourceAttributeUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RrdResourceAttributeUtils.AlphaNumericOnmsAttributeComparator
Alphanumeric sort that handles substrings with numeric components
-
Field Summary
Fields Modifier and Type Field Description static String
DS_PROPERTIES_FILE
File name to look for in a resource directory for datasource attributes.static String
STRINGS_PROPERTIES_FILE_NAME
File name to look for in a resource directory for string attributes.
-
Constructor Summary
Constructors Constructor Description RrdResourceAttributeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Set<OnmsAttribute>
getAttributesAtRelativePath(File rrdDirectory, String relativePath, String rrdFileSuffix)
getAttributesAtRelativePathprotected static Properties
getDsProperties(File directory)
getDsPropertiesprotected static Properties
getProperties(File file)
getPropertiesprotected static File
getRrdFileForDs(File directory, String ds, String extension)
getRrdFileForDsprotected static Properties
getStringProperties(File rrdDirectory, String relativePath)
getStringPropertiesprotected static String
getStringProperty(File directory, String key)
getStringPropertyprotected static void
saveUpdatedProperties(File propertiesFile, Properties props)
saveUpdatedPropertiesprotected static void
updateDsProperties(File resourceDir, Map<String,String> dsNamesToRrdNames)
updateDsPropertiesprotected static void
updateStringProperty(File resourceDir, String attrVal, String attrName)
updateStringProperty
-
-
-
Field Detail
-
DS_PROPERTIES_FILE
public static final 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 String STRINGS_PROPERTIES_FILE_NAME
File name to look for in a resource directory for string attributes.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAttributesAtRelativePath
protected static Set<OnmsAttribute> getAttributesAtRelativePath(File rrdDirectory, String relativePath, String rrdFileSuffix)
getAttributesAtRelativePath
-
getDsProperties
protected static Properties getDsProperties(File directory)
getDsProperties
- Parameters:
directory
- aFile
object.- Returns:
- a
Properties
object.
-
getRrdFileForDs
protected static File getRrdFileForDs(File directory, String ds, String extension)
getRrdFileForDs
-
getStringProperties
protected static Properties getStringProperties(File rrdDirectory, String relativePath)
getStringProperties
- Parameters:
rrdDirectory
- aFile
object.relativePath
- aString
object.- Returns:
- a
Properties
object.
-
getProperties
protected static Properties getProperties(File file)
getProperties
- Parameters:
file
- aFile
object.- Returns:
- a
Properties
object.
-
saveUpdatedProperties
protected static void saveUpdatedProperties(File propertiesFile, Properties props) throws FileNotFoundException, IOException
saveUpdatedProperties
- Parameters:
propertiesFile
- aFile
object.props
- aProperties
object.- Throws:
FileNotFoundException
- if any.IOException
- if any.
-
updateDsProperties
protected static void updateDsProperties(File resourceDir, Map<String,String> dsNamesToRrdNames)
updateDsProperties
-
updateStringProperty
protected static void updateStringProperty(File resourceDir, String attrVal, String attrName) throws FileNotFoundException, IOException
updateStringProperty
- Parameters:
resourceDir
- aFile
object.attrVal
- aString
object.attrName
- aString
object.- Throws:
FileNotFoundException
- if any.IOException
- if any.
-
-