package anastore.store;

import java.util.Set;

/**
 * A handler for version deprecation events.
 */
public interface DeprecationHandler
{
    /**
     * This method will be called when a set of deprecations occurs
     * where at least one of the versions in the set has the handler
     * registered.
     *<p>
     * This method <i>must not</i> directly write to or deprecate
     * blocks in the cache or there will be a deadlock.
     *
     * @param deps The set of all ID's being deprecated.  This set may
     * include ID's for which this handler is not registered; however,
     * it will include at least one for which it is registered.
     * @param upperBound The upper bound of the deprecation -- that
     * is, the upper bound given to everything in deps.
     */
    public void onDeprecation(Set<Long> deps, long upperBound);
}
