use of cern.laser.client.impl.data.AlarmImpl in project ACS by ACS-Community.
the class AlarmBrowsingHandlerImpl method getAlarmById.
//
// -- PUBLIC METHODS ----------------------------------------------
//
//
// -- extends AlarmBrowsingHandler --------------------------------
//
public Alarm getAlarmById(String alarmId) throws LaserException {
try {
if (m_laser != null) {
alma.alarmsystem.Alarm a = m_laser.getAlarmById(alarmId);
cern.laser.business.data.Alarm alarmBusiness = toBusinessAlarm(a);
return new AlarmImpl(alarmBusiness);
} else {
throw new NullPointerException("AlarmSystem component is null");
}
} catch (Exception e) {
throw new LaserException("unable to get alarm by id " + alarmId, e);
}
}
use of cern.laser.client.impl.data.AlarmImpl in project ACS by ACS-Community.
the class AlarmBrowsingHandlerImpl method getAlarmByTriplet.
public Alarm getAlarmByTriplet(String faultFamily, String faultMember, Integer faultCode) throws LaserException {
if ((faultFamily == null) || (faultMember == null) || (faultCode == null)) {
throw new IllegalArgumentException("parameter cannot be null");
}
try {
if (m_laser != null) {
alma.alarmsystem.Alarm a = m_laser.getAlarmByTriplet(faultFamily, faultMember, faultCode.intValue());
cern.laser.business.data.Alarm alarmBusiness = toBusinessAlarm(a);
return new AlarmImpl(alarmBusiness);
} else {
throw new NullPointerException("AlarmSystem component is null");
}
} catch (Exception e) {
throw new LaserException("unable to get alarm by triplet " + faultFamily + ":" + faultMember + ":" + faultCode, e);
}
}
use of cern.laser.client.impl.data.AlarmImpl in project ACS by ACS-Community.
the class AlarmBrowsingHandlerImpl method toBusinessAlarmCollection.
/**
* Helper method.
* @param as
* @return
*/
public static Collection toBusinessAlarmCollection(alma.alarmsystem.Alarm[] as) {
if (as == null || as.length == 0)
return new ArrayList(0);
Collection result = new ArrayList(as.length);
for (int i = 0; i < as.length; i++) {
cern.laser.business.data.Alarm alarmBusiness = toBusinessAlarm(as[i]);
result.add(new AlarmImpl(alarmBusiness));
}
return result;
}
use of cern.laser.client.impl.data.AlarmImpl in project ACS by ACS-Community.
the class AlarmSelectionHelper method onMessage.
//
// -- implements SubscriptionListener ---------------------------------
//
/**
* DOCUMENT ME!
*
* @param msg DOCUMENT ME!
*/
public void onMessage(Message msg) {
ACSJMSTextMessage acsMsg = (ACSJMSTextMessage) msg;
if (selectionListener != null) {
try {
cern.laser.business.data.AlarmImpl business_alarm = AlarmMessageConversion.getAlarm(((ACSJMSTextMessage) msg).getText());
AlarmImpl alarm = new AlarmImpl(business_alarm);
selectionListener.onAlarm(alarm);
} catch (Exception e) {
LOGGER.warn("error on message", e);
}
}
}
Aggregations