Public Member Functions

com.cosylab.acs.laser.dao.utils.AlarmRefMatcher Class Reference

List of all members.

Public Member Functions

 AlarmRefMatcher (String familySpec, String memberSpec, int code, boolean interpretStringsAsPatterns) throws IllegalArgumentException
boolean isMatch (Alarm a)
String getMatcherAlarmID ()
String toString ()

Detailed Description

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.

Author:
acaproni, rtobar : only compile patterns when adequate, check http://almasw.hq.eso.org/almasw/bin/view/Main/RodrigoTobarDailyWorklog#08_02_11 for details

Constructor & Destructor Documentation

com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.AlarmRefMatcher ( String  familySpec,
String  memberSpec,
int  code,
boolean  interpretStringsAsPatterns 
) throws IllegalArgumentException

Member Function Documentation

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.

Returns:
The ID of the alarm
boolean com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.isMatch ( Alarm  a  ) 
String com.cosylab.acs.laser.dao.utils.AlarmRefMatcher.toString (  ) 

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties