use of cern.laser.business.ProcessingController in project ACS by ACS-Community.
the class CoreServiceImpl method select.
//
// -- PRIVATE METHODS ---------------------------------------------
//
/*
* (non-Javadoc)
*
* @see cern.laser.business.ejb.CoreServiceSessionEJB#select(java.lang.Integer, java.lang.String)
*/
private void select(Integer categoryId, String clientId) throws LaserProcessingException {
System.out.println("*** CoreServiceImpl::select: selecting category " + categoryId.toString() + " for client " + clientId);
ProcessingController processingController = ProcessingController.getInstance();
if (!processingController.isProcessing()) {
throw new LaserProcessingException("server not initialized");
}
try {
if (LOGGER.isInfoEnabled()) {
Category category = categoryDAO.findCategory(categoryId);
String category_path = category.getPath();
LOGGER.info("requested category : " + category_path);
}
String destination = getClientRootTopic() + "." + clientId;
CategoryActiveList active_list = alarmCache.getActiveListReference(categoryId);
String[] active_alarms = active_list.getActiveAlarms();
if (active_alarms.length > 0) {
Collection init_alarms = new HashSet(active_alarms.length);
for (int i = 0; i < active_alarms.length; i++) {
Alarm alarm = alarmCache.getReference(active_alarms[i]);
init_alarms.add(alarm);
}
LOGGER.info("found " + init_alarms.size() + " matching alarm(s)");
alarmPublisher.sendInit(init_alarms, destination);
}
} catch (AlarmCacheException e) {
System.err.println("*** Got an exception! " + e.getMessage());
e.printStackTrace(System.out);
System.err.println("*** Exception masked");
//throw new EJBException("unable to select alarms", e);
}
}
Aggregations