Search in sources :

Example 1 with DatasetDeletedEvent

use of org.obiba.mica.dataset.event.DatasetDeletedEvent in project mica2 by obiba.

the class CollectedDatasetService method delete.

public void delete(String id) {
    StudyDataset dataset = studyDatasetRepository.findOne(id);
    if (dataset == null) {
        throw NoSuchDatasetException.withId(id);
    }
    fileSystemService.delete(FileUtils.getEntityPath(dataset));
    helper.evictCache(dataset);
    studyDatasetRepository.delete(id);
    studyDatasetStateRepository.delete(id);
    gitService.deleteGitRepository(dataset);
    eventBus.post(new DatasetDeletedEvent(dataset));
}
Also used : DatasetDeletedEvent(org.obiba.mica.dataset.event.DatasetDeletedEvent) StudyDataset(org.obiba.mica.dataset.domain.StudyDataset)

Example 2 with DatasetDeletedEvent

use of org.obiba.mica.dataset.event.DatasetDeletedEvent in project mica2 by obiba.

the class HarmonizedDatasetService method delete.

public void delete(String id) {
    HarmonizationDataset dataset = harmonizationDatasetRepository.findOne(id);
    if (dataset == null) {
        throw NoSuchDatasetException.withId(id);
    }
    fileSystemService.delete(FileUtils.getEntityPath(dataset));
    helper.evictCache(dataset);
    harmonizationDatasetStateRepository.delete(id);
    harmonizationDatasetRepository.delete(id);
    gitService.deleteGitRepository(dataset);
    eventBus.post(new DatasetDeletedEvent(dataset));
}
Also used : DatasetDeletedEvent(org.obiba.mica.dataset.event.DatasetDeletedEvent) HarmonizationDataset(org.obiba.mica.dataset.domain.HarmonizationDataset)

Aggregations

DatasetDeletedEvent (org.obiba.mica.dataset.event.DatasetDeletedEvent)2 HarmonizationDataset (org.obiba.mica.dataset.domain.HarmonizationDataset)1 StudyDataset (org.obiba.mica.dataset.domain.StudyDataset)1