Package org.opennms.netmgt.dao.mock
Class MockIpInterfaceDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsIpInterface,Integer>
-
- org.opennms.netmgt.dao.mock.MockIpInterfaceDao
-
- All Implemented Interfaces:
IpInterfaceDao
,LegacyOnmsDao<OnmsIpInterface,Integer>
,OnmsDao<OnmsIpInterface,Integer>
,org.springframework.beans.factory.InitializingBean
public class MockIpInterfaceDao extends AbstractMockDao<OnmsIpInterface,Integer> implements IpInterfaceDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockIpInterfaceDao()
-
Method Summary
-
Methods inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
afterPropertiesSet, clear, countAll, countMatching, countMatching, delete, findAll, findMatching, findMatching, 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, findAll, findMatching, get, initialize, load, lock, saveOrUpdate
-
-
-
-
Method Detail
-
save
public Integer save(OnmsIpInterface iface)
- Specified by:
save
in interfaceOnmsDao<OnmsIpInterface,Integer>
- Overrides:
save
in classAbstractMockDao<OnmsIpInterface,Integer>
-
update
public void update(OnmsIpInterface iface)
- Specified by:
update
in interfaceOnmsDao<OnmsIpInterface,Integer>
- Overrides:
update
in classAbstractMockDao<OnmsIpInterface,Integer>
-
flush
public void flush()
- Specified by:
flush
in interfaceOnmsDao<OnmsIpInterface,Integer>
- Overrides:
flush
in classAbstractMockDao<OnmsIpInterface,Integer>
-
delete
public void delete(OnmsIpInterface iface)
- Specified by:
delete
in interfaceOnmsDao<OnmsIpInterface,Integer>
- Overrides:
delete
in classAbstractMockDao<OnmsIpInterface,Integer>
-
generateId
protected void generateId(OnmsIpInterface iface)
- Specified by:
generateId
in classAbstractMockDao<OnmsIpInterface,Integer>
-
getId
protected Integer getId(OnmsIpInterface iface)
- Specified by:
getId
in classAbstractMockDao<OnmsIpInterface,Integer>
-
get
public OnmsIpInterface get(OnmsNode node, String ipAddress)
Description copied from interface:IpInterfaceDao
get
- Specified by:
get
in interfaceIpInterfaceDao
- Parameters:
node
- aOnmsNode
object.ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
findByNodeIdAndIpAddress
public OnmsIpInterface findByNodeIdAndIpAddress(Integer nodeId, String ipAddress)
Description copied from interface:IpInterfaceDao
findByNodeIdAndIpAddress
- Specified by:
findByNodeIdAndIpAddress
in interfaceIpInterfaceDao
- Parameters:
nodeId
- aInteger
object.ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
findByForeignKeyAndIpAddress
public OnmsIpInterface findByForeignKeyAndIpAddress(String foreignSource, String foreignId, String ipAddress)
Description copied from interface:IpInterfaceDao
findByForeignKeyAndIpAddress
- Specified by:
findByForeignKeyAndIpAddress
in interfaceIpInterfaceDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
findByIpAddress
public List<OnmsIpInterface> findByIpAddress(String ipAddress)
Description copied from interface:IpInterfaceDao
findByIpAddress
- Specified by:
findByIpAddress
in interfaceIpInterfaceDao
- Parameters:
ipAddress
- aString
object.- Returns:
- a
Collection
object.
-
findByNodeId
public List<OnmsIpInterface> findByNodeId(Integer nodeId)
Description copied from interface:IpInterfaceDao
findByNodeId
- Specified by:
findByNodeId
in interfaceIpInterfaceDao
- Parameters:
nodeId
- aInteger
object.- Returns:
- a
Collection
object.
-
findByServiceType
public List<OnmsIpInterface> findByServiceType(String svcName)
Description copied from interface:IpInterfaceDao
findByServiceType
- Specified by:
findByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
findHierarchyByServiceType
public List<OnmsIpInterface> findHierarchyByServiceType(String svcName)
Description copied from interface:IpInterfaceDao
findHierarchyByServiceType
- Specified by:
findHierarchyByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
getInterfacesForNodes
public Map<InetAddress,Integer> getInterfacesForNodes()
Description copied from interface:IpInterfaceDao
Returns a map of all IP to node ID mappings in the database.- Specified by:
getInterfacesForNodes
in interfaceIpInterfaceDao
- Returns:
- a
Map
object.
-
findPrimaryInterfaceByNodeId
public OnmsIpInterface findPrimaryInterfaceByNodeId(Integer nodeId)
- Specified by:
findPrimaryInterfaceByNodeId
in interfaceIpInterfaceDao
-
findInterfacesWithMetadata
public List<OnmsIpInterface> findInterfacesWithMetadata(String context, String key, String value)
- Specified by:
findInterfacesWithMetadata
in interfaceIpInterfaceDao
-
findByMacLinksOfNode
public List<OnmsIpInterface> findByMacLinksOfNode(Integer nodeId)
Description copied from interface:IpInterfaceDao
Finds allOnmsIpInterface
instances that have anipAddress
that is related to a physical address that is equal to the mac address of aBridgeMacLink
of the addressednode
.- Specified by:
findByMacLinksOfNode
in interfaceIpInterfaceDao
- Returns:
-
findByIpAddressAndLocation
public List<OnmsIpInterface> findByIpAddressAndLocation(String location, String address)
- Specified by:
findByIpAddressAndLocation
in interfaceIpInterfaceDao
-
-