use of org.obiba.mica.network.event.IndexNetworksEvent in project mica2 by obiba.
the class ElasticsearchUpgrade method execute.
@Override
public void execute(Version version) {
log.info("Rebuild elasticsearch indices.");
cacheService.clearOpalTaxonomiesCache();
eventBus.post(new IndexStudiesEvent());
eventBus.post(new IndexFilesEvent());
eventBus.post(new IndexContactsEvent());
eventBus.post(new IndexNetworksEvent());
eventBus.post(new IndexDatasetsEvent());
}
use of org.obiba.mica.network.event.IndexNetworksEvent in project mica2 by obiba.
the class Mica320Upgrade method execute.
@Override
public void execute(Version version) {
logger.info("Executing Mica upgrade to version 3.2.0");
try {
logger.info("Updating variable's variableType vocabulary terms.");
mongoTemplate.execute(db -> db.eval(variableTypeVocabularyTermsUpdate()));
} catch (Exception e) {
logger.error("Failed to update variable's variableType vocabulary terms", e);
}
try {
logger.info("Indexing Taxonomies");
eventBus.post(new TaxonomiesUpdatedEvent());
} catch (Exception e) {
logger.error("Failed to index Taxonomies", e);
}
try {
logger.info("Re-indexing studies");
eventBus.post(new IndexStudiesEvent());
} catch (Exception e) {
logger.error("Failed to re-index studies", e);
}
try {
logger.info("Re-indexing networks");
eventBus.post(new IndexNetworksEvent());
} catch (Exception e) {
logger.error("Failed to re-index networks", e);
}
}
use of org.obiba.mica.network.event.IndexNetworksEvent in project mica2 by obiba.
the class MicaConfigResource method updateIndices.
@PUT
@Path("/_index")
@Timed
@RequiresRoles(Roles.MICA_ADMIN)
public Response updateIndices() {
eventBus.post(new IndexStudiesEvent());
eventBus.post(new IndexFilesEvent());
eventBus.post(new IndexContactsEvent());
eventBus.post(new IndexNetworksEvent());
eventBus.post(new IndexDatasetsEvent());
eventBus.post(new TaxonomiesUpdatedEvent());
return Response.noContent().build();
}
Aggregations