Search in sources :

Example 1 with ArtifactStoreDeletePostEvent

use of org.commonjava.indy.change.event.ArtifactStoreDeletePostEvent in project indy by Commonjava.

the class DefaultStoreEventDispatcher method deleted.

@Override
public void deleted(final EventMetadata eventMetadata, final ArtifactStore... stores) {
    if (postDelEvent != null) {
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.trace("Requesting execution of store post-delete event for: {}", Arrays.asList(stores));
        executor.execute(() -> {
            logger.trace("Firing store post-delete event for: {}", Arrays.asList(stores));
            final Map<ArtifactStore, Transfer> storeRoots = new HashMap<>();
            for (final ArtifactStore store : stores) {
                if (store == null) {
                    continue;
                }
                final Transfer root = fileManager.getStoreRootDirectory(store);
                storeRoots.put(store, root);
            }
            final ArtifactStoreDeletePostEvent event = new ArtifactStoreDeletePostEvent(eventMetadata, storeRoots);
            postDelEvent.fire(event);
        });
    }
}
Also used : HashMap(java.util.HashMap) ArtifactStore(org.commonjava.indy.model.core.ArtifactStore) Transfer(org.commonjava.maven.galley.model.Transfer) Logger(org.slf4j.Logger) ArtifactStoreDeletePostEvent(org.commonjava.indy.change.event.ArtifactStoreDeletePostEvent)

Aggregations

HashMap (java.util.HashMap)1 ArtifactStoreDeletePostEvent (org.commonjava.indy.change.event.ArtifactStoreDeletePostEvent)1 ArtifactStore (org.commonjava.indy.model.core.ArtifactStore)1 Transfer (org.commonjava.maven.galley.model.Transfer)1 Logger (org.slf4j.Logger)1