Package org.opennms.netmgt.dao.mock
Class MockSnmpInterfaceDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsSnmpInterface,Integer>
-
- org.opennms.netmgt.dao.mock.MockSnmpInterfaceDao
-
- All Implemented Interfaces:
LegacyOnmsDao<OnmsSnmpInterface,Integer>
,OnmsDao<OnmsSnmpInterface,Integer>
,SnmpInterfaceDao
,org.springframework.beans.factory.InitializingBean
public class MockSnmpInterfaceDao extends AbstractMockDao<OnmsSnmpInterface,Integer> implements SnmpInterfaceDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockSnmpInterfaceDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<OnmsSnmpInterface>
findAllHavingEgressFlows(Integer nodeId)
List<OnmsSnmpInterface>
findAllHavingFlows(Integer nodeId)
List<OnmsSnmpInterface>
findAllHavingIngressFlows(Integer nodeId)
OnmsSnmpInterface
findByForeignKeyAndIfIndex(String foreignSource, String foreignId, Integer ifIndex)
findByForeignKeyAndIfIndexList<OnmsSnmpInterface>
findByMacLinksOfNode(Integer nodeId)
List<OnmsSnmpInterface>
findByNodeId(Integer nodeId)
OnmsSnmpInterface
findByNodeIdAndDescription(Integer nodeId, String description)
OnmsSnmpInterface
findByNodeIdAndIfIndex(Integer nodeId, Integer ifIndex)
findByNodeIdAndIfIndexList<OnmsSnmpInterface>
findBySnpaAddressOfRelatedIsIsLink(int nodeId)
Returns all OnmsSnmpInterfaces that have a physAddr that matches an isisISAdjNeighSNPAAddress of an IsIsLink related to the given node.protected void
generateId(OnmsSnmpInterface iface)
protected Integer
getId(OnmsSnmpInterface iface)
long
getNumInterfacesWithFlows()
Returns the number of interfaces that have been marked as having flows irrespective of the MAX_FLOW_AGE and INGRESS_AND_EGRESS_REQUIRED properties settings.void
markHavingEgressFlows(Integer nodeId, Collection<Integer> egressSnmpIfIndexes)
void
markHavingIngressFlows(Integer nodeId, Collection<Integer> ingressSnmpIfIndexes)
Integer
save(OnmsSnmpInterface iface)
void
update(OnmsSnmpInterface iface)
-
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, saveOrUpdate
-
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.LegacyOnmsDao
countMatching, findMatching
-
Methods inherited from interface org.opennms.netmgt.dao.api.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, saveOrUpdate
-
-
-
-
Method Detail
-
save
public Integer save(OnmsSnmpInterface iface)
- Specified by:
save
in interfaceOnmsDao<OnmsSnmpInterface,Integer>
- Overrides:
save
in classAbstractMockDao<OnmsSnmpInterface,Integer>
-
update
public void update(OnmsSnmpInterface iface)
- Specified by:
update
in interfaceOnmsDao<OnmsSnmpInterface,Integer>
- Overrides:
update
in classAbstractMockDao<OnmsSnmpInterface,Integer>
-
generateId
protected void generateId(OnmsSnmpInterface iface)
- Specified by:
generateId
in classAbstractMockDao<OnmsSnmpInterface,Integer>
-
getId
protected Integer getId(OnmsSnmpInterface iface)
- Specified by:
getId
in classAbstractMockDao<OnmsSnmpInterface,Integer>
-
findByNodeIdAndIfIndex
public OnmsSnmpInterface findByNodeIdAndIfIndex(Integer nodeId, Integer ifIndex)
Description copied from interface:SnmpInterfaceDao
findByNodeIdAndIfIndex
- Specified by:
findByNodeIdAndIfIndex
in interfaceSnmpInterfaceDao
- Parameters:
nodeId
- aInteger
object.ifIndex
- aInteger
object.- Returns:
- a
OnmsSnmpInterface
object.
-
findByNodeId
public List<OnmsSnmpInterface> findByNodeId(Integer nodeId)
- Specified by:
findByNodeId
in interfaceSnmpInterfaceDao
-
findByMacLinksOfNode
public List<OnmsSnmpInterface> findByMacLinksOfNode(Integer nodeId)
- Specified by:
findByMacLinksOfNode
in interfaceSnmpInterfaceDao
-
findBySnpaAddressOfRelatedIsIsLink
public List<OnmsSnmpInterface> findBySnpaAddressOfRelatedIsIsLink(int nodeId)
Description copied from interface:SnmpInterfaceDao
Returns all OnmsSnmpInterfaces that have a physAddr that matches an isisISAdjNeighSNPAAddress of an IsIsLink related to the given node. Used to retrieve all OnmsSnmpInterfaces that need to be accessed when finding IsIs links of a node.- Specified by:
findBySnpaAddressOfRelatedIsIsLink
in interfaceSnmpInterfaceDao
-
findByForeignKeyAndIfIndex
public OnmsSnmpInterface findByForeignKeyAndIfIndex(String foreignSource, String foreignId, Integer ifIndex)
Description copied from interface:SnmpInterfaceDao
findByForeignKeyAndIfIndex
- Specified by:
findByForeignKeyAndIfIndex
in interfaceSnmpInterfaceDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.ifIndex
- aInteger
object.- Returns:
- a
OnmsSnmpInterface
object.
-
findByNodeIdAndDescription
public OnmsSnmpInterface findByNodeIdAndDescription(Integer nodeId, String description)
- Specified by:
findByNodeIdAndDescription
in interfaceSnmpInterfaceDao
-
markHavingIngressFlows
public void markHavingIngressFlows(Integer nodeId, Collection<Integer> ingressSnmpIfIndexes)
- Specified by:
markHavingIngressFlows
in interfaceSnmpInterfaceDao
-
markHavingEgressFlows
public void markHavingEgressFlows(Integer nodeId, Collection<Integer> egressSnmpIfIndexes)
- Specified by:
markHavingEgressFlows
in interfaceSnmpInterfaceDao
-
findAllHavingFlows
public List<OnmsSnmpInterface> findAllHavingFlows(Integer nodeId)
- Specified by:
findAllHavingFlows
in interfaceSnmpInterfaceDao
-
findAllHavingIngressFlows
public List<OnmsSnmpInterface> findAllHavingIngressFlows(Integer nodeId)
- Specified by:
findAllHavingIngressFlows
in interfaceSnmpInterfaceDao
-
findAllHavingEgressFlows
public List<OnmsSnmpInterface> findAllHavingEgressFlows(Integer nodeId)
- Specified by:
findAllHavingEgressFlows
in interfaceSnmpInterfaceDao
-
getNumInterfacesWithFlows
public long getNumInterfacesWithFlows()
Description copied from interface:SnmpInterfaceDao
Returns the number of interfaces that have been marked as having flows irrespective of the MAX_FLOW_AGE and INGRESS_AND_EGRESS_REQUIRED properties settings.- Specified by:
getNumInterfacesWithFlows
in interfaceSnmpInterfaceDao
-
-