Search in sources :

Example 1 with NetworkDeletedEvent

use of org.obiba.mica.network.event.NetworkDeletedEvent in project mica2 by obiba.

the class NetworkService method delete.

/**
 * Delete a {@link Network}.
 *
 * @param id
 * @throws NoSuchNetworkException
 */
public void delete(@NotNull String id) throws NoSuchNetworkException {
    Network network = findById(id);
    checkConstraints(network);
    networkRepository.deleteWithReferences(network);
    if (network.getLogo() != null)
        fileStoreService.delete(network.getLogo().getId());
    fileSystemService.delete(FileUtils.getEntityPath(network));
    networkStateRepository.delete(id);
    gitService.deleteGitRepository(network);
    eventBus.post(new NetworkDeletedEvent(network));
}
Also used : Network(org.obiba.mica.network.domain.Network) NetworkDeletedEvent(org.obiba.mica.network.event.NetworkDeletedEvent)

Aggregations

Network (org.obiba.mica.network.domain.Network)1 NetworkDeletedEvent (org.obiba.mica.network.event.NetworkDeletedEvent)1