Package org.opennms.netmgt.dao.mock
Class MockNodeDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsNode,Integer>
-
- org.opennms.netmgt.dao.mock.MockNodeDao
-
-
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(Integer nodeId, Date scanStamp)
deleteObsoleteInterfacesList<OnmsNode>
findAllByCategoryList(Collection<OnmsCategory> categories)
findAllByCategoryListList<OnmsNode>
findAllByCategoryLists(Collection<OnmsCategory> rowCatNames, Collection<OnmsCategory> colCatNames)
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)
findObsoleteIpInterfacesList<OnmsSnmpInterface>
findObsoleteSnmpInterfaces(Integer nodeId, Date scanStamp)
SurveillanceStatus
findSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
void
flush()
protected void
generateId(OnmsNode node)
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)
getHierarchyprotected Integer
getId(OnmsNode node)
String
getLabelForId(Integer id)
Light weight call to simply get the node label without loading the entire node.String
getLocationForId(Integer id)
Light weight call to simply get the node location without loading the entire node.int
getNextNodeId()
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)
Integer
save(OnmsNode node)
void
update(OnmsNode node)
void
updateNodeScanStamp(Integer nodeId, 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,Integer>
-
getId
protected Integer getId(OnmsNode node)
- Specified by:
getId
in classAbstractMockDao<OnmsNode,Integer>
-
delete
public void delete(OnmsNode node)
-
update
public void update(OnmsNode node)
-
flush
public void flush()
-
get
public OnmsNode get(String lookupCriteria)
Description copied from interface:NodeDao
Get a node based on it's node ID or foreignSource:foreignId
-
getLabelForId
public String getLabelForId(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 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.
-
findByLabel
public List<OnmsNode> findByLabel(String label)
Description copied from interface:NodeDao
findByLabel
- Specified by:
findByLabel
in interfaceNodeDao
- Parameters:
label
- aString
object.- Returns:
- a
Collection
object.
-
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
-
getHierarchy
public OnmsNode getHierarchy(Integer id)
Description copied from interface:NodeDao
getHierarchy
- Specified by:
getHierarchy
in interfaceNodeDao
- Parameters:
id
- aInteger
object.- Returns:
- a
OnmsNode
object.
-
getForeignIdToNodeIdMap
public Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
Description copied from interface:NodeDao
getForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMap
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Map
object.
-
findAllByVarCharAssetColumn
public List<OnmsNode> findAllByVarCharAssetColumn(String columnName, 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 List<OnmsNode> findAllByVarCharAssetColumnCategoryList(String columnName, String columnValue, 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 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 List<OnmsNode> findAllByCategoryList(Collection<OnmsCategory> categories)
Description copied from interface:NodeDao
findAllByCategoryList
- Specified by:
findAllByCategoryList
in interfaceNodeDao
- Parameters:
categories
- aCollection
object.- Returns:
- a
Collection
object.
-
findAllByCategoryLists
public List<OnmsNode> findAllByCategoryLists(Collection<OnmsCategory> rowCatNames, 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 List<OnmsNode> findByForeignSource(String foreignSource)
Description copied from interface:NodeDao
findByForeignSource
- Specified by:
findByForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
List
object.
-
findByIpAddressAndService
public List<OnmsNode> findByIpAddressAndService(InetAddress ipAddress, String serviceName)
- Specified by:
findByIpAddressAndService
in interfaceNodeDao
-
findByForeignId
public OnmsNode findByForeignId(String foreignSource, 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(String foreignSource)
Description copied from interface:NodeDao
getNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a int.
-
getForeignIdsPerForeignSourceMap
public Map<String,Set<String>> getForeignIdsPerForeignSourceMap()
Description copied from interface:NodeDao
getForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMap
in interfaceNodeDao
- Returns:
- a
Map
object.
-
getForeignIdsPerForeignSource
public Set<String> getForeignIdsPerForeignSource(String foreignSource)
Description copied from interface:NodeDao
getForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSource
in interfaceNodeDao
- Parameters:
foreignSource
- aString
object.- Returns:
- a
Set
object.
-
findAllProvisionedNodes
public List<OnmsNode> findAllProvisionedNodes()
Description copied from interface:NodeDao
findAllProvisionedNodes
- Specified by:
findAllProvisionedNodes
in interfaceNodeDao
- Returns:
- a
List
object.
-
findObsoleteIpInterfaces
public List<OnmsIpInterface> findObsoleteIpInterfaces(Integer nodeId, 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 List<OnmsSnmpInterface> findObsoleteSnmpInterfaces(Integer nodeId, Date scanStamp)
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
Description copied from interface:NodeDao
deleteObsoleteInterfaces
- Specified by:
deleteObsoleteInterfaces
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
updateNodeScanStamp
public void updateNodeScanStamp(Integer nodeId, Date scanStamp)
Description copied from interface:NodeDao
updateNodeScanStamp
- Specified by:
updateNodeScanStamp
in interfaceNodeDao
- Parameters:
nodeId
- aInteger
object.scanStamp
- aDate
object.
-
getNodeIds
public Collection<Integer> getNodeIds()
Description copied from interface:NodeDao
getNodeIds
- Specified by:
getNodeIds
in interfaceNodeDao
- Returns:
- a
Collection
object.
-
findByForeignSourceAndIpAddress
public List<OnmsNode> findByForeignSourceAndIpAddress(String foreignSource, 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(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryLists
in interfaceNodeDao
-
getNextNodeId
public Integer getNextNodeId(Integer nodeId)
- Specified by:
getNextNodeId
in interfaceNodeDao
-
getPreviousNodeId
public Integer getPreviousNodeId(Integer nodeId)
- Specified by:
getPreviousNodeId
in interfaceNodeDao
-
getAllLabelsById
public Map<Integer,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 Map<String,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 List<OnmsNode> findByLabelForLocation(String label, 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 List<OnmsNode> findByForeignId(String foreignId)
Description copied from interface:NodeDao
findByForeignId
- Specified by:
findByForeignId
in interfaceNodeDao
- Parameters:
foreignId
- aString
object.- Returns:
- a
List
object.
-
findByForeignIdForLocation
public List<OnmsNode> findByForeignIdForLocation(String foreignId, 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(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
-
getDefaultFocusPoint
public OnmsNode getDefaultFocusPoint()
- Specified by:
getDefaultFocusPoint
in interfaceNodeDao
-
-