use of org.obiba.mica.dataset.event.HarmonizationDatasetIndexedEvent in project mica2 by obiba.
the class HarmonizedDatasetService method indexAll.
public void indexAll(boolean mustIndexVariables) {
Set<HarmonizationDataset> publishedDatasets = Sets.newHashSet(findAllPublishedDatasets());
findAllDatasets().forEach(dataset -> {
try {
eventBus.post(new DatasetUpdatedEvent(dataset));
if (publishedDatasets.contains(dataset)) {
Map<String, List<DatasetVariable>> harmonizationVariables = mustIndexVariables && publishedDatasets.contains(dataset) ? populateHarmonizedVariablesMap(dataset) : null;
Iterable<DatasetVariable> datasetVariables = mustIndexVariables && publishedDatasets.contains(dataset) ? wrappedGetDatasetVariables(dataset) : null;
eventBus.post(new DatasetPublishedEvent(dataset, datasetVariables, harmonizationVariables, getCurrentUsername()));
}
} catch (Exception e) {
log.error(String.format("Error indexing dataset %s", dataset), e);
}
});
eventBus.post(new HarmonizationDatasetIndexedEvent());
}
Aggregations