Class AlarmHistoryRestServiceImpl
- java.lang.Object
-
- org.opennms.features.alarms.history.rest.impl.AlarmHistoryRestServiceImpl
-
- All Implemented Interfaces:
AlarmHistoryRestService
public class AlarmHistoryRestServiceImpl extends Object implements AlarmHistoryRestService
-
-
Field Summary
Fields Modifier and Type Field Description static String
REDUCTION_KEY_MATCH_TYPE
-
Constructor Summary
Constructors Constructor Description AlarmHistoryRestServiceImpl(AlarmHistoryRepository alarmHistoryRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<AlarmState>
getActiveAlarmsAt(Long time)
Retrieve the last known state of all alarms which were active at the given time.AlarmState
getAlarm(String alarmId, String matchType, Long time)
Retrieve the last known state of an alarm at the given time.Collection<AlarmState>
getStatesForAlarm(String alarmId, String matchType)
Retrieve the complete set of state changes for the given alarm.
-
-
-
Field Detail
-
REDUCTION_KEY_MATCH_TYPE
public static final String REDUCTION_KEY_MATCH_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AlarmHistoryRestServiceImpl
public AlarmHistoryRestServiceImpl(AlarmHistoryRepository alarmHistoryRepository)
-
-
Method Detail
-
getStatesForAlarm
public Collection<AlarmState> getStatesForAlarm(String alarmId, String matchType)
Description copied from interface:AlarmHistoryRestService
Retrieve the complete set of state changes for the given alarm.- Specified by:
getStatesForAlarm
in interfaceAlarmHistoryRestService
- Parameters:
alarmId
- alarm id to querymatchType
- when set the 'reduction-key', lookup by reduction key instead of alarm id- Returns:
- state changes
-
getAlarm
public AlarmState getAlarm(String alarmId, String matchType, Long time)
Description copied from interface:AlarmHistoryRestService
Retrieve the last known state of an alarm at the given time.- Specified by:
getAlarm
in interfaceAlarmHistoryRestService
- Parameters:
alarmId
- alarm id to querymatchType
- when set the 'reduction-key', lookup by reduction key instead of alarm idtime
- timestamp in milliseconds - defaults to "now" when null- Returns:
- last known state
-
getActiveAlarmsAt
public Collection<AlarmState> getActiveAlarmsAt(Long time)
Description copied from interface:AlarmHistoryRestService
Retrieve the last known state of all alarms which were active at the given time.- Specified by:
getActiveAlarmsAt
in interfaceAlarmHistoryRestService
- Parameters:
time
- timestamp in milliseconds- Returns:
- last known state of all alarms which were active at the given time - defaults to "now" when null
-
-