Search in sources :

Example 1 with CommentedAlarmMap

use of cern.laser.console.CommentedAlarmMap 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;
}
Also used : CommentedAlarmMap(cern.laser.console.CommentedAlarmMap) CommentedAlarm(cern.laser.console.CommentedAlarm) Alarm(cern.laser.client.data.Alarm) Iterator(java.util.Iterator) CommentedAlarm(cern.laser.console.CommentedAlarm)

Aggregations

Alarm (cern.laser.client.data.Alarm)1 CommentedAlarm (cern.laser.console.CommentedAlarm)1 CommentedAlarmMap (cern.laser.console.CommentedAlarmMap)1 Iterator (java.util.Iterator)1