Package org.opennms.netmgt.dao.mock
Class MockApplicationDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsApplication,java.lang.Integer>
-
- org.opennms.netmgt.dao.mock.MockApplicationDao
-
- All Implemented Interfaces:
ApplicationDao
,LegacyOnmsDao<OnmsApplication,java.lang.Integer>
,OnmsDao<OnmsApplication,java.lang.Integer>
,org.springframework.beans.factory.InitializingBean
public class MockApplicationDao extends AbstractMockDao<OnmsApplication,java.lang.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 OnmsApplication
findByName(java.lang.String label)
findByNameprotected void
generateId(OnmsApplication app)
java.util.List<MonitoredServiceStatusEntity>
getAlarmStatus()
Load all alarms from the alarm table which have a node id, ip address and service type set.java.util.List<MonitoredServiceStatusEntity>
getAlarmStatus(java.util.List<OnmsApplication> applications)
java.util.List<ApplicationStatus>
getApplicationStatus()
Determine the application's status.java.util.List<ApplicationStatus>
getApplicationStatus(java.util.List<OnmsApplication> applications)
same asApplicationDao.getApplicationStatus()
but only calculates the status for the given applications.java.lang.Integer
getId(OnmsApplication app)
java.util.List<OnmsMonitoringLocation>
getPerspectiveLocationsForService(int nodeId, java.net.InetAddress ipAddress, java.lang.String serviceName)
java.util.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:
generateId
in classAbstractMockDao<OnmsApplication,java.lang.Integer>
-
getId
public java.lang.Integer getId(OnmsApplication app)
- Specified by:
getId
in classAbstractMockDao<OnmsApplication,java.lang.Integer>
-
findByName
public OnmsApplication findByName(java.lang.String label)
Description copied from interface:ApplicationDao
findByName
- Specified by:
findByName
in interfaceApplicationDao
- Parameters:
label
- aString
object.- Returns:
- a
OnmsApplication
object.
-
getApplicationStatus
public java.util.List<ApplicationStatus> getApplicationStatus()
Description copied from interface:ApplicationDao
Determine 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:
getApplicationStatus
in interfaceApplicationDao
- Returns:
- the application's status.
-
getApplicationStatus
public java.util.List<ApplicationStatus> getApplicationStatus(java.util.List<OnmsApplication> applications)
Description copied from interface:ApplicationDao
same asApplicationDao.getApplicationStatus()
but only calculates the status for the given applications.- Specified by:
getApplicationStatus
in interfaceApplicationDao
- Parameters:
applications
- The applications to calculate the status for.- Returns:
- The application's status.
-
getAlarmStatus
public java.util.List<MonitoredServiceStatusEntity> getAlarmStatus()
Description copied from interface:ApplicationDao
Load all alarms from the alarm table which have a node id, ip address and service type set.- Specified by:
getAlarmStatus
in interfaceApplicationDao
- Returns:
- all alarms from the alarm table which have a node id, ip address and service type set.
-
getAlarmStatus
public java.util.List<MonitoredServiceStatusEntity> getAlarmStatus(java.util.List<OnmsApplication> applications)
- Specified by:
getAlarmStatus
in interfaceApplicationDao
-
getPerspectiveLocationsForService
public java.util.List<OnmsMonitoringLocation> getPerspectiveLocationsForService(int nodeId, java.net.InetAddress ipAddress, java.lang.String serviceName)
- Specified by:
getPerspectiveLocationsForService
in interfaceApplicationDao
-
getServicePerspectives
public java.util.List<ServicePerspective> getServicePerspectives()
- Specified by:
getServicePerspectives
in interfaceApplicationDao
-
-