use of cern.laser.client.data.Category in project ACS by ACS-Community.
the class AlarmSearchHelper method getCategoryIds.
private Integer[] getCategoryIds(Selection selection) throws LaserConnectionException, LaserException {
Category[] categories = selection.getCategorySelection().list();
Collection category_ids = new ArrayList(categories.length);
for (int i = 0; i < categories.length; i++) {
category_ids.add(categories[i].getCategoryId());
}
return (Integer[]) category_ids.toArray(new Integer[category_ids.size()]);
}
use of cern.laser.client.data.Category in project ACS by ACS-Community.
the class AlarmSelectionHelper method setupCategorySubscriptions.
private Collection setupCategorySubscriptions(Selection selection, String sql_filter) throws LaserConnectionException, LaserException {
Category[] categories = selection.getCategorySelection().list();
Collection category_ids = new ArrayList(categories.length);
for (int i = 0; i < categories.length; i++) {
Category category = categories[i];
String topic = getCategoryRootTopic() + "." + category.getPath();
if (selectionListener != null) {
try {
getSubscriber().subscribe(topic, this, sql_filter);
} catch (Exception e1) {
new LaserException("unable to subscribe to topic " + topic, e1);
}
}
category_ids.add(category.getCategoryId());
}
return category_ids;
}
Aggregations