org.opennms.netmgt.dao.support
Class ResourceTypeUtils

java.lang.Object
  extended by org.opennms.netmgt.dao.support.ResourceTypeUtils

public class ResourceTypeUtils
extends Object

ResourceTypeUtils class.

Version:
$Id: $
Author:
ranger

Field Summary
static String DS_PROPERTIES_FILE
          Constant DS_PROPERTIES_FILE="ds.properties"
 
Method Summary
static Set<OnmsAttribute> getAttributesAtRelativePath(File rrdDirectory, String relativePath)
          getAttributesAtRelativePath
static Properties getDsProperties(File directory)
          getDsProperties
static Properties getProperties(File file)
          getProperties
static File getRrdFileForDs(File directory, String ds)
          getRrdFileForDs
static Properties getStringProperties(File rrdDirectory, String relativePath)
          getStringProperties
static String getStringProperty(File directory, String key)
          getStringProperty
static boolean isResponseTime(String relativePath)
          isResponseTime
static boolean isStoreByGroup()
          isStoreByGroup
static ThreadCategory log()
          log
static void saveUpdatedProperties(File propertiesFile, Properties props)
          saveUpdatedProperties
static void updateDsProperties(File resourceDir, Map<String,String> dsNamesToRrdNames)
          updateDsProperties
static void updateStringProperty(File resourceDir, String attrVal, 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 String DS_PROPERTIES_FILE
Constant DS_PROPERTIES_FILE="ds.properties"

Method Detail

getAttributesAtRelativePath

public static Set<OnmsAttribute> getAttributesAtRelativePath(File rrdDirectory,
                                                             String relativePath)

getAttributesAtRelativePath

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

getDsProperties

public static Properties getDsProperties(File directory)

getDsProperties

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

getRrdFileForDs

public static File getRrdFileForDs(File directory,
                                   String ds)

getRrdFileForDs

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

isStoreByGroup

public static boolean isStoreByGroup()

isStoreByGroup

Returns:
a boolean.

isResponseTime

public static boolean isResponseTime(String relativePath)

isResponseTime

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

getStringProperties

public static Properties getStringProperties(File rrdDirectory,
                                             String relativePath)

getStringProperties

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

getProperties

public static Properties getProperties(File file)

getProperties

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

log

public static ThreadCategory log()

log

Returns:
a ThreadCategory object.

saveUpdatedProperties

public static void saveUpdatedProperties(File propertiesFile,
                                         Properties props)
                                  throws FileNotFoundException,
                                         IOException

saveUpdatedProperties

Parameters:
propertiesFile - a File object.
props - a Properties object.
Throws:
FileNotFoundException - if any.
IOException - if any.

updateDsProperties

public static void updateDsProperties(File resourceDir,
                                      Map<String,String> dsNamesToRrdNames)

updateDsProperties

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

updateStringProperty

public static void updateStringProperty(File resourceDir,
                                        String attrVal,
                                        String attrName)
                                 throws FileNotFoundException,
                                        IOException

updateStringProperty

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

getStringProperty

public static String getStringProperty(File directory,
                                       String key)

getStringProperty

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


Copyright © 2011. All Rights Reserved.