use of org.commonjava.indy.change.event.ArtifactStoreUpdateType in project indy by Commonjava.
the class TimeoutEventListener method onStoreUpdate.
public void onStoreUpdate(@Observes final ArtifactStorePostUpdateEvent event) {
final ArtifactStoreUpdateType eventType = event.getType();
if (eventType == ArtifactStoreUpdateType.UPDATE) {
for (final ArtifactStore store : event) {
final StoreKey key = store.getKey();
final StoreType type = key.getType();
if (type == StoreType.hosted) {
logger.info("[ADJUST TIMEOUTS] Adjusting snapshot expirations in: {}", store.getKey());
try {
scheduleManager.rescheduleSnapshotTimeouts((HostedRepository) store);
} catch (final IndySchedulerException e) {
logger.error("Failed to update snapshot timeouts in: " + store.getKey(), e);
}
} else if (type == StoreType.remote) {
logger.info("[ADJUST TIMEOUTS] Adjusting proxied-file expirations in: {}", store.getKey());
try {
scheduleManager.rescheduleProxyTimeouts((RemoteRepository) store);
} catch (final IndySchedulerException e) {
logger.error("Failed to update proxy-cache timeouts in: " + store.getKey(), e);
}
}
}
}
}
Aggregations