Search in sources :

Example 1 with PublishCascadingScope

use of org.obiba.mica.core.domain.PublishCascadingScope in project mica2 by obiba.

the class FileSystemService method datasetPublished.

@Async
@Subscribe
public void datasetPublished(DatasetPublishedEvent event) {
    log.debug("{} {} was published", event.getPersistable().getClass().getSimpleName(), event.getPersistable());
    PublishCascadingScope cascadingScope = event.getCascadingScope();
    if (cascadingScope != PublishCascadingScope.NONE) {
        publishWithCascading(// 
        String.format("/%s/%s", getDatasetTypeFolder(event.getPersistable()), event.getPersistable().getId()), // 
        true, // 
        event.getPublisher(), // 
        cascadingScope);
    }
}
Also used : PublishCascadingScope(org.obiba.mica.core.domain.PublishCascadingScope) Async(org.springframework.scheduling.annotation.Async) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with PublishCascadingScope

use of org.obiba.mica.core.domain.PublishCascadingScope in project mica2 by obiba.

the class FileSystemService method studyPublished.

// 
// Event handling
// 
@Async
@Subscribe
public void studyPublished(StudyPublishedEvent event) {
    log.debug("Study {} was published", event.getPersistable());
    PublishCascadingScope cascadingScope = event.getCascadingScope();
    if (cascadingScope != PublishCascadingScope.NONE) {
        publishWithCascading(// 
        String.format("/%s/%s", event.getPersistable().getResourcePath(), event.getPersistable().getId()), // 
        true, // 
        event.getPublisher(), // 
        cascadingScope);
    }
}
Also used : PublishCascadingScope(org.obiba.mica.core.domain.PublishCascadingScope) Async(org.springframework.scheduling.annotation.Async) Subscribe(com.google.common.eventbus.Subscribe)

Example 3 with PublishCascadingScope

use of org.obiba.mica.core.domain.PublishCascadingScope in project mica2 by obiba.

the class FileSystemService method networkPublished.

@Async
@Subscribe
public void networkPublished(NetworkPublishedEvent event) {
    log.debug("Network {} was published", event.getPersistable());
    PublishCascadingScope cascadingScope = event.getCascadingScope();
    if (cascadingScope != PublishCascadingScope.NONE) {
        publishWithCascading(// 
        String.format("/network/%s", event.getPersistable().getId()), // 
        true, // 
        event.getPublisher(), // 
        cascadingScope);
    }
}
Also used : PublishCascadingScope(org.obiba.mica.core.domain.PublishCascadingScope) Async(org.springframework.scheduling.annotation.Async) Subscribe(com.google.common.eventbus.Subscribe)

Example 4 with PublishCascadingScope

use of org.obiba.mica.core.domain.PublishCascadingScope in project mica2 by obiba.

the class FileSystemService method projectPublished.

@Async
@Subscribe
public void projectPublished(ProjectPublishedEvent event) {
    log.debug("Project {} was published", event.getPersistable());
    PublishCascadingScope cascadingScope = event.getCascadingScope();
    if (cascadingScope != PublishCascadingScope.NONE) {
        publishWithCascading(// 
        String.format("/project/%s", event.getPersistable().getId()), // 
        true, // 
        event.getPublisher(), // 
        cascadingScope);
    }
}
Also used : PublishCascadingScope(org.obiba.mica.core.domain.PublishCascadingScope) Async(org.springframework.scheduling.annotation.Async) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)4 PublishCascadingScope (org.obiba.mica.core.domain.PublishCascadingScope)4 Async (org.springframework.scheduling.annotation.Async)4