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 classNodeDaoHibernate.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 voiddeleteObsoleteInterfaces(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)findByForeignIdOnmsNodefindByForeignId(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>findNodeWithMetaData(String context, String key, String value)List<OnmsIpInterface>findObsoleteIpInterfaces(Integer nodeId, Date scanStamp)findObsoleteIpInterfacesSurveillanceStatusfindSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)OnmsNodeget(String lookupCriteria)Get a node based on it's node ID or foreignSource:foreignIdMap<Integer,String>getAllLabelsById()Retrieves all of node id/label tuples.OnmsNodegetDefaultFocusPoint()Set<String>getForeignIdsPerForeignSource(String foreignSource)getForeignIdsPerForeignSourceMap<String,Set<String>>getForeignIdsPerForeignSourceMap()getForeignIdsPerForeignSourceMapMap<String,Integer>getForeignIdToNodeIdMap(String foreignSource)getForeignIdToNodeIdMapOnmsNodegetHierarchy(Integer id)getHierarchyStringgetLabelForId(Integer id)Test the ability to simply retrieve a String object (node label) without having to return a bulky Node object.StringgetLocationForId(Integer id)Light weight call to simply get the node location without loading the entire node.IntegergetNextNodeId(Integer nodeId)intgetNodeCountForForeignSource(String foreignSource)getNodeCountForForeignSourceCollection<Integer>getNodeIds()getNodeIdsMap<String,Long>getNumberOfNodesBySysOid()Retrieves the number of nodes for each sysOid.IntegergetPreviousNodeId(Integer nodeId)voidmarkHavingFlows(Collection<Integer> ingressIds, Collection<Integer> egressIds)voidupdateNodeScanStamp(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:
getLabelForIdin 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:NodeDaoLight weight call to simply get the node location without loading the entire node.- Specified by:
getLocationForIdin 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:
getAllLabelsByIdin interfaceNodeDao- Returns:
- a
Mapcontaining all node ids and their associated labels.
-
getForeignIdsPerForeignSourceMap
public Map<String,Set<String>> getForeignIdsPerForeignSourceMap()
getForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMapin interfaceNodeDao- Returns:
- a
Mapobject.
-
getForeignIdsPerForeignSource
public Set<String> getForeignIdsPerForeignSource(String foreignSource)
getForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Setobject.
-
findByForeignId
public List<OnmsNode> findByForeignId(String foreignId)
findByForeignId
- Specified by:
findByForeignIdin interfaceNodeDao- Parameters:
foreignId- aStringobject.- Returns:
- a
Listobject.
-
findByForeignIdForLocation
public List<OnmsNode> findByForeignIdForLocation(String foreignId, String location)
findByForeignIdForLocation
- Specified by:
findByForeignIdForLocationin interfaceNodeDao- Parameters:
foreignId- aStringobject.location- aStringobject.- Returns:
- a
Listobject.
-
getHierarchy
public OnmsNode getHierarchy(Integer id)
getHierarchy
- Specified by:
getHierarchyin interfaceNodeDao- Parameters:
id- aIntegerobject.- Returns:
- a
OnmsNodeobject.
-
findByLabel
public List<OnmsNode> findByLabel(String label)
findByLabel
- Specified by:
findByLabelin interfaceNodeDao- Parameters:
label- aStringobject.- Returns:
- a
Collectionobject.
-
findByLabelForLocation
public List<OnmsNode> findByLabelForLocation(String label, String location)
findByLabel
- Specified by:
findByLabelForLocationin interfaceNodeDao- Parameters:
label- aStringobject.location- aStringobject.- Returns:
- a
Collectionobject.
-
findAllByVarCharAssetColumn
public List<OnmsNode> findAllByVarCharAssetColumn(String columnName, String columnValue)
findAllByVarCharAssetColumn
- Specified by:
findAllByVarCharAssetColumnin interfaceNodeDao- Parameters:
columnName- aStringobject.columnValue- aStringobject.- Returns:
- a
Collectionobject.
-
findAllByVarCharAssetColumnCategoryList
public List<OnmsNode> findAllByVarCharAssetColumnCategoryList(String columnName, String columnValue, Collection<OnmsCategory> categories)
findAllByVarCharAssetColumnCategoryList
- Specified by:
findAllByVarCharAssetColumnCategoryListin interfaceNodeDao- Parameters:
columnName- aStringobject.columnValue- aStringobject.categories- aCollectionobject.- Returns:
- a
Collectionobject.
-
findByCategory
public List<OnmsNode> findByCategory(OnmsCategory category)
findByCategory
- Specified by:
findByCategoryin interfaceNodeDao- Parameters:
category- aOnmsCategoryobject.- Returns:
- a
Collectionobject.
-
findAllByCategoryList
public List<OnmsNode> findAllByCategoryList(Collection<OnmsCategory> categories)
findAllByCategoryList
- Specified by:
findAllByCategoryListin interfaceNodeDao- Parameters:
categories- aCollectionobject.- Returns:
- a
Collectionobject.
-
findAllByCategoryLists
public List<OnmsNode> findAllByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
findAllByCategoryLists
- Specified by:
findAllByCategoryListsin interfaceNodeDao- Parameters:
rowCategories- aCollectionobject.columnCategories- aCollectionobject.- Returns:
- a
Collectionobject.
-
findSurveillanceStatusByCategoryLists
public SurveillanceStatus findSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryListsin interfaceNodeDao
-
getForeignIdToNodeIdMap
public Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
getForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMapin interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Mapobject.
-
findByForeignSource
public List<OnmsNode> findByForeignSource(String foreignSource)
findByForeignSource
- Specified by:
findByForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Listobject.
-
findByForeignId
public OnmsNode findByForeignId(String foreignSource, String foreignId)
findByForeignId
- Specified by:
findByForeignIdin interfaceNodeDao- Parameters:
foreignSource- aStringobject.foreignId- aStringobject.- Returns:
- a
OnmsNodeobject.
-
findByForeignSourceAndIpAddress
public List<OnmsNode> findByForeignSourceAndIpAddress(String foreignSource, String ipAddress)
findByForeignSourceAndIpAddress
- Specified by:
findByForeignSourceAndIpAddressin interfaceNodeDao- Parameters:
foreignSource- aStringobject.ipAddress- aStringobject.- Returns:
- a
Listobject.
-
getNodeCountForForeignSource
public int getNodeCountForForeignSource(String foreignSource)
getNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a int.
-
findAllProvisionedNodes
public List<OnmsNode> findAllProvisionedNodes()
findAllProvisionedNodes
- Specified by:
findAllProvisionedNodesin interfaceNodeDao- Returns:
- a
Listobject.
-
findByIpAddressAndService
public List<OnmsNode> findByIpAddressAndService(InetAddress ipAddress, String serviceName)
- Specified by:
findByIpAddressAndServicein interfaceNodeDao
-
findObsoleteIpInterfaces
public List<OnmsIpInterface> findObsoleteIpInterfaces(Integer nodeId, Date scanStamp)
findObsoleteIpInterfaces
- Specified by:
findObsoleteIpInterfacesin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.- Returns:
- a
Listobject.
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
deleteObsoleteInterfaces
- Specified by:
deleteObsoleteInterfacesin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.
-
updateNodeScanStamp
public void updateNodeScanStamp(Integer nodeId, Date scanStamp)
updateNodeScanStamp
- Specified by:
updateNodeScanStampin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.
-
getNodeIds
public Collection<Integer> getNodeIds()
getNodeIds
- Specified by:
getNodeIdsin interfaceNodeDao- Returns:
- a
Collectionobject.
-
getNumberOfNodesBySysOid
public Map<String,Long> getNumberOfNodesBySysOid()
Retrieves the number of nodes for each sysOid.- Specified by:
getNumberOfNodesBySysOidin interfaceNodeDao- Returns:
- a
Mapcontaining the number of nodes for each sysOid
-
getNextNodeId
public Integer getNextNodeId(Integer nodeId)
- Specified by:
getNextNodeIdin interfaceNodeDao
-
getPreviousNodeId
public Integer getPreviousNodeId(Integer nodeId)
- Specified by:
getPreviousNodeIdin interfaceNodeDao
-
markHavingFlows
public void markHavingFlows(Collection<Integer> ingressIds, Collection<Integer> egressIds)
- Specified by:
markHavingFlowsin interfaceNodeDao
-
findAllHavingFlows
public List<OnmsNode> findAllHavingFlows()
- Specified by:
findAllHavingFlowsin interfaceNodeDao
-
findAllHavingIngressFlows
public List<OnmsNode> findAllHavingIngressFlows()
- Specified by:
findAllHavingIngressFlowsin interfaceNodeDao
-
findAllHavingEgressFlows
public List<OnmsNode> findAllHavingEgressFlows()
- Specified by:
findAllHavingEgressFlowsin interfaceNodeDao
-
getDefaultFocusPoint
public OnmsNode getDefaultFocusPoint()
- Specified by:
getDefaultFocusPointin interfaceNodeDao
-
-