Package org.opennms.netmgt.dao.mock
Class MockNodeDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsNode,java.lang.Integer>
-
- org.opennms.netmgt.dao.mock.MockNodeDao
-
- All Implemented Interfaces:
LegacyOnmsDao<OnmsNode,java.lang.Integer>
,NodeDao
,OnmsDao<OnmsNode,java.lang.Integer>
,org.springframework.beans.factory.InitializingBean
public class MockNodeDao extends AbstractMockDao<OnmsNode,java.lang.Integer> implements NodeDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockNodeDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(OnmsNode node)
void
deleteObsoleteInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
deleteObsoleteInterfacesjava.util.List<OnmsNode>
findAllByCategoryList(java.util.Collection<OnmsCategory> categories)
findAllByCategoryListjava.util.List<OnmsNode>
findAllByCategoryLists(java.util.Collection<OnmsCategory> rowCatNames, java.util.Collection<OnmsCategory> colCatNames)
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)
findObsoleteIpInterfacesjava.util.List<OnmsSnmpInterface>
findObsoleteSnmpInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
SurveillanceStatus
findSurveillanceStatusByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
void
flush()
protected void
generateId(OnmsNode node)
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)
getHierarchyprotected java.lang.Integer
getId(OnmsNode node)
java.lang.String
getLabelForId(java.lang.Integer id)
Light weight call to simply get the node label without loading the entire node.java.lang.String
getLocationForId(java.lang.Integer id)
Light weight call to simply get the node location without loading the entire node.int
getNextNodeId()
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)
java.lang.Integer
save(OnmsNode node)
void
update(OnmsNode node)
void
updateNodeScanStamp(java.lang.Integer nodeId, java.util.Date scanStamp)
updateNodeScanStamp-
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, findMatching, get, initialize, load, lock, saveOrUpdate
-
-
-
-
Method Detail
-
generateId
protected void generateId(OnmsNode node)
- Specified by:
generateId
in classAbstractMockDao<OnmsNode,java.lang.Integer>
-
getId
protected java.lang.Integer getId(OnmsNode node)
- Specified by:
getId
in classAbstractMockDao<OnmsNode,java.lang.Integer>
-
delete
public void delete(OnmsNode node)
-
update
public void update(OnmsNode node)
-
save
public java.lang.Integer save(OnmsNode node)
-
flush
public void flush()
-
get
public OnmsNode get(java.lang.String lookupCriteria)
Description copied from interface:NodeDao
Get a node based on it's node ID or foreignSource:foreignId
-
getLabelForId
public java.lang.String getLabelForId(java.lang.Integer id)
Description copied from interface:NodeDao
Light weight call to simply get the node label without loading the entire node.- 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.
-
findByLabel
public java.util.List<OnmsNode> findByLabel(java.lang.String label)
Description copied from interface:NodeDao
findByLabel
- Specified by:
findByLabel
in interfaceNodeDao
- Parameters:
label
- aString
object.- Returns:
- a
Collection
object.
-
getHierarchy
public OnmsNode getHierarchy(java.lang.Integer id)
Description copied from interface:NodeDao
getHierarchy
- Specified by:
getHierarchy
in interfaceNodeDao
- Parameters:
id
- aInteger
object.- Returns:
- a
OnmsNode
object.
-
getForeignIdToNodeIdMap
public java.util.Map<java.lang.String,java.lang.Integer> getForeignIdToNodeIdMap(java.lang.String foreignSource)
Description copied from interface:NodeDao
getForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMap
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Map
object.
-
findAllByVarCharAssetColumn
public java.util.List<OnmsNode> findAllByVarCharAssetColumn(java.lang.String columnName, java.lang.String columnValue)
Description copied from interface:NodeDao
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)
Description copied from interface:NodeDao
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)
Description copied from interface:NodeDao
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)
Description copied from interface:NodeDao
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> rowCatNames, java.util.Collection<OnmsCategory> colCatNames)
Description copied from interface:NodeDao
findAllByCategoryLists
- Specified by:
findAllByCategoryLists
in interfaceNodeDao
- Parameters:
rowCatNames
- aCollection
object.colCatNames
- aCollection
object.- Returns:
- a
Collection
object.
-
findByForeignSource
public java.util.List<OnmsNode> findByForeignSource(java.lang.String foreignSource)
Description copied from interface:NodeDao
findByForeignSource
- Specified by:
findByForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
List
object.
-
findByIpAddressAndService
public java.util.List<OnmsNode> findByIpAddressAndService(java.net.InetAddress ipAddress, java.lang.String serviceName)
- Specified by:
findByIpAddressAndService
in interfaceNodeDao
-
findByForeignId
public OnmsNode findByForeignId(java.lang.String foreignSource, java.lang.String foreignId)
Description copied from interface:NodeDao
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.foreignId
- aString
object.- Returns:
- a
OnmsNode
object.
-
getNodeCountForForeignSource
public int getNodeCountForForeignSource(java.lang.String foreignSource)
Description copied from interface:NodeDao
getNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a int.
-
getForeignIdsPerForeignSourceMap
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getForeignIdsPerForeignSourceMap()
Description copied from interface:NodeDao
getForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMap
in interfaceNodeDao
- Returns:
- a
Map
object.
-
getForeignIdsPerForeignSource
public java.util.Set<java.lang.String> getForeignIdsPerForeignSource(java.lang.String foreignSource)
Description copied from interface:NodeDao
getForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Set
object.
-
findAllProvisionedNodes
public java.util.List<OnmsNode> findAllProvisionedNodes()
Description copied from interface:NodeDao
findAllProvisionedNodes
- Specified by:
findAllProvisionedNodes
in interfaceNodeDao
- Returns:
- a
List
object.
-
findObsoleteIpInterfaces
public java.util.List<OnmsIpInterface> findObsoleteIpInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
Description copied from interface:NodeDao
findObsoleteIpInterfaces
- Specified by:
findObsoleteIpInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.- Returns:
- a
List
object.
-
findObsoleteSnmpInterfaces
public java.util.List<OnmsSnmpInterface> findObsoleteSnmpInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(java.lang.Integer nodeId, java.util.Date scanStamp)
Description copied from interface:NodeDao
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)
Description copied from interface:NodeDao
updateNodeScanStamp
- Specified by:
updateNodeScanStamp
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
getNodeIds
public java.util.Collection<java.lang.Integer> getNodeIds()
Description copied from interface:NodeDao
getNodeIds
- Specified by:
getNodeIds
in interfaceNodeDao
- Returns:
- a
Collection
object.
-
findByForeignSourceAndIpAddress
public java.util.List<OnmsNode> findByForeignSourceAndIpAddress(java.lang.String foreignSource, java.lang.String ipAddress)
Description copied from interface:NodeDao
findByForeignSourceAndIpAddress
- Specified by:
findByForeignSourceAndIpAddress
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.ipAddress
- aString
object.- Returns:
- a
List
object.
-
findSurveillanceStatusByCategoryLists
public SurveillanceStatus findSurveillanceStatusByCategoryLists(java.util.Collection<OnmsCategory> rowCategories, java.util.Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryLists
in interfaceNodeDao
-
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
-
getAllLabelsById
public java.util.Map<java.lang.Integer,java.lang.String> getAllLabelsById()
Description copied from interface:NodeDao
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.
-
getNumberOfNodesBySysOid
public java.util.Map<java.lang.String,java.lang.Long> getNumberOfNodesBySysOid()
Description copied from interface:NodeDao
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 int getNextNodeId()
-
findByLabelForLocation
public java.util.List<OnmsNode> findByLabelForLocation(java.lang.String label, java.lang.String location)
Description copied from interface:NodeDao
findByLabel
- Specified by:
findByLabelForLocation
in interfaceNodeDao
- Parameters:
label
- aString
object.location
- aString
object.- Returns:
- a
Collection
object.
-
findByForeignId
public java.util.List<OnmsNode> findByForeignId(java.lang.String foreignId)
Description copied from interface:NodeDao
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)
Description copied from interface:NodeDao
findByForeignIdForLocation
- Specified by:
findByForeignIdForLocation
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.location
- aString
object.- Returns:
- a
List
object.
-
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
-
-