Package org.opennms.netmgt.dao.hibernate
Class IpInterfaceDaoHibernate
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<OnmsIpInterface,Integer>
-
- org.opennms.netmgt.dao.hibernate.IpInterfaceDaoHibernate
-
- All Implemented Interfaces:
IpInterfaceDao
,LegacyOnmsDao<OnmsIpInterface,Integer>
,OnmsDao<OnmsIpInterface,Integer>
,org.springframework.beans.factory.InitializingBean
public class IpInterfaceDaoHibernate extends AbstractDaoHibernate<OnmsIpInterface,Integer> implements IpInterfaceDao
IpInterfaceDaoHibernate class.
- Author:
- david
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description IpInterfaceDaoHibernate()
Constructor for IpInterfaceDaoHibernate.
-
Method Summary
-
Methods inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
buildHibernateCallback, bulkDelete, clear, countAll, countMatching, countMatching, delete, delete, deleteAll, find, find, findAll, findMatching, findMatching, findObjects, findUnique, flush, get, initDao, initialize, load, lock, merge, queryInt, queryInt, save, saveOrUpdate, update
-
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
-
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, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
get
public OnmsIpInterface get(OnmsNode node, String ipAddress)
get
- Specified by:
get
in interfaceIpInterfaceDao
- Parameters:
node
- aOnmsNode
object.ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
findByIpAddress
public List<OnmsIpInterface> findByIpAddress(String ipAddress)
findByIpAddress
- Specified by:
findByIpAddress
in interfaceIpInterfaceDao
- Parameters:
ipAddress
- aString
object.- Returns:
- a
Collection
object.
-
findByNodeId
public List<OnmsIpInterface> findByNodeId(Integer nodeId)
findByNodeId
- Specified by:
findByNodeId
in interfaceIpInterfaceDao
- Parameters:
nodeId
- aInteger
object.- Returns:
- a
Collection
object.
-
findByNodeIdAndIpAddress
public OnmsIpInterface findByNodeIdAndIpAddress(Integer nodeId, String ipAddress)
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)
findByForeignKeyAndIpAddress
- Specified by:
findByForeignKeyAndIpAddress
in interfaceIpInterfaceDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
findByServiceType
public List<OnmsIpInterface> findByServiceType(String svcName)
findByServiceType
- Specified by:
findByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
findHierarchyByServiceType
public List<OnmsIpInterface> findHierarchyByServiceType(String svcName)
findHierarchyByServiceType
- Specified by:
findHierarchyByServiceType
in interfaceIpInterfaceDao
- Parameters:
svcName
- aString
object.- Returns:
- a
Collection
object.
-
getInterfacesForNodes
public Map<InetAddress,Integer> getInterfacesForNodes()
TODO: This function should filter out deleted interfaces- Specified by:
getInterfacesForNodes
in interfaceIpInterfaceDao
- Returns:
- a
Map
object.
-
addressExistsWithForeignSource
public boolean addressExistsWithForeignSource(String ipAddress, String foreignSource)
addressExistsWithForeignSource
-
findPrimaryInterfaceByNodeId
public OnmsIpInterface findPrimaryInterfaceByNodeId(Integer nodeId)
This function should be kept similar toOnmsNode.getPrimaryInterface()
.- Specified by:
findPrimaryInterfaceByNodeId
in interfaceIpInterfaceDao
-
findInterfacesWithMetadata
public List<OnmsIpInterface> findInterfacesWithMetadata(String context, String key, String value)
- Specified by:
findInterfacesWithMetadata
in interfaceIpInterfaceDao
-
-