Package org.opennms.netmgt.dao.mock
Class MockIpInterfaceDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
- org.opennms.netmgt.dao.mock.MockIpInterfaceDao
-
- All Implemented Interfaces:
IpInterfaceDao
,LegacyOnmsDao<OnmsIpInterface,java.lang.Integer>
,OnmsDao<OnmsIpInterface,java.lang.Integer>
,org.springframework.beans.factory.InitializingBean
public class MockIpInterfaceDao extends AbstractMockDao<OnmsIpInterface,java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(OnmsIpInterface iface)
OnmsIpInterface
findByForeignKeyAndIpAddress(java.lang.String foreignSource, java.lang.String foreignId, java.lang.String ipAddress)
findByForeignKeyAndIpAddressjava.util.List<OnmsIpInterface>
findByIpAddress(java.lang.String ipAddress)
findByIpAddressjava.util.List<OnmsIpInterface>
findByNodeId(java.lang.Integer nodeId)
findByNodeIdOnmsIpInterface
findByNodeIdAndIpAddress(java.lang.Integer nodeId, java.lang.String ipAddress)
findByNodeIdAndIpAddressjava.util.List<OnmsIpInterface>
findByServiceType(java.lang.String svcName)
findByServiceTypejava.util.List<OnmsIpInterface>
findHierarchyByServiceType(java.lang.String svcName)
findHierarchyByServiceTypejava.util.List<OnmsIpInterface>
findInterfacesWithMetadata(java.lang.String context, java.lang.String key, java.lang.String value)
OnmsIpInterface
findPrimaryInterfaceByNodeId(java.lang.Integer nodeId)
void
flush()
protected void
generateId(OnmsIpInterface iface)
OnmsIpInterface
get(OnmsNode node, java.lang.String ipAddress)
getprotected java.lang.Integer
getId(OnmsIpInterface iface)
java.util.Map<java.net.InetAddress,java.lang.Integer>
getInterfacesForNodes()
Returns a map of all IP to node ID mappings in the database.java.lang.Integer
save(OnmsIpInterface iface)
void
update(OnmsIpInterface iface)
-
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 java.lang.Integer save(OnmsIpInterface iface)
- Specified by:
save
in interfaceOnmsDao<OnmsIpInterface,java.lang.Integer>
- Overrides:
save
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
update
public void update(OnmsIpInterface iface)
- Specified by:
update
in interfaceOnmsDao<OnmsIpInterface,java.lang.Integer>
- Overrides:
update
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
flush
public void flush()
- Specified by:
flush
in interfaceOnmsDao<OnmsIpInterface,java.lang.Integer>
- Overrides:
flush
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
delete
public void delete(OnmsIpInterface iface)
- Specified by:
delete
in interfaceOnmsDao<OnmsIpInterface,java.lang.Integer>
- Overrides:
delete
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
generateId
protected void generateId(OnmsIpInterface iface)
- Specified by:
generateId
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
getId
protected java.lang.Integer getId(OnmsIpInterface iface)
- Specified by:
getId
in classAbstractMockDao<OnmsIpInterface,java.lang.Integer>
-
get
public OnmsIpInterface get(OnmsNode node, java.lang.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(java.lang.Integer nodeId, java.lang.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(java.lang.String foreignSource, java.lang.String foreignId, java.lang.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 java.util.List<OnmsIpInterface> findByIpAddress(java.lang.String ipAddress)
Description copied from interface:IpInterfaceDao
findByIpAddress
- Specified by:
findByIpAddress
in interfaceIpInterfaceDao
- Parameters:
ipAddress
- aString
object.- Returns:
- a
Collection
object.
-
findByNodeId
public java.util.List<OnmsIpInterface> findByNodeId(java.lang.Integer nodeId)
Description copied from interface:IpInterfaceDao
findByNodeId
- Specified by:
findByNodeId
in interfaceIpInterfaceDao
- Parameters:
nodeId
- aInteger
object.- Returns:
- a
Collection
object.
-
findByServiceType
public java.util.List<OnmsIpInterface> findByServiceType(java.lang.String svcName)
Description copied from interface:IpInterfaceDao
findByServiceType
- Specified by:
findByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
findHierarchyByServiceType
public java.util.List<OnmsIpInterface> findHierarchyByServiceType(java.lang.String svcName)
Description copied from interface:IpInterfaceDao
findHierarchyByServiceType
- Specified by:
findHierarchyByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
getInterfacesForNodes
public java.util.Map<java.net.InetAddress,java.lang.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(java.lang.Integer nodeId)
- Specified by:
findPrimaryInterfaceByNodeId
in interfaceIpInterfaceDao
-
findInterfacesWithMetadata
public java.util.List<OnmsIpInterface> findInterfacesWithMetadata(java.lang.String context, java.lang.String key, java.lang.String value)
- Specified by:
findInterfacesWithMetadata
in interfaceIpInterfaceDao
-
-