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
-
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:
generateIdin classAbstractMockDao<OnmsNode,Integer>
-
getId
protected Integer getId(OnmsNode node)
- Specified by:
getIdin 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:NodeDaoGet a node based on it's node ID or foreignSource:foreignId
-
getLabelForId
public String getLabelForId(Integer id)
Description copied from interface:NodeDaoLight weight call to simply get the node label without loading the entire node.- 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.
-
findByLabel
public List<OnmsNode> findByLabel(String label)
Description copied from interface:NodeDaofindByLabel
- Specified by:
findByLabelin interfaceNodeDao- Parameters:
label- aStringobject.- Returns:
- a
Collectionobject.
-
getHierarchy
public OnmsNode getHierarchy(Integer id)
Description copied from interface:NodeDaogetHierarchy
- Specified by:
getHierarchyin interfaceNodeDao- Parameters:
id- aIntegerobject.- Returns:
- a
OnmsNodeobject.
-
getForeignIdToNodeIdMap
public Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
Description copied from interface:NodeDaogetForeignIdToNodeIdMap
- Specified by:
getForeignIdToNodeIdMapin interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Mapobject.
-
findAllByVarCharAssetColumn
public List<OnmsNode> findAllByVarCharAssetColumn(String columnName, String columnValue)
Description copied from interface:NodeDaofindAllByVarCharAssetColumn
- Specified by:
findAllByVarCharAssetColumnin interfaceNodeDao- Parameters:
columnName- aStringobject.columnValue- aStringobject.- Returns:
- a
Collectionobject.
-
findAllByVarCharAssetColumnCategoryList
public List<OnmsNode> findAllByVarCharAssetColumnCategoryList(String columnName, String columnValue, Collection<OnmsCategory> categories)
Description copied from interface:NodeDaofindAllByVarCharAssetColumnCategoryList
- Specified by:
findAllByVarCharAssetColumnCategoryListin interfaceNodeDao- Parameters:
columnName- aStringobject.columnValue- aStringobject.categories- aCollectionobject.- Returns:
- a
Collectionobject.
-
findByCategory
public List<OnmsNode> findByCategory(OnmsCategory category)
Description copied from interface:NodeDaofindByCategory
- Specified by:
findByCategoryin interfaceNodeDao- Parameters:
category- aOnmsCategoryobject.- Returns:
- a
Collectionobject.
-
findAllByCategoryList
public List<OnmsNode> findAllByCategoryList(Collection<OnmsCategory> categories)
Description copied from interface:NodeDaofindAllByCategoryList
- Specified by:
findAllByCategoryListin interfaceNodeDao- Parameters:
categories- aCollectionobject.- Returns:
- a
Collectionobject.
-
findAllByCategoryLists
public List<OnmsNode> findAllByCategoryLists(Collection<OnmsCategory> rowCatNames, Collection<OnmsCategory> colCatNames)
Description copied from interface:NodeDaofindAllByCategoryLists
- Specified by:
findAllByCategoryListsin interfaceNodeDao- Parameters:
rowCatNames- aCollectionobject.colCatNames- aCollectionobject.- Returns:
- a
Collectionobject.
-
findByForeignSource
public List<OnmsNode> findByForeignSource(String foreignSource)
Description copied from interface:NodeDaofindByForeignSource
- Specified by:
findByForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Listobject.
-
findByIpAddressAndService
public List<OnmsNode> findByIpAddressAndService(InetAddress ipAddress, String serviceName)
- Specified by:
findByIpAddressAndServicein interfaceNodeDao
-
findByForeignId
public OnmsNode findByForeignId(String foreignSource, String foreignId)
Description copied from interface:NodeDaofindByForeignId
- Specified by:
findByForeignIdin interfaceNodeDao- Parameters:
foreignSource- aStringobject.foreignId- aStringobject.- Returns:
- a
OnmsNodeobject.
-
getNodeCountForForeignSource
public int getNodeCountForForeignSource(String foreignSource)
Description copied from interface:NodeDaogetNodeCountForForeignSource
- Specified by:
getNodeCountForForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a int.
-
getForeignIdsPerForeignSourceMap
public Map<String,Set<String>> getForeignIdsPerForeignSourceMap()
Description copied from interface:NodeDaogetForeignIdsPerForeignSourceMap
- Specified by:
getForeignIdsPerForeignSourceMapin interfaceNodeDao- Returns:
- a
Mapobject.
-
getForeignIdsPerForeignSource
public Set<String> getForeignIdsPerForeignSource(String foreignSource)
Description copied from interface:NodeDaogetForeignIdsPerForeignSource
- Specified by:
getForeignIdsPerForeignSourcein interfaceNodeDao- Parameters:
foreignSource- aStringobject.- Returns:
- a
Setobject.
-
findAllProvisionedNodes
public List<OnmsNode> findAllProvisionedNodes()
Description copied from interface:NodeDaofindAllProvisionedNodes
- Specified by:
findAllProvisionedNodesin interfaceNodeDao- Returns:
- a
Listobject.
-
findObsoleteIpInterfaces
public List<OnmsIpInterface> findObsoleteIpInterfaces(Integer nodeId, Date scanStamp)
Description copied from interface:NodeDaofindObsoleteIpInterfaces
- Specified by:
findObsoleteIpInterfacesin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.- Returns:
- a
Listobject.
-
findObsoleteSnmpInterfaces
public List<OnmsSnmpInterface> findObsoleteSnmpInterfaces(Integer nodeId, Date scanStamp)
-
deleteObsoleteInterfaces
public void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
Description copied from interface:NodeDaodeleteObsoleteInterfaces
- Specified by:
deleteObsoleteInterfacesin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.
-
updateNodeScanStamp
public void updateNodeScanStamp(Integer nodeId, Date scanStamp)
Description copied from interface:NodeDaoupdateNodeScanStamp
- Specified by:
updateNodeScanStampin interfaceNodeDao- Parameters:
nodeId- aIntegerobject.scanStamp- aDateobject.
-
getNodeIds
public Collection<Integer> getNodeIds()
Description copied from interface:NodeDaogetNodeIds
- Specified by:
getNodeIdsin interfaceNodeDao- Returns:
- a
Collectionobject.
-
findByForeignSourceAndIpAddress
public List<OnmsNode> findByForeignSourceAndIpAddress(String foreignSource, String ipAddress)
Description copied from interface:NodeDaofindByForeignSourceAndIpAddress
- Specified by:
findByForeignSourceAndIpAddressin interfaceNodeDao- Parameters:
foreignSource- aStringobject.ipAddress- aStringobject.- Returns:
- a
Listobject.
-
findSurveillanceStatusByCategoryLists
public SurveillanceStatus findSurveillanceStatusByCategoryLists(Collection<OnmsCategory> rowCategories, Collection<OnmsCategory> columnCategories)
- Specified by:
findSurveillanceStatusByCategoryListsin interfaceNodeDao
-
getNextNodeId
public Integer getNextNodeId(Integer nodeId)
- Specified by:
getNextNodeIdin interfaceNodeDao
-
getPreviousNodeId
public Integer getPreviousNodeId(Integer nodeId)
- Specified by:
getPreviousNodeIdin interfaceNodeDao
-
getAllLabelsById
public Map<Integer,String> getAllLabelsById()
Description copied from interface:NodeDaoRetrieves 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.
-
getNumberOfNodesBySysOid
public Map<String,Long> getNumberOfNodesBySysOid()
Description copied from interface:NodeDaoRetrieves the number of nodes for each sysOid.- Specified by:
getNumberOfNodesBySysOidin interfaceNodeDao- Returns:
- a
Mapcontaining the number of nodes for each sysOid
-
getNextNodeId
public int getNextNodeId()
-
findByLabelForLocation
public List<OnmsNode> findByLabelForLocation(String label, String location)
Description copied from interface:NodeDaofindByLabel
- Specified by:
findByLabelForLocationin interfaceNodeDao- Parameters:
label- aStringobject.location- aStringobject.- Returns:
- a
Collectionobject.
-
findByForeignId
public List<OnmsNode> findByForeignId(String foreignId)
Description copied from interface:NodeDaofindByForeignId
- Specified by:
findByForeignIdin interfaceNodeDao- Parameters:
foreignId- aStringobject.- Returns:
- a
Listobject.
-
findByForeignIdForLocation
public List<OnmsNode> findByForeignIdForLocation(String foreignId, String location)
Description copied from interface:NodeDaofindByForeignIdForLocation
- Specified by:
findByForeignIdForLocationin interfaceNodeDao- Parameters:
foreignId- aStringobject.location- aStringobject.- Returns:
- a
Listobject.
-
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
-
-