skip to main content
TGO > Programmers documentation > Business objects and data sources > Alarms > Creating an alarm with the API
 
Creating an alarm with the API
All you have to do is create a new alarm using the class IltAlarm and add it to a data source, as follows:
How to create an alarm through the API
 
IltAlarm alarm = new IltAlarm("alarm 1");
alarm.setAttributeValue(IltAlarm.PerceivedSeverityAttribute,IltAlarm.Severity.Warning);
alarm.setAttributeValue(IltAlarm.AlarmAckStateAttribute,Boolean.FALSE);
alarm.setAttributeValue(IltAlarm.ProbableCauseAttribute,
    IltAlarm.ProbableCause.ExcessiveBitErrorRate);
alarm.setAttributeValue(IltAlarm.ManagedObjectInstanceAttribute, new
String("Router1"));
alarm.setAttributeValue(IltAlarm.AlarmRaisedTimeAttribute, new Date());
 
IltDataSource dataSource = new IltDefaultDataSource();
dataSource.addObject(alarm);

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.