use of cern.laser.business.LaserRuntimeException in project ACS by ACS-Community.
the class AlarmCacheServerImpl method publish.
public void publish(Collection alarmChanges) {
try {
logger.log(AcsLogLevel.DEBUG, "publishing " + alarmChanges.size() + " alarm(s)...");
alarmPublisher.publish(alarmChanges);
logger.log(AcsLogLevel.DEBUG, "published");
} catch (Exception e) {
throw new LaserRuntimeException("unable to publish alarm(s)", e);
}
}
use of cern.laser.business.LaserRuntimeException in project ACS by ACS-Community.
the class AlarmCacheServerImpl method store.
public void store(Collection updated) {
try {
logger.log(AcsLogLevel.DELOUSE, "storing " + updated.size() + " alarm(s)...");
Iterator iterator = updated.iterator();
while (iterator.hasNext()) {
Alarm alarm = (Alarm) iterator.next();
Status status = alarm.getStatus();
// if (status.getStatusId() == null || status.getStatusId().equals("")) {
// if (LOGGER.isDebugEnabled()) LOGGER.debug("saving status ...");
// status.setStatusId(alarm.getAlarmId());
// alarmDAO.saveStatus(status);
// } else {
// if (LOGGER.isDebugEnabled()) LOGGER.debug("updating status ...");
alarmDAO.updateStatus(status);
// }
}
logger.log(AcsLogLevel.DELOUSE, "stored");
} catch (Exception e) {
throw new LaserRuntimeException("unable to store alarm(s)", e);
}
}
use of cern.laser.business.LaserRuntimeException in project ACS by ACS-Community.
the class AlarmDefinitionServiceImpl method createNodeLinkInternal.
private void createNodeLinkInternal(String userId, ReductionLink link) throws LaserDefinitionException {
Alarm[] parent_child = validateReductionLink(link);
AdminUser admin_user = adminUserDAO.findAdminUser(userId);
try {
LOGGER.info("user " + admin_user.getName() + " creating node link : " + link);
//alarmDAO.findAlarm(link.getParent().getAlarmId());
Alarm parent = parent_child[0];
//alarmDAO.findAlarm(link.getChild().getAlarmId());
Alarm child = parent_child[1];
parent.addNodeChild(child);
alarmDAO.updateAlarm(parent);
LOGGER.info("node link created");
} catch (Exception e) {
throw new LaserRuntimeException("unable to create the node link " + link + " : " + e.getMessage(), e);
}
}
use of cern.laser.business.LaserRuntimeException in project ACS by ACS-Community.
the class AlarmPublisherImpl method sendSearch.
/**
* @param init_alarms
* @param destination
*/
public void sendSearch(Collection alarms, String destination) {
try {
logger.log(AcsLogLevel.DEBUG, "sending " + alarms.size() + " search alarm(s) to " + destination + "...");
Topic topic = getTopicSession().createTopic(destination);
ObjectMessage message = getTopicSession().createObjectMessage();
Iterator iterator = alarms.iterator();
while (iterator.hasNext()) {
AlarmImpl alarm = (AlarmImpl) iterator.next();
message.setObject(alarm);
message.clearProperties();
setMessageProperties(message, alarm);
getTopicPublisher().publish(topic, message);
}
logger.log(AcsLogLevel.DEBUG, "search alarm(s) sent to " + destination);
} catch (Exception e) {
close();
throw new LaserRuntimeException("unable to send search alarms to " + destination + " : " + e.getMessage());
}
sendSearchFinished(destination);
}
use of cern.laser.business.LaserRuntimeException in project ACS by ACS-Community.
the class AlarmPublisherImpl method sendSearchFinished.
//
// -- PRIVATE METHODS --------------------------------------------
//
private void sendSearchFinished(String destination) {
try {
logger.log(AcsLogLevel.DEBUG, "sending search finished message to " + destination + "...");
Topic topic = getTopicSession().createTopic(destination);
Message message = getTopicSession().createMessage();
message.setObjectProperty(LASER_SEARCH_PROPERTY, Boolean.TRUE);
getTopicPublisher().publish(topic, message);
logger.log(AcsLogLevel.DEBUG, "search finished message sent to " + destination);
} catch (Exception e) {
close();
throw new LaserRuntimeException("unable to send search finished message to " + destination + " : " + e.getMessage());
}
}
Aggregations