/** * Returns all of the ACTIVE alarms for a specific device. Recently cleared alarms excluded. * * @param deviceId the device to use when searching alarms. * @return set of alarms; empty set if no alarms */ default Set<Alarm> getActiveAlarms(DeviceId deviceId) { return getActiveAlarms().stream() .filter(a -> deviceId.equals(a.deviceId())) .collect(Collectors.toSet()); }
static Map<Alarm.SeverityLevel, Long> lookUpAlarmCounts() { return alarmService().getAlarmCounts(); }
static Set<Alarm> lookUpAlarms(DeviceId deviceId) { return alarmService().getAlarms(deviceId); }
static Alarm lookupAlarm(AlarmId alarmId) { return alarmService().getAlarm(alarmId); }
static Map<Alarm.SeverityLevel, Long> lookUpAlarmCounts(DeviceId deviceId) { return alarmService().getAlarmCounts(deviceId); }
static Set<Alarm> lookUpAlarms() { return alarmService().getAlarms(); }
@Override protected void execute() { printAlarms(AbstractShellCommand.get(AlarmService.class).getActiveAlarms()); }
@Override protected void execute() { Map<Alarm.SeverityLevel, Long> alarmCounts = AbstractShellCommand.get(AlarmService.class).getAlarmCounts(); printCounts(alarmCounts); }
@Override protected void execute() { printAlarms(AbstractShellCommand.get(AlarmService.class).getAlarms()); }
@Override protected void execute() { Map<Alarm.SeverityLevel, Long> alarmCounts = AbstractShellCommand.get(AlarmService.class). getAlarmCounts(DeviceId.deviceId(deviceId)); // Deliberately using same formatting for both ... printCounts(alarmCounts); }
private void sendMouseData() { if (elementOfNote != null && elementOfNote instanceof Device) { DeviceId devId = (DeviceId) elementOfNote.id(); Set<Alarm> alarmsOnDevice = alarmService.getAlarms(devId); Highlights highlights = new Highlights(); addDeviceBadge(highlights, devId, alarmsOnDevice.size()); sendHighlights(highlights); } // Note: could also process Host, if available }