Package org.opennms.netmgt.dao.mock
Class MockHwEntityDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsHwEntity,Integer>
-
- org.opennms.netmgt.dao.mock.MockHwEntityDao
-
- All Implemented Interfaces:
HwEntityDao
,LegacyOnmsDao<OnmsHwEntity,Integer>
,OnmsDao<OnmsHwEntity,Integer>
,org.springframework.beans.factory.InitializingBean
public class MockHwEntityDao extends AbstractMockDao<OnmsHwEntity,Integer> implements HwEntityDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockHwEntityDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnmsHwEntity
findEntityByIndex(Integer nodeId, Integer entPhysicalIndex)
Find entity by index.OnmsHwEntity
findEntityByName(Integer nodeId, String entPhysicalName)
Find entity by name.OnmsHwEntity
findRootByNodeId(Integer nodeId)
Find root by node id.OnmsHwEntity
findRootEntityByNodeId(Integer nodeId)
Better performant than #findRootByNodeId.protected void
generateId(OnmsHwEntity outage)
String
getAttributeValue(Integer nodeId, Integer entPhysicalIndex, String attributeName)
Gets the attribute value.String
getAttributeValue(Integer nodeId, String nameSource, String attributeName)
Gets the attribute value.protected Integer
getId(OnmsHwEntity outage)
-
Methods inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
afterPropertiesSet, clear, countAll, countMatching, countMatching, delete, delete, findAll, findMatching, findMatching, flush, get, getAlarmAssociationDao, getAlarmDao, getAssetRecordDao, getCategoryDao, getDistPollerDao, getEventDao, getIpInterfaceDao, getMonitoredServiceDao, getMonitoringLocationDao, getNodeDao, getServiceRegistry, getServiceTypeDao, getSnmpInterfaceDao, initialize, load, lock, save, saveOrUpdate, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.dao.api.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
generateId
protected void generateId(OnmsHwEntity outage)
- Specified by:
generateId
in classAbstractMockDao<OnmsHwEntity,Integer>
-
getId
protected Integer getId(OnmsHwEntity outage)
- Specified by:
getId
in classAbstractMockDao<OnmsHwEntity,Integer>
-
findRootByNodeId
public OnmsHwEntity findRootByNodeId(Integer nodeId)
Description copied from interface:HwEntityDao
Find root by node id.- Specified by:
findRootByNodeId
in interfaceHwEntityDao
- Parameters:
nodeId
- the node id- Returns:
- the OpenNMS hardware entity
-
findRootEntityByNodeId
public OnmsHwEntity findRootEntityByNodeId(Integer nodeId)
Description copied from interface:HwEntityDao
Better performant than #findRootByNodeId. Useful when dealing with large trees. See NMS-13256 Find root by node id- Specified by:
findRootEntityByNodeId
in interfaceHwEntityDao
- Parameters:
nodeId
- the node id- Returns:
- the OpenNMS hardware entity
-
findEntityByIndex
public OnmsHwEntity findEntityByIndex(Integer nodeId, Integer entPhysicalIndex)
Description copied from interface:HwEntityDao
Find entity by index.- Specified by:
findEntityByIndex
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalIndex
- the entity physical index- Returns:
- the OpenNMS hardware entity
-
findEntityByName
public OnmsHwEntity findEntityByName(Integer nodeId, String entPhysicalName)
Description copied from interface:HwEntityDao
Find entity by name.- Specified by:
findEntityByName
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalName
- the entity physical name- Returns:
- the OpenNMS hardware entity
-
getAttributeValue
public String getAttributeValue(Integer nodeId, Integer entPhysicalIndex, String attributeName)
Description copied from interface:HwEntityDao
Gets the attribute value.- Specified by:
getAttributeValue
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalIndex
- the entity physical indexattributeName
- the name of the desired attribute- Returns:
- the attribute value
-
getAttributeValue
public String getAttributeValue(Integer nodeId, String nameSource, String attributeName)
Description copied from interface:HwEntityDao
Gets the attribute value.- Specified by:
getAttributeValue
in interfaceHwEntityDao
- Parameters:
nodeId
- the node idnameSource
- either the value of entPhysicalName or a regular expression to be applied over the entPhysicalName (should start with '~')attributeName
- the name of the desired attribute- Returns:
- the attribute value
-
-