use of cern.laser.console.CommentedAlarm in project ACS by ACS-Community.
the class ConfigurationImpl method buildCommentedAlarmMap.
//
// -- PROTECTED METHODS -------------------------------------------
//
//
// -- PRIVATE METHODS ---------------------------------------------
//
private CommentedAlarmMap buildCommentedAlarmMap(Collection commentedAlarmRefs, boolean removeChanged) throws Exception {
CommentedAlarmMap result = new CommentedAlarmMap();
if ((commentedAlarmRefs == null) || (commentedAlarmRefs.size() == 0)) {
return result;
}
Iterator iterator = commentedAlarmRefs.iterator();
while (iterator.hasNext()) {
CommentedAlarmRef ref = (CommentedAlarmRef) iterator.next();
Alarm alarm = AlarmBrowsingHandler.get(orb, logger).getAlarmById(ref.getAlarmId());
if ((!removeChanged) || (removeChanged && alarm.getStatus().getSourceTimestamp().equals(ref.getSourceTimestamp()))) {
result.put(new CommentedAlarm(alarm, ref.getComment()));
}
}
return result;
}
use of cern.laser.console.CommentedAlarm in project ACS by ACS-Community.
the class ConfigurationImpl method buildCommentedAlarmCollection.
private Collection buildCommentedAlarmCollection(CommentedAlarmMap alarms) {
Collection result = new ArrayList();
if ((alarms == null) || (alarms.size() == 0)) {
return result;
}
Iterator iterator = alarms.values().iterator();
while (iterator.hasNext()) {
CommentedAlarm alarm = (CommentedAlarm) iterator.next();
result.add(new CommentedAlarmRef(alarm.getAlarm().getAlarmId(), alarm.getAlarm().getStatus().getSourceTimestamp(), alarm.getComment()));
}
return result;
}
Aggregations