public class AlarmRefMatcher
extends java.lang.Object
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.
| Constructor and Description |
|---|
AlarmRefMatcher(java.lang.String familySpec,
java.lang.String memberSpec,
int code,
boolean interpretStringsAsPatterns) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMatcherAlarmID()
Return the ID of the alarm.
|
boolean |
isMatch(Alarm a) |
java.lang.String |
toString() |
public AlarmRefMatcher(java.lang.String familySpec,
java.lang.String memberSpec,
int code,
boolean interpretStringsAsPatterns)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic boolean isMatch(Alarm a)
public java.lang.String getMatcherAlarmID()
Parent alarms in reduction rules do not contain regular expression neither wildcards.
public java.lang.String toString()
toString in class java.lang.Object