use of alma.alarmsystem.alarmmessage.generated.Threshold in project ACS by ACS-Community.
the class ACSAlarmDAOImpl method addThreshold.
public void addThreshold(ReductionDefinitions rds, Threshold th) {
if (th == null)
throw new IllegalArgumentException("Null Threshold argument");
//alma.alarmsystem.alarmmessage.generated.ReductionDefinitions rds = getReductionRules();
alma.alarmsystem.alarmmessage.generated.Threshold[] tmp = rds.getThresholds().getThreshold();
for (int i = 0; i < tmp.length; i++) {
alma.alarmsystem.alarmmessage.generated.AlarmDefinition p1 = th.getAlarmDefinition();
alma.alarmsystem.alarmmessage.generated.AlarmDefinition p2 = tmp[i].getAlarmDefinition();
String n1 = new String(p1.getFaultFamily() + ":" + p1.getFaultMember() + ":" + p1.getFaultCode());
String n2 = new String(p2.getFaultFamily() + ":" + p2.getFaultMember() + ":" + p2.getFaultCode());
if (n1.compareTo(n2) == 0)
throw new IllegalStateException("Threshold entry already exists");
}
rds.getThresholds().addThreshold(th);
//Reflect the changes into the AlarmDAO
alma.alarmsystem.alarmmessage.generated.AlarmDefinition in = th.getAlarmDefinition();
Alarm p = getAlarm(in.getFaultFamily() + ":" + in.getFaultMember() + ":" + in.getFaultCode());
p.setMultiplicityThreshold(th.getValue());
//flushReductionRules(rds);
}
Aggregations