org.opennms.netmgt.dao.support
Class DefaultResourceDao

java.lang.Object
  extended by org.opennms.netmgt.dao.support.DefaultResourceDao
All Implemented Interfaces:
ResourceDao, org.springframework.beans.factory.InitializingBean

public class DefaultResourceDao
extends Object
implements ResourceDao, org.springframework.beans.factory.InitializingBean

Encapsulates all SNMP performance reporting for the web user interface.

Author:
Seth Leger , Lawrence Karnowski , OpenNMS , DJ Gregor

Field Summary
static String INTERFACE_GRAPH_TYPE
           
static String RESPONSE_DIRECTORY
           
static String SNMP_DIRECTORY
           
static String STRINGS_PROPERTIES_FILE_NAME
          File name to look for in a resource directory for string attributes.
 
Constructor Summary
DefaultResourceDao()
           
 
Method Summary
 void afterPropertiesSet()
           
static String decode(String string)
          Encapsulate the deprecated decode method to fix it in one place.
 List<OnmsResource> findDomainResources()
          Returns a list of resources for domains.
 List<OnmsResource> findNodeResources()
          Returns a list of resources for a node.
 List<OnmsResource> findTopLevelResources()
           
protected  OnmsResource getChildResource(OnmsResource parentResource, String resourceType, String resource)
           
protected  List<OnmsResource> getChildResourceList(OnmsResource parentResource)
           
 CollectdConfigFactory getCollectdConfig()
           
 DataCollectionConfig getDataCollectionConfig()
           
protected  OnmsResource getDomainEntityResource(String domain)
           
protected  OnmsResource getForeignSourceNodeEntityResource(String resource)
           
 LocationMonitorDao getLocationMonitorDao()
           
 NodeDao getNodeDao()
           
protected  OnmsResource getNodeEntityResource(String resource)
           
 OnmsResource getResourceById(String id)
           
 OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface)
           
 OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface, OnmsLocationMonitor locMon)
           
 OnmsResource getResourceForNode(OnmsNode node)
           
 List<OnmsResource> getResourceListById(String id)
           
 Collection<OnmsResourceType> getResourceTypes()
           
 File getRrdDirectory()
           
 File getRrdDirectory(boolean verify)
           
protected  OnmsResource getTopLevelResource(String resourceType, String resource)
           
 OnmsResource loadResourceById(String id)
           
 void setCollectdConfig(CollectdConfigFactory collectdConfig)
           
 void setDataCollectionConfig(DataCollectionConfig dataCollectionConfig)
           
 void setLocationMonitorDao(LocationMonitorDao locationMonitorDao)
           
 void setNodeDao(NodeDao nodeDao)
           
 void setRrdDirectory(File rrdDirectory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

INTERFACE_GRAPH_TYPE

public static final String INTERFACE_GRAPH_TYPE
See Also:
Constant Field Values

RESPONSE_DIRECTORY

public static final String RESPONSE_DIRECTORY
See Also:
Constant Field Values

SNMP_DIRECTORY

public static final String SNMP_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

DefaultResourceDao

public DefaultResourceDao()
Method Detail

setRrdDirectory

public void setRrdDirectory(File rrdDirectory)

getRrdDirectory

public File getRrdDirectory()
Specified by:
getRrdDirectory in interface ResourceDao

getRrdDirectory

public File getRrdDirectory(boolean verify)
Specified by:
getRrdDirectory in interface ResourceDao

getDataCollectionConfig

public DataCollectionConfig getDataCollectionConfig()

setDataCollectionConfig

public void setDataCollectionConfig(DataCollectionConfig dataCollectionConfig)

getNodeDao

public NodeDao getNodeDao()

setNodeDao

public void setNodeDao(NodeDao nodeDao)

getCollectdConfig

public CollectdConfigFactory getCollectdConfig()

setCollectdConfig

public void setCollectdConfig(CollectdConfigFactory collectdConfig)

getLocationMonitorDao

public LocationMonitorDao getLocationMonitorDao()

setLocationMonitorDao

public void setLocationMonitorDao(LocationMonitorDao locationMonitorDao)

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
IOException

getResourceTypes

public Collection<OnmsResourceType> getResourceTypes()
Specified by:
getResourceTypes in interface ResourceDao

getResourceById

public OnmsResource getResourceById(String id)
Specified by:
getResourceById in interface ResourceDao

loadResourceById

public OnmsResource loadResourceById(String id)
Specified by:
loadResourceById in interface ResourceDao

getResourceListById

public List<OnmsResource> getResourceListById(String id)
Specified by:
getResourceListById in interface ResourceDao

getTopLevelResource

protected OnmsResource getTopLevelResource(String resourceType,
                                           String resource)

getChildResource

protected OnmsResource getChildResource(OnmsResource parentResource,
                                        String resourceType,
                                        String resource)

getChildResourceList

protected List<OnmsResource> getChildResourceList(OnmsResource parentResource)

findNodeResources

public List<OnmsResource> findNodeResources()
Returns a list of resources for a node. XXX It does not currently fully check that an IP address that is found to have distributed response time data is in the database on the proper node so it can have false positives.

Specified by:
findNodeResources in interface ResourceDao

findDomainResources

public List<OnmsResource> findDomainResources()
Returns a list of resources for domains.

Specified by:
findDomainResources in interface ResourceDao

getNodeEntityResource

protected OnmsResource getNodeEntityResource(String resource)

getForeignSourceNodeEntityResource

protected OnmsResource getForeignSourceNodeEntityResource(String resource)

getDomainEntityResource

protected OnmsResource getDomainEntityResource(String domain)

decode

public static String decode(String string)
Encapsulate the deprecated decode method to fix it in one place.

Parameters:
string - string to be decoded
Returns:
decoded string

getResourceForNode

public OnmsResource getResourceForNode(OnmsNode node)
Specified by:
getResourceForNode in interface ResourceDao

getResourceForIpInterface

public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface)
Specified by:
getResourceForIpInterface in interface ResourceDao

getResourceForIpInterface

public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface,
                                              OnmsLocationMonitor locMon)
Specified by:
getResourceForIpInterface in interface ResourceDao

findTopLevelResources

public List<OnmsResource> findTopLevelResources()
Specified by:
findTopLevelResources in interface ResourceDao


Copyright © 2009. All Rights Reserved.