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 OnmsHwEntityfindEntityByIndex(Integer nodeId, Integer entPhysicalIndex)Find entity by index.OnmsHwEntityfindEntityByName(Integer nodeId, String entPhysicalName)Find entity by name.OnmsHwEntityfindRootByNodeId(Integer nodeId)Find root by node id.OnmsHwEntityfindRootEntityByNodeId(Integer nodeId)Better performant than #findRootByNodeId.protected voidgenerateId(OnmsHwEntity outage)StringgetAttributeValue(Integer nodeId, Integer entPhysicalIndex, String attributeName)Gets the attribute value.StringgetAttributeValue(Integer nodeId, String nameSource, String attributeName)Gets the attribute value.protected IntegergetId(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:
generateIdin classAbstractMockDao<OnmsHwEntity,Integer>
-
getId
protected Integer getId(OnmsHwEntity outage)
- Specified by:
getIdin classAbstractMockDao<OnmsHwEntity,Integer>
-
findRootByNodeId
public OnmsHwEntity findRootByNodeId(Integer nodeId)
Description copied from interface:HwEntityDaoFind root by node id.- Specified by:
findRootByNodeIdin interfaceHwEntityDao- Parameters:
nodeId- the node id- Returns:
- the OpenNMS hardware entity
-
findRootEntityByNodeId
public OnmsHwEntity findRootEntityByNodeId(Integer nodeId)
Description copied from interface:HwEntityDaoBetter performant than #findRootByNodeId. Useful when dealing with large trees. See NMS-13256 Find root by node id- Specified by:
findRootEntityByNodeIdin interfaceHwEntityDao- Parameters:
nodeId- the node id- Returns:
- the OpenNMS hardware entity
-
findEntityByIndex
public OnmsHwEntity findEntityByIndex(Integer nodeId, Integer entPhysicalIndex)
Description copied from interface:HwEntityDaoFind entity by index.- Specified by:
findEntityByIndexin 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:HwEntityDaoFind entity by name.- Specified by:
findEntityByNamein 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:HwEntityDaoGets the attribute value.- Specified by:
getAttributeValuein 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:HwEntityDaoGets the attribute value.- Specified by:
getAttributeValuein 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
-
-