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,java.lang.Integer>
-
- org.opennms.netmgt.dao.hibernate.NodeDaoHibernate
-
- All Implemented Interfaces:
LegacyOnmsDao<OnmsNode,java.lang.Integer>
,NodeDao
,OnmsDao<OnmsNode,java.lang.Integer>
,org.springframework.beans.factory.InitializingBean
public class NodeDaoHibernate extends AbstractDaoHibernate<OnmsNode,java.lang.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(java.lang.Integer nodeId, java.util.Date scanStamp)
deleteObsoleteInterfacesjava.util.List<OnmsNode>
findAll()
findAlljava.util.List<OnmsNode>
findAllByCategoryList(java.util.Collection<OnmsCategory> categories)
findAllByCategoryListjava.util.List<OnmsNode>
findAllByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
findAllByCategoryListsjava.util.List<OnmsNode>
findAllByVarCharAssetColumn(java.lang.String columnName, java.lang.String columnValue)
findAllByVarCharAssetColumnjava.util.List<OnmsNode>
findAllByVarCharAssetColumnCategoryList(java.lang.String columnName, java.lang.String columnValue, java.util.Collection<OnmsCategory> categories)
findAllByVarCharAssetColumnCategoryListjava.util.List<OnmsNode>
findAllHavingEgressFlows()
java.util.List<OnmsNode>
findAllHavingFlows()
java.util.List<OnmsNode>
findAllHavingIngressFlows()
java.util.List<OnmsNode>
findAllProvisionedNodes()
findAllProvisionedNodesjava.util.List<OnmsNode>
findByCategory(OnmsCategory category)
findByCategoryjava.util.List<OnmsNode>
findByForeignId(java.lang.String foreignId)
findByForeignIdOnmsNode
findByForeignId(java.lang.String foreignSource, java.lang.String foreignId)
findByForeignIdjava.util.List<OnmsNode>
findByForeignIdForLocation(java.lang.String foreignId, java.lang.String location)
findByForeignIdForLocationjava.util.List<OnmsNode>
findByForeignSource(java.lang.String foreignSource)
findByForeignSourcejava.util.List<OnmsNode>
findByForeignSourceAndIpAddress(java.lang.String foreignSource, java.lang.String ipAddress)
findByForeignSourceAndIpAddressjava.util.List<OnmsNode>
findByIpAddressAndService(java.net.InetAddress ipAddress, java.lang.String serviceName)
java.util.List<OnmsNode>
findByLabel(java.lang.String label)
findByLabeljava.util.List<OnmsNode>
findByLabelForLocation(java.lang.String label, java.lang.String location)
findByLabeljava.util.List<OnmsNode>
findNodeWithMetaData(java.lang.String context, java.lang.String key, java.lang.String value)
java.util.List<OnmsIpInterface>
findObsoleteIpInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
findObsoleteIpInterfacesSurveillanceStatus
findSurveillanceStatusByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
OnmsNode
get(java.lang.String lookupCriteria)
Get a node based on it's node ID or foreignSource:foreignIdjava.util.Map<java.lang.Integer,java.lang.String>
getAllLabelsById()
Retrieves all of node id/label tuples.OnmsNode
getDefaultFocusPoint()
java.util.Set<java.lang.String>
getForeignIdsPerForeignSource(java.lang.String foreignSource)
getForeignIdsPerForeignSourcejava.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getForeignIdsPerForeignSourceMap()
getForeignIdsPerForeignSourceMapjava.util.Map<java.lang.String,java.lang.Integer>
getForeignIdToNodeIdMap(java.lang.String foreignSource)
getForeignIdToNodeIdMapOnmsNode
getHierarchy(java.lang.Integer id)
getHierarchyjava.lang.String
getLabelForId(java.lang.Integer id)
Test the ability to simply retrieve a String object (node label) without having to return a bulky Node object.java.lang.String
getLocationForId(java.lang.Integer id)
Light weight call to simply get the node location without loading the entire node.java.lang.Integer
getNextNodeId(java.lang.Integer nodeId)
int
getNodeCountForForeignSource(java.lang.String foreignSource)
getNodeCountForForeignSourcejava.util.Collection<java.lang.Integer>
getNodeIds()
getNodeIdsjava.util.Map<java.lang.String,java.lang.Long>
getNumberOfNodesBySysOid()
Retrieves the number of nodes for each sysOid.java.lang.Integer
getPreviousNodeId(java.lang.Integer nodeId)
void
markHavingFlows(java.util.Collection<java.lang.Integer> ingressIds, java.util.Collection<java.lang.Integer> egressIds)
void
updateNodeScanStamp(java.lang.Integer nodeId, java.util.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(java.lang.String lookupCriteria)
Get a node based on it's node ID or foreignSource:foreignId
-
getLabelForId
public java.lang.String getLabelForId(java.lang.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 java.lang.String getLocationForId(java.lang.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 java.util.Map<java.lang.Integer,java.lang.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 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getForeignIdsPerForeignSourceMap()
getForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMap
in interfaceNodeDao
- Returns:
- a
Map
object.
-
getForeignIdsPerForeignSource
public java.util.Set<java.lang.String> getForeignIdsPerForeignSource(java.lang.String foreignSource)
getForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Set
object.
-
findByForeignId
public java.util.List<OnmsNode> findByForeignId(java.lang.String foreignId)
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.- Returns:
- a
List
object.
-
findByForeignIdForLocation
public java.util.List<OnmsNode> findByForeignIdForLocation(java.lang.String foreignId, java.lang.String location)
findByForeignIdForLocation
- Specified by:
findByForeignIdForLocation
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.location
- aString
object.- Returns:
- a
List
object.
-
getHierarchy
public OnmsNode getHierarchy(java.lang.Integer id)
getHierarchy
- Specified by:
getHierarchy
in interfaceNodeDao
- Parameters:
id
- aInteger
object.- Returns:
- a
OnmsNode
object.
-
findByLabel
public java.util.List<OnmsNode> findByLabel(java.lang.String label)
findByLabel
- Specified by:
findByLabel
in interfaceNodeDao
- Parameters:
label
- aString
object.- Returns:
- a
Collection
object.
-
findByLabelForLocation
public java.util.List<OnmsNode> findByLabelForLocation(java.lang.String label, java.lang.String location)
findByLabel
- Specified by:
findByLabelForLocation
in interfaceNodeDao
- Parameters:
label
- aString
object.location
- aString
object.- Returns:
- a
Collection
object.
-
findAllByVarCharAssetColumn
public java.util.List<OnmsNode> findAllByVarCharAssetColumn(java.lang.String columnName, java.lang.String columnValue)
findAllByVarCharAssetColumn
- Specified by:
findAllByVarCharAssetColumn
in interfaceNodeDao
- Parameters:
columnName
- aString
object.columnValue
- aString
object.- Returns:
- a
Collection
object.
-
findAllByVarCharAssetColumnCategoryList
public java.util.List<OnmsNode> findAllByVarCharAssetColumnCategoryList(java.lang.String columnName, java.lang.String columnValue, java.util.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 java.util.List<OnmsNode> findByCategory(OnmsCategory category)
findByCategory
- Specified by:
findByCategory
in interfaceNodeDao
- Parameters:
category
- aOnmsCategory
object.- Returns:
- a
Collection
object.
-
findAllByCategoryList
public java.util.List<OnmsNode> findAllByCategoryList(java.util.Collection<OnmsCategory> categories)
findAllByCategoryList
- Specified by:
findAllByCategoryList
in interfaceNodeDao
- Parameters:
categories
- aCollection
object.- Returns:
- a
Collection
object.
-
findAllByCategoryLists
public java.util.List<OnmsNode> findAllByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
findAllByCategoryLists
- Specified by:
findAllByCategoryLists
in interfaceNodeDao
- Parameters:
rowCategories
- aCollection
object.columnCategories
- aCollection
object.- Returns:
- a
Collection
object.
-
findSurveillanceStatusByCategoryLists
public SurveillanceStatus findSurveillanceStatusByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryLists
in interfaceNodeDao
-
getForeignIdToNodeIdMap
public java.util.Map<java.lang.String,java.lang.Integer> getForeignIdToNodeIdMap(java.lang.String foreignSource)
getForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMap
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Map
object.
-
findByForeignSource
public java.util.List<OnmsNode> findByForeignSource(java.lang.String foreignSource)
findByForeignSource
- Specified by:
findByForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
List
object.
-
findByForeignId
public OnmsNode findByForeignId(java.lang.String foreignSource, java.lang.String foreignId)
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.- Returns:
- a
OnmsNode
object.
-
findByForeignSourceAndIpAddress
public java.util.List<OnmsNode> findByForeignSourceAndIpAddress(java.lang.String foreignSource, java.lang.String ipAddress)
findByForeignSourceAndIpAddress
- Specified by:
findByForeignSourceAndIpAddress
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.ipAddress
- aString
object.- Returns:
- a
List
object.
-
getNodeCountForForeignSource
public int getNodeCountForForeignSource(java.lang.String foreignSource)
getNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a int.
-
findAll
public java.util.List<OnmsNode> findAll()
findAll
-
findAllProvisionedNodes
public java.util.List<OnmsNode> findAllProvisionedNodes()
findAllProvisionedNodes
- Specified by:
findAllProvisionedNodes
in interfaceNodeDao
- Returns:
- a
List
object.
-
findByIpAddressAndService
public java.util.List<OnmsNode> findByIpAddressAndService(java.net.InetAddress ipAddress, java.lang.String serviceName)
- Specified by:
findByIpAddressAndService
in interfaceNodeDao
-
findObsoleteIpInterfaces
public java.util.List<OnmsIpInterface> findObsoleteIpInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
findObsoleteIpInterfaces
- Specified by:
findObsoleteIpInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.- Returns:
- a
List
object.
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
deleteObsoleteInterfaces
- Specified by:
deleteObsoleteInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
updateNodeScanStamp
public void updateNodeScanStamp(java.lang.Integer nodeId, java.util.Date scanStamp)
updateNodeScanStamp
- Specified by:
updateNodeScanStamp
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
getNodeIds
public java.util.Collection<java.lang.Integer> getNodeIds()
getNodeIds
- Specified by:
getNodeIds
in interfaceNodeDao
- Returns:
- a
Collection
object.
-
getNumberOfNodesBySysOid
public java.util.Map<java.lang.String,java.lang.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 java.lang.Integer getNextNodeId(java.lang.Integer nodeId)
- Specified by:
getNextNodeId
in interfaceNodeDao
-
getPreviousNodeId
public java.lang.Integer getPreviousNodeId(java.lang.Integer nodeId)
- Specified by:
getPreviousNodeId
in interfaceNodeDao
-
markHavingFlows
public void markHavingFlows(java.util.Collection<java.lang.Integer> ingressIds, java.util.Collection<java.lang.Integer> egressIds)
- Specified by:
markHavingFlows
in interfaceNodeDao
-
findAllHavingFlows
public java.util.List<OnmsNode> findAllHavingFlows()
- Specified by:
findAllHavingFlows
in interfaceNodeDao
-
findAllHavingIngressFlows
public java.util.List<OnmsNode> findAllHavingIngressFlows()
- Specified by:
findAllHavingIngressFlows
in interfaceNodeDao
-
findAllHavingEgressFlows
public java.util.List<OnmsNode> findAllHavingEgressFlows()
- Specified by:
findAllHavingEgressFlows
in interfaceNodeDao
-
getDefaultFocusPoint
public OnmsNode getDefaultFocusPoint()
- Specified by:
getDefaultFocusPoint
in interfaceNodeDao
-
findNodeWithMetaData
public java.util.List<OnmsNode> findNodeWithMetaData(java.lang.String context, java.lang.String key, java.lang.String value)
- Specified by:
findNodeWithMetaData
in interfaceNodeDao
-
-