public class DefaultResourceDao extends Object implements ResourceDao, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description | 
|---|---|
static int | 
MAXIMUM_NODE_METRIC_RESOURCE_DEPTH
Largest depth at which we will find node related metrics:
 [0] will catch node-level resources
 [1] will catch interface-level resources
 [2] will catch generic index type resources 
 | 
| 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. 
 | 
boolean | 
deleteResource(OnmsResource resource,
              boolean recursive)  | 
boolean | 
deleteResourceById(ResourceId resourceId)
Deletes the resource identified by the given resource ID. 
 | 
List<OnmsResource> | 
findTopLevelResources()
findTopLevelResources 
 | 
protected OnmsResource | 
getChildResource(OnmsResource parentResource,
                String resourceType,
                String resource)
getChildResource 
 | 
CollectdConfigFactory | 
getCollectdConfig()
getCollectdConfig 
 | 
IpInterfaceDao | 
getIpInterfaceDao()  | 
LocationMonitorDao | 
getLocationMonitorDao()
getLocationMonitorDao 
 | 
NodeDao | 
getNodeDao()
getNodeDao 
 | 
OnmsResource | 
getResourceById(ResourceId id)
Fetch a specific resource by string ID. 
 | 
OnmsResource | 
getResourceForIpInterface(OnmsIpInterface ipInterface,
                         OnmsLocationMonitor locMon)
getResourceForIpInterface 
 | 
OnmsResource | 
getResourceForNode(OnmsNode node)
Creates a resource for the given node using the most
 appropriate type. 
 | 
ResourceStorageDao | 
getResourceStorageDao()  | 
Collection<OnmsResourceType> | 
getResourceTypes()
getResourceTypes 
 | 
ResourceTypesDao | 
getResourceTypesDao()  | 
protected boolean | 
hasAnyChildResources(OnmsResource resource)
Used to determine whether or not the given (parent) resource
 has any child resources. 
 | 
void | 
setCollectdConfig(CollectdConfigFactory collectdConfig)
setCollectdConfig 
 | 
void | 
setIpInterfaceDao(IpInterfaceDao ipInterfaceDao)  | 
void | 
setLocationMonitorDao(LocationMonitorDao locationMonitorDao)
setLocationMonitorDao 
 | 
void | 
setNodeDao(NodeDao nodeDao)
setNodeDao 
 | 
void | 
setResourceStorageDao(ResourceStorageDao resourceStorageDao)  | 
void | 
setResourceTypesDao(ResourceTypesDao resourceTypesDao)  | 
public static final int MAXIMUM_NODE_METRIC_RESOURCE_DEPTH
public DefaultResourceDao()
Constructor for DefaultResourceDao.
public ResourceTypesDao getResourceTypesDao()
public void setResourceTypesDao(ResourceTypesDao resourceTypesDao)
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 setResourceStorageDao(ResourceStorageDao resourceStorageDao)
public ResourceStorageDao getResourceStorageDao()
public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic Collection<OnmsResourceType> getResourceTypes()
getResourceTypes
getResourceTypes in interface ResourceDaoCollection object.@Transactional(readOnly=true) public List<OnmsResource> findTopLevelResources()
findTopLevelResources
findTopLevelResources in interface ResourceDaoList object.protected boolean hasAnyChildResources(OnmsResource resource)
@Transactional(readOnly=true) public OnmsResource getResourceById(ResourceId 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 OnmsResource getResourceForNode(OnmsNode node)
getResourceForNode in interface ResourceDaonode - a OnmsNode object.OnmsResource object.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 boolean deleteResourceById(ResourceId resourceId)
ResourceDaodeleteResourceById in interface ResourceDaoresourceId - the ID of the resource to deletetrue iff, the resource was found and deletedpublic boolean deleteResource(OnmsResource resource, boolean recursive)
protected OnmsResource getChildResource(OnmsResource parentResource, String resourceType, String resource)
getChildResource
parentResource - a OnmsResource object.resourceType - a String object.resource - a String object.OnmsResource object.Copyright © 2020. All rights reserved.