use of org.commonjava.indy.change.event.ArtifactStorePostUpdateEvent in project indy by Commonjava.
the class AuthoritativeIndexSettingManager method setAuthoritativeManager.
public void setAuthoritativeManager(@Observes final ArtifactStorePostUpdateEvent event) {
if (indexCfg == null || !indexCfg.isAuthoritativeIndex()) {
return;
}
final Collection<ArtifactStore> stores = event.getChanges();
stores.stream().filter(store -> store.getKey().getType() == StoreType.hosted).forEach(store -> {
final HostedRepository hosted = (HostedRepository) store;
if (hosted.isReadonly()) {
hosted.setAuthoritativeIndex(true);
} else {
hosted.setAuthoritativeIndex(false);
}
});
}
use of org.commonjava.indy.change.event.ArtifactStorePostUpdateEvent in project indy by Commonjava.
the class DefaultStoreEventDispatcher method updated.
@Override
public void updated(final ArtifactStoreUpdateType type, final EventMetadata eventMetadata, final Map<ArtifactStore, ArtifactStore> changeMap) {
executor.execute(() -> {
final ArtifactStorePostUpdateEvent event = new ArtifactStorePostUpdateEvent(type, eventMetadata, changeMap);
fireEvent(updatePostEvent, event);
});
}
Aggregations