public class DefaultResourceDao extends Object implements ResourceDao, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description |
|---|---|
static String |
INTERFACE_GRAPH_TYPE
Constant
INTERFACE_GRAPH_TYPE="interface" |
| Constructor and Description |
|---|
DefaultResourceDao()
Constructor for DefaultResourceDao.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
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.
|
protected List<OnmsResource> |
findNodeResources()
Returns a list of resources for all the nodes.
|
protected Set<String> |
findNodeSourceDirectories()
findNodeSourceDirectories
|
List<OnmsResource> |
findTopLevelResources()
findTopLevelResources
|
protected OnmsResource |
getChildResource(OnmsResource parentResource,
String resourceType,
String resource)
getChildResource
|
protected List<OnmsResource> |
getChildResourceList(OnmsResource parentResource)
getChildResourceList
|
CollectdConfigFactory |
getCollectdConfig()
getCollectdConfig
|
DataCollectionConfigDao |
getDataCollectionConfigDao()
getDataCollectionConfig
|
protected OnmsResource |
getDomainEntityResource(String domain)
getDomainEntityResource
|
protected OnmsResource |
getForeignSourceNodeEntityResource(String resource)
getForeignSourceNodeEntityResource
|
IpInterfaceDao |
getIpInterfaceDao() |
LocationMonitorDao |
getLocationMonitorDao()
getLocationMonitorDao
|
NodeDao |
getNodeDao()
getNodeDao
|
protected OnmsResource |
getNodeEntityResource(String resource)
getNodeEntityResource
|
OnmsResource |
getResourceById(String id)
Fetch a specific resource by string ID.
|
OnmsResource |
getResourceForIpInterface(OnmsIpInterface ipInterface)
getResourceForIpInterface
|
OnmsResource |
getResourceForIpInterface(OnmsIpInterface ipInterface,
OnmsLocationMonitor locMon)
getResourceForIpInterface
|
OnmsResource |
getResourceForNode(OnmsNode node)
getResourceForNode
|
List<OnmsResource> |
getResourceListById(String id)
Fetch a specific list of resources by string ID.
|
Collection<OnmsResourceType> |
getResourceTypes()
getResourceTypes
|
File |
getRrdDirectory()
getRrdDirectory
|
File |
getRrdDirectory(boolean verify)
getRrdDirectory
|
protected OnmsResource |
getTopLevelResource(String resourceType,
String resource)
getTopLevelResource
|
void |
setCollectdConfig(CollectdConfigFactory collectdConfig)
setCollectdConfig
|
void |
setDataCollectionConfigDao(DataCollectionConfigDao dataCollectionConfigDao)
setDataCollectionConfig
|
void |
setIpInterfaceDao(IpInterfaceDao ipInterfaceDao) |
void |
setLocationMonitorDao(LocationMonitorDao locationMonitorDao)
setLocationMonitorDao
|
void |
setNodeDao(NodeDao nodeDao)
setNodeDao
|
void |
setRrdDirectory(File rrdDirectory)
setRrdDirectory
|
public static final String INTERFACE_GRAPH_TYPE
INTERFACE_GRAPH_TYPE="interface"public DefaultResourceDao()
Constructor for DefaultResourceDao.
public void setRrdDirectory(File rrdDirectory)
setRrdDirectory
rrdDirectory - a File object.public File getRrdDirectory()
getRrdDirectory
getRrdDirectory in interface ResourceDaoFile object.public File getRrdDirectory(boolean verify)
getRrdDirectory
getRrdDirectory in interface ResourceDaoverify - a boolean.File object.public DataCollectionConfigDao getDataCollectionConfigDao()
getDataCollectionConfig
DataCollectionConfigDao object.public void setDataCollectionConfigDao(DataCollectionConfigDao dataCollectionConfigDao)
setDataCollectionConfig
dataCollectionConfigDao - a DataCollectionConfigDao object.public void setNodeDao(NodeDao nodeDao)
setNodeDao
nodeDao - a NodeDao object.public CollectdConfigFactory getCollectdConfig()
getCollectdConfig
CollectdConfigFactory object.public void setCollectdConfig(CollectdConfigFactory collectdConfig)
setCollectdConfig
collectdConfig - a CollectdConfigFactory object.public LocationMonitorDao getLocationMonitorDao()
getLocationMonitorDao
LocationMonitorDao object.public void setLocationMonitorDao(LocationMonitorDao locationMonitorDao)
setLocationMonitorDao
locationMonitorDao - a LocationMonitorDao object.public IpInterfaceDao getIpInterfaceDao()
public void setIpInterfaceDao(IpInterfaceDao ipInterfaceDao)
public void afterPropertiesSet()
throws IOException
afterPropertiesSet
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanIOException - if any.public Collection<OnmsResourceType> getResourceTypes()
getResourceTypes
getResourceTypes in interface ResourceDaoCollection object.public OnmsResource getResourceById(String id)
getResourceById in interface ResourceDaoid - a String object.IllegalArgumentException - When the resource ID string does not match the expected regex patternorg.springframework.orm.ObjectRetrievalFailureException - If any exceptions are thrown while searching for the resourcepublic List<OnmsResource> getResourceListById(String id) throws IllegalArgumentException, org.springframework.orm.ObjectRetrievalFailureException
getResourceListById in interface ResourceDaoid - a String object.IllegalArgumentException - When the resource ID string does not match the expected regex patternorg.springframework.orm.ObjectRetrievalFailureException - If any exceptions are thrown while searching for the resourceprotected OnmsResource getTopLevelResource(String resourceType, String resource) throws org.springframework.orm.ObjectRetrievalFailureException
getTopLevelResource
resourceType - a String object.resource - a String object.OnmsResource object.org.springframework.orm.ObjectRetrievalFailureExceptionprotected OnmsResource getChildResource(OnmsResource parentResource, String resourceType, String resource)
getChildResource
parentResource - a OnmsResource object.resourceType - a String object.resource - a String object.OnmsResource object.protected List<OnmsResource> getChildResourceList(OnmsResource parentResource)
getChildResourceList
parentResource - a OnmsResource object.List object.protected List<OnmsResource> findNodeResources()
TODO 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.
List object.public List<OnmsResource> findDomainResources()
findDomainResources in interface ResourceDaoList object.protected OnmsResource getNodeEntityResource(String resource)
getNodeEntityResource
resource - a String object.OnmsResource object.protected OnmsResource getForeignSourceNodeEntityResource(String resource)
getForeignSourceNodeEntityResource
resource - a String object.OnmsResource object.protected OnmsResource getDomainEntityResource(String domain)
getDomainEntityResource
domain - a String object.OnmsResource object.protected Set<String> findNodeSourceDirectories()
findNodeSourceDirectories
public static String decode(String string)
string - string to be decodedpublic OnmsResource getResourceForNode(OnmsNode node)
getResourceForNode
getResourceForNode in interface ResourceDaonode - a OnmsNode object.OnmsResource object.public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface)
ResourceDaogetResourceForIpInterface
getResourceForIpInterface in interface ResourceDaoipInterface - a OnmsIpInterface object.responseTime resource on the interface or
null if the responseTime resource cannot be found for the given IP interface.public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface, OnmsLocationMonitor locMon)
ResourceDaogetResourceForIpInterface
getResourceForIpInterface in interface ResourceDaoipInterface - a OnmsIpInterface object.locMon - a OnmsLocationMonitor object.distributedStatus resource on the interface or
null if the distributedStatus resource cannot be found for the given IP interface.public List<OnmsResource> findTopLevelResources()
findTopLevelResources
findTopLevelResources in interface ResourceDaoList object.Copyright © 2015. All rights reserved.