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 classRrdResourceAttributeUtils.AlphaNumericOnmsAttributeComparatorAlphanumeric sort that handles substrings with numeric components
-
Field Summary
Fields Modifier and Type Field Description static StringDS_PROPERTIES_FILEFile name to look for in a resource directory for datasource attributes.static StringSTRINGS_PROPERTIES_FILE_NAMEFile 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 PropertiesgetDsProperties(File directory)getDsPropertiesprotected static PropertiesgetProperties(File file)getPropertiesprotected static FilegetRrdFileForDs(File directory, String ds, String extension)getRrdFileForDsprotected static PropertiesgetStringProperties(File rrdDirectory, String relativePath)getStringPropertiesprotected static StringgetStringProperty(File directory, String key)getStringPropertyprotected static voidsaveUpdatedProperties(File propertiesFile, Properties props)saveUpdatedPropertiesprotected static voidupdateDsProperties(File resourceDir, Map<String,String> dsNamesToRrdNames)updateDsPropertiesprotected static voidupdateStringProperty(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- aFileobject.- Returns:
- a
Propertiesobject.
-
getRrdFileForDs
protected static File getRrdFileForDs(File directory, String ds, String extension)
getRrdFileForDs
-
getStringProperties
protected static Properties getStringProperties(File rrdDirectory, String relativePath)
getStringProperties
- Parameters:
rrdDirectory- aFileobject.relativePath- aStringobject.- Returns:
- a
Propertiesobject.
-
getProperties
protected static Properties getProperties(File file)
getProperties
- Parameters:
file- aFileobject.- Returns:
- a
Propertiesobject.
-
saveUpdatedProperties
protected static void saveUpdatedProperties(File propertiesFile, Properties props) throws FileNotFoundException, IOException
saveUpdatedProperties
- Parameters:
propertiesFile- aFileobject.props- aPropertiesobject.- 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- aFileobject.attrVal- aStringobject.attrName- aStringobject.- Throws:
FileNotFoundException- if any.IOException- if any.
-
-