001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.cache;
003
004public interface ICachedLoaderListener {
005
006    /**
007     * Result of download
008     */
009    enum LoadResult {
010        SUCCESS,
011        FAILURE,
012        CANCELED
013    }
014
015    /**
016     * Will be called when K object processed. The result might be:
017     * LoadResult.SUCCESS when object was fetched
018     * LoadResult.FAILURE when there was a failure during download
019     * LoadResult.REJECTED when job was rejected because of full queue
020     *
021     * @param data cache entry contents
022     * @param attributes cache entry attributes
023     * @param result load result (success, failure, canceled)
024     */
025    void loadingFinished(CacheEntry data, CacheEntryAttributes attributes, LoadResult result);
026}