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 ResourceDao
File
object.public File getRrdDirectory(boolean verify)
getRrdDirectory
getRrdDirectory
in interface ResourceDao
verify
- 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.InitializingBean
IOException
- if any.public Collection<OnmsResourceType> getResourceTypes()
getResourceTypes
getResourceTypes
in interface ResourceDao
Collection
object.public OnmsResource getResourceById(String id)
getResourceById
in interface ResourceDao
id
- 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 ResourceDao
id
- 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.ObjectRetrievalFailureException
protected 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 ResourceDao
List
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 ResourceDao
node
- a OnmsNode
object.OnmsResource
object.public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface)
ResourceDao
getResourceForIpInterface
getResourceForIpInterface
in interface ResourceDao
ipInterface
- 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)
ResourceDao
getResourceForIpInterface
getResourceForIpInterface
in interface ResourceDao
ipInterface
- 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 ResourceDao
List
object.Copyright © 2015. All rights reserved.