public void addAlarm(int alarmID) {
AlarmT alarm = new AlarmT();
EventInformationT eventInfo = new EventInformationT();
ProbableCauseT probableCause = new ProbableCauseT();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss.SSSZ");
switch (alarmID % 2) {
case 1:
eventInfo.setNotificationId("0001239");
eventInfo.setObjectType(ObjectTypeT.OT_EQUIPMENT);
eventInfo.setObjectName(new NamingAttributesT());
eventInfo.setOsTime(formatter.format(new Date()));
eventInfo.setNeTime(formatter.format(new Date()));
eventInfo.setEdgePointRelated(Boolean.FALSE);
probableCause.setType("PROP_odd_probable_cause_type");
alarm.setEventInfo(eventInfo);
alarm.setIsClearable(false);
alarm.setLayerRate("PROP_layer_rate_odd");
alarm.setProbableCause(probableCause);
alarm.setPerceivedSeverity("PROP_odd_perceived_severity");
alarm.setServiceAffecting(ServiceAffectingT.SA_UNKNOWN);
alarm.setRcaiIndicator(false);
break;
default:
eventInfo.setNotificationId("9876543");
eventInfo.setObjectType(ObjectTypeT.OT_OS);
eventInfo.setObjectName(new NamingAttributesT());
eventInfo.setOsTime(formatter.format(new Date()));
eventInfo.setEdgePointRelated(Boolean.FALSE);
probableCause.setType("PROP_even_probable_cause_type");
alarm.setEventInfo(eventInfo);
alarm.setIsClearable(true);
alarm.setLayerRate("PROP_layer_rate_even");
alarm.setProbableCause(probableCause);
alarm.setPerceivedSeverity("PROP_even_perceived_severity");