Public Member Functions | |
AlarmRefMatcher (String familySpec, String memberSpec, int code, boolean interpretStringsAsPatterns) throws IllegalArgumentException | |
boolean | isMatch (Alarm a) |
String | getMatcherAlarmID () |
String | toString () |
Utility class to check if an alarm matches an alarm reference specification. Given a fault family, a fault member, and a fault code specification (that is, an alarm reference), it is able to decide if a given Alarm matches with that definition. Alarm references are present, for example, under the parent
and child
elements of each reduction-link
, which represents a Reduction Rule on the Alarm System.
Alarm references might use either wildcards or regular expressions to specify several alarms at a time. The alma.acs.alarms.refpattern
property controls whether the strings stored in the CDB should be interpreted as wildcards (like 'ab*cd??d'
) or as Java regular expressions (like'^ab.*cd..d$'
). It can take the following values: wildcard
or regexp
values
This class was originally embedded in the ACSAlarmDAOImpl class. Most of the following commented code was thought for handling also code ranges. This was designed to be specified as a String, but since the current schema for the RRs defines the "fault-code" field in the "alarm-definition" node as "xs:int", the received value is always an integer, which then was being String.valueOf()-ed to get it as String and pass it to this class constructor.
com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.AlarmRefMatcher | ( | String | familySpec, | |
String | memberSpec, | |||
int | code, | |||
boolean | interpretStringsAsPatterns | |||
) | throws IllegalArgumentException |
String com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.getMatcherAlarmID | ( | ) |
Return the ID of the alarm. Note that this ID could contains wildcards and regular expression.
Parent alarms in reduction rules do not contain regular expression neither wildcards.
boolean com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.isMatch | ( | Alarm | a | ) |
References cern.laser.business.data.Triplet.getFaultCode(), cern.laser.business.data.Triplet.getFaultFamily(), cern.laser.business.data.Triplet.getFaultMember(), and cern.laser.business.data.Alarm.getTriplet().
Referenced by com.cosylab.acs.laser.dao.utils.LinkSpec.matchChild(), and com.cosylab.acs.laser.dao.utils.LinkSpec.matchParent().
String com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.toString | ( | ) |
Referenced by com.cosylab.acs.laser.dao.utils.LinkSpec.toString().