Package org.opennms.netmgt.dao.mock
Class MockApplicationDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsApplication,Integer>
-
- org.opennms.netmgt.dao.mock.MockApplicationDao
-
- All Implemented Interfaces:
ApplicationDao,LegacyOnmsDao<OnmsApplication,Integer>,OnmsDao<OnmsApplication,Integer>,org.springframework.beans.factory.InitializingBean
public class MockApplicationDao extends AbstractMockDao<OnmsApplication,Integer> implements ApplicationDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockApplicationDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnmsApplicationfindByName(String label)findByNameprotected voidgenerateId(OnmsApplication app)List<MonitoredServiceStatusEntity>getAlarmStatus()Load all alarms from the alarm table which have a node id, ip address and service type set.List<MonitoredServiceStatusEntity>getAlarmStatus(List<OnmsApplication> applications)List<ApplicationStatus>getApplicationStatus()Determine the application's status.List<ApplicationStatus>getApplicationStatus(List<OnmsApplication> applications)same asApplicationDao.getApplicationStatus()but only calculates the status for the given applications.IntegergetId(OnmsApplication app)List<OnmsMonitoringLocation>getPerspectiveLocationsForService(int nodeId, InetAddress ipAddress, String serviceName)List<ServicePerspective>getServicePerspectives()-
Methods inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
afterPropertiesSet, clear, countAll, countMatching, countMatching, delete, delete, findAll, findMatching, findMatching, flush, get, getAlarmAssociationDao, getAlarmDao, getAssetRecordDao, getCategoryDao, getDistPollerDao, getEventDao, getIpInterfaceDao, getMonitoredServiceDao, getMonitoringLocationDao, getNodeDao, getServiceRegistry, getServiceTypeDao, getSnmpInterfaceDao, initialize, load, lock, save, saveOrUpdate, update
-
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.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
generateId
protected void generateId(OnmsApplication app)
- Specified by:
generateIdin classAbstractMockDao<OnmsApplication,Integer>
-
getId
public Integer getId(OnmsApplication app)
- Specified by:
getIdin classAbstractMockDao<OnmsApplication,Integer>
-
findByName
public OnmsApplication findByName(String label)
Description copied from interface:ApplicationDaofindByName
- Specified by:
findByNamein interfaceApplicationDao- Parameters:
label- aStringobject.- Returns:
- a
OnmsApplicationobject.
-
getApplicationStatus
public List<ApplicationStatus> getApplicationStatus()
Description copied from interface:ApplicationDaoDetermine the application's status. As applications do not have a direct status attached, the status is calculated based on the nodeDown, interfaceDown or serviceLost events/alarms from the application's monitored services.- Specified by:
getApplicationStatusin interfaceApplicationDao- Returns:
- the application's status.
-
getApplicationStatus
public List<ApplicationStatus> getApplicationStatus(List<OnmsApplication> applications)
Description copied from interface:ApplicationDaosame asApplicationDao.getApplicationStatus()but only calculates the status for the given applications.- Specified by:
getApplicationStatusin interfaceApplicationDao- Parameters:
applications- The applications to calculate the status for.- Returns:
- The application's status.
-
getAlarmStatus
public List<MonitoredServiceStatusEntity> getAlarmStatus()
Description copied from interface:ApplicationDaoLoad all alarms from the alarm table which have a node id, ip address and service type set.- Specified by:
getAlarmStatusin interfaceApplicationDao- Returns:
- all alarms from the alarm table which have a node id, ip address and service type set.
-
getAlarmStatus
public List<MonitoredServiceStatusEntity> getAlarmStatus(List<OnmsApplication> applications)
- Specified by:
getAlarmStatusin interfaceApplicationDao
-
getPerspectiveLocationsForService
public List<OnmsMonitoringLocation> getPerspectiveLocationsForService(int nodeId, InetAddress ipAddress, String serviceName)
- Specified by:
getPerspectiveLocationsForServicein interfaceApplicationDao
-
getServicePerspectives
public List<ServicePerspective> getServicePerspectives()
- Specified by:
getServicePerspectivesin interfaceApplicationDao
-
-