Package org.opennms.netmgt.dao.support
Class RrdResourceAttributeUtils
- java.lang.Object
-
- org.opennms.netmgt.dao.support.RrdResourceAttributeUtils
-
public abstract class RrdResourceAttributeUtils extends java.lang.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 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.
-
Constructor Summary
Constructors Constructor Description RrdResourceAttributeUtils()
-
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)
getAttributesAtRelativePathprotected static java.util.Properties
getDsProperties(java.io.File directory)
getDsPropertiesprotected static java.util.Properties
getProperties(java.io.File file)
getPropertiesprotected static java.io.File
getRrdFileForDs(java.io.File directory, java.lang.String ds, java.lang.String extension)
getRrdFileForDsprotected static java.util.Properties
getStringProperties(java.io.File rrdDirectory, java.lang.String relativePath)
getStringPropertiesprotected static java.lang.String
getStringProperty(java.io.File directory, java.lang.String key)
getStringPropertyprotected static void
saveUpdatedProperties(java.io.File propertiesFile, java.util.Properties props)
saveUpdatedPropertiesprotected static void
updateDsProperties(java.io.File resourceDir, java.util.Map<java.lang.String,java.lang.String> dsNamesToRrdNames)
updateDsPropertiesprotected static void
updateStringProperty(java.io.File resourceDir, java.lang.String attrVal, java.lang.String attrName)
updateStringProperty
-
-
-
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
-
-
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
- aFile
object.relativePath
- aString
object.- Returns:
- a
Set
object.
-
getDsProperties
protected static java.util.Properties getDsProperties(java.io.File directory)
getDsProperties
- Parameters:
directory
- aFile
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
- aFile
object.ds
- aString
object.- Returns:
- a
File
object.
-
getStringProperties
protected static java.util.Properties getStringProperties(java.io.File rrdDirectory, java.lang.String relativePath)
getStringProperties
- Parameters:
rrdDirectory
- aFile
object.relativePath
- aString
object.- Returns:
- a
Properties
object.
-
getProperties
protected static java.util.Properties getProperties(java.io.File file)
getProperties
- Parameters:
file
- aFile
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
- aFile
object.props
- aProperties
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
- aFile
object.dsNamesToRrdNames
- aMap
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
- aFile
object.attrVal
- aString
object.attrName
- aString
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
- aFile
object.key
- aString
object.- Returns:
- a
String
object.
-
-