Package org.opennms.netmgt.dao.hibernate
Class NodeDaoHibernate
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<OnmsNode,Integer>
-
- org.opennms.netmgt.dao.hibernate.NodeDaoHibernate
-
- All Implemented Interfaces:
LegacyOnmsDao<OnmsNode,Integer>
,NodeDao
,OnmsDao<OnmsNode,Integer>
,org.springframework.beans.factory.InitializingBean
public class NodeDaoHibernate extends AbstractDaoHibernate<OnmsNode,Integer> implements NodeDao
NodeDaoHibernate class.
- Author:
- Ted Kazmark, David Hustace
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeDaoHibernate.SimpleSurveillanceStatus
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description NodeDaoHibernate()
Constructor for NodeDaoHibernate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
deleteObsoleteInterfacesList<OnmsNode>
findAll()
findAllList<OnmsNode>
findAllByCategoryList(Collection<OnmsCategory> categories)
findAllByCategoryListList<OnmsNode>
findAllByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
findAllByCategoryListsList<OnmsNode>
findAllByVarCharAssetColumn(String columnName, String columnValue)
findAllByVarCharAssetColumnList<OnmsNode>
findAllByVarCharAssetColumnCategoryList(String columnName, String columnValue, Collection<OnmsCategory> categories)
findAllByVarCharAssetColumnCategoryListList<OnmsNode>
findAllHavingEgressFlows()
List<OnmsNode>
findAllHavingFlows()
List<OnmsNode>
findAllHavingIngressFlows()
List<OnmsNode>
findAllProvisionedNodes()
findAllProvisionedNodesList<OnmsNode>
findByCategory(OnmsCategory category)
findByCategoryList<OnmsNode>
findByForeignId(String foreignId)
findByForeignIdOnmsNode
findByForeignId(String foreignSource, String foreignId)
findByForeignIdList<OnmsNode>
findByForeignIdForLocation(String foreignId, String location)
findByForeignIdForLocationList<OnmsNode>
findByForeignSource(String foreignSource)
findByForeignSourceList<OnmsNode>
findByForeignSourceAndIpAddress(String foreignSource, String ipAddress)
findByForeignSourceAndIpAddressList<OnmsNode>
findByIpAddressAndService(InetAddress ipAddress, String serviceName)
List<OnmsNode>
findByLabel(String label)
findByLabelList<OnmsNode>
findByLabelForLocation(String label, String location)
findByLabelList<OnmsNode>
findBySysNameOfLldpLinksOfNode(int nodeId)
Returns all OnmsNodes that have a sysname that matches remSysName of an lldp link that is related to the given node.List<OnmsNode>
findNodeWithMetaData(String context, String key, String value)
List<OnmsIpInterface>
findObsoleteIpInterfaces(Integer nodeId, Date scanStamp)
findObsoleteIpInterfacesSurveillanceStatus
findSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
OnmsNode
get(String lookupCriteria)
Get a node based on it's node ID or foreignSource:foreignIdMap<Integer,String>
getAllLabelsById()
Retrieves all of node id/label tuples.OnmsNode
getDefaultFocusPoint()
Set<String>
getForeignIdsPerForeignSource(String foreignSource)
getForeignIdsPerForeignSourceMap<String,Set<String>>
getForeignIdsPerForeignSourceMap()
getForeignIdsPerForeignSourceMapMap<String,Integer>
getForeignIdToNodeIdMap(String foreignSource)
getForeignIdToNodeIdMapOnmsNode
getHierarchy(Integer id)
getHierarchyString
getLabelForId(Integer id)
Test the ability to simply retrieve a String object (node label) without having to return a bulky Node object.String
getLocationForId(Integer id)
Light weight call to simply get the node location without loading the entire node.Integer
getNextNodeId(Integer nodeId)
int
getNodeCountForForeignSource(String foreignSource)
getNodeCountForForeignSourceCollection<Integer>
getNodeIds()
getNodeIdsMap<String,Long>
getNumberOfNodesBySysOid()
Retrieves the number of nodes for each sysOid.Integer
getPreviousNodeId(Integer nodeId)
void
markHavingFlows(Collection<Integer> ingressIds, Collection<Integer> egressIds)
void
updateNodeScanStamp(Integer nodeId, Date scanStamp)
updateNodeScanStamp-
Methods inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
buildHibernateCallback, bulkDelete, clear, countAll, countMatching, countMatching, delete, delete, deleteAll, find, find, 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, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
get
public OnmsNode get(String lookupCriteria)
Get a node based on it's node ID or foreignSource:foreignId
-
getLabelForId
public String getLabelForId(Integer id)
Test the ability to simply retrieve a String object (node label) without having to return a bulky Node object.- Specified by:
getLabelForId
in interfaceNodeDao
- Returns:
- A String representing the provisioned label for the node. Returns null if not found.
-
getLocationForId
public String getLocationForId(Integer id)
Description copied from interface:NodeDao
Light weight call to simply get the node location without loading the entire node.- Specified by:
getLocationForId
in interfaceNodeDao
- Returns:
- A String representing the provisioned label for the node. Returns null if not found.
-
getAllLabelsById
public Map<Integer,String> getAllLabelsById()
Retrieves all of node id/label tuples. Can be used as a lightweight alternative to findAll().- Specified by:
getAllLabelsById
in interfaceNodeDao
- Returns:
- a
Map
containing all node ids and their associated labels.
-
getForeignIdsPerForeignSourceMap
public Map<String,Set<String>> getForeignIdsPerForeignSourceMap()
getForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMap
in interfaceNodeDao
- Returns:
- a
Map
object.
-
getForeignIdsPerForeignSource
public Set<String> getForeignIdsPerForeignSource(String foreignSource)
getForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Set
object.
-
findByForeignId
public List<OnmsNode> findByForeignId(String foreignId)
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.- Returns:
- a
List
object.
-
findByForeignIdForLocation
public List<OnmsNode> findByForeignIdForLocation(String foreignId, String location)
findByForeignIdForLocation
- Specified by:
findByForeignIdForLocation
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.location
- aString
object.- Returns:
- a
List
object.
-
getHierarchy
public OnmsNode getHierarchy(Integer id)
getHierarchy
- Specified by:
getHierarchy
in interfaceNodeDao
- Parameters:
id
- aInteger
object.- Returns:
- a
OnmsNode
object.
-
findByLabel
public List<OnmsNode> findByLabel(String label)
findByLabel
- Specified by:
findByLabel
in interfaceNodeDao
- Parameters:
label
- aString
object.- Returns:
- a
Collection
object.
-
findByLabelForLocation
public List<OnmsNode> findByLabelForLocation(String label, String location)
findByLabel
- Specified by:
findByLabelForLocation
in interfaceNodeDao
- Parameters:
label
- aString
object.location
- aString
object.- Returns:
- a
Collection
object.
-
findAllByVarCharAssetColumn
public List<OnmsNode> findAllByVarCharAssetColumn(String columnName, String columnValue)
findAllByVarCharAssetColumn
- Specified by:
findAllByVarCharAssetColumn
in interfaceNodeDao
- Parameters:
columnName
- aString
object.columnValue
- aString
object.- Returns:
- a
Collection
object.
-
findAllByVarCharAssetColumnCategoryList
public List<OnmsNode> findAllByVarCharAssetColumnCategoryList(String columnName, String columnValue, Collection<OnmsCategory> categories)
findAllByVarCharAssetColumnCategoryList
- Specified by:
findAllByVarCharAssetColumnCategoryList
in interfaceNodeDao
- Parameters:
columnName
- aString
object.columnValue
- aString
object.categories
- aCollection
object.- Returns:
- a
Collection
object.
-
findByCategory
public List<OnmsNode> findByCategory(OnmsCategory category)
findByCategory
- Specified by:
findByCategory
in interfaceNodeDao
- Parameters:
category
- aOnmsCategory
object.- Returns:
- a
Collection
object.
-
findAllByCategoryList
public List<OnmsNode> findAllByCategoryList(Collection<OnmsCategory> categories)
findAllByCategoryList
- Specified by:
findAllByCategoryList
in interfaceNodeDao
- Parameters:
categories
- aCollection
object.- Returns:
- a
Collection
object.
-
findAllByCategoryLists
public List<OnmsNode> findAllByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
findAllByCategoryLists
- Specified by:
findAllByCategoryLists
in interfaceNodeDao
- Parameters:
rowCategories
- aCollection
object.columnCategories
- aCollection
object.- Returns:
- a
Collection
object.
-
findSurveillanceStatusByCategoryLists
public SurveillanceStatus findSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryLists
in interfaceNodeDao
-
getForeignIdToNodeIdMap
public Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
getForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMap
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Map
object.
-
findByForeignSource
public List<OnmsNode> findByForeignSource(String foreignSource)
findByForeignSource
- Specified by:
findByForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
List
object.
-
findByForeignId
public OnmsNode findByForeignId(String foreignSource, String foreignId)
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.- Returns:
- a
OnmsNode
object.
-
findByForeignSourceAndIpAddress
public List<OnmsNode> findByForeignSourceAndIpAddress(String foreignSource, String ipAddress)
findByForeignSourceAndIpAddress
- Specified by:
findByForeignSourceAndIpAddress
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.ipAddress
- aString
object.- Returns:
- a
List
object.
-
getNodeCountForForeignSource
public int getNodeCountForForeignSource(String foreignSource)
getNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a int.
-
findAllProvisionedNodes
public List<OnmsNode> findAllProvisionedNodes()
findAllProvisionedNodes
- Specified by:
findAllProvisionedNodes
in interfaceNodeDao
- Returns:
- a
List
object.
-
findByIpAddressAndService
public List<OnmsNode> findByIpAddressAndService(InetAddress ipAddress, String serviceName)
- Specified by:
findByIpAddressAndService
in interfaceNodeDao
-
findObsoleteIpInterfaces
public List<OnmsIpInterface> findObsoleteIpInterfaces(Integer nodeId, Date scanStamp)
findObsoleteIpInterfaces
- Specified by:
findObsoleteIpInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.- Returns:
- a
List
object.
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
deleteObsoleteInterfaces
- Specified by:
deleteObsoleteInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
updateNodeScanStamp
public void updateNodeScanStamp(Integer nodeId, Date scanStamp)
updateNodeScanStamp
- Specified by:
updateNodeScanStamp
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
getNodeIds
public Collection<Integer> getNodeIds()
getNodeIds
- Specified by:
getNodeIds
in interfaceNodeDao
- Returns:
- a
Collection
object.
-
getNumberOfNodesBySysOid
public Map<String,Long> getNumberOfNodesBySysOid()
Retrieves the number of nodes for each sysOid.- Specified by:
getNumberOfNodesBySysOid
in interfaceNodeDao
- Returns:
- a
Map
containing the number of nodes for each sysOid
-
getNextNodeId
public Integer getNextNodeId(Integer nodeId)
- Specified by:
getNextNodeId
in interfaceNodeDao
-
getPreviousNodeId
public Integer getPreviousNodeId(Integer nodeId)
- Specified by:
getPreviousNodeId
in interfaceNodeDao
-
markHavingFlows
public void markHavingFlows(Collection<Integer> ingressIds, Collection<Integer> egressIds)
- Specified by:
markHavingFlows
in interfaceNodeDao
-
findAllHavingFlows
public List<OnmsNode> findAllHavingFlows()
- Specified by:
findAllHavingFlows
in interfaceNodeDao
-
findAllHavingIngressFlows
public List<OnmsNode> findAllHavingIngressFlows()
- Specified by:
findAllHavingIngressFlows
in interfaceNodeDao
-
findAllHavingEgressFlows
public List<OnmsNode> findAllHavingEgressFlows()
- Specified by:
findAllHavingEgressFlows
in interfaceNodeDao
-
findBySysNameOfLldpLinksOfNode
public List<OnmsNode> findBySysNameOfLldpLinksOfNode(int nodeId)
Description copied from interface:NodeDao
Returns all OnmsNodes that have a sysname that matches remSysName of an lldp link that is related to the given node. Used to retrieve all OnmsNodes that need to be accessed when finding the lldp links of a node.- Specified by:
findBySysNameOfLldpLinksOfNode
in interfaceNodeDao
-
getDefaultFocusPoint
public OnmsNode getDefaultFocusPoint()
- Specified by:
getDefaultFocusPoint
in interfaceNodeDao
-
-