source: josm/trunk/src/org/openstreetmap/josm/data/cache/ICachedLoaderJob.java@ 9618

Last change on this file since 9618 was 8795, checked in by Don-vip, 9 years ago

fix javadoc errors/warnings seen with JDK9

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.cache;
3
4import java.io.IOException;
5import java.net.URL;
6
7/**
8 *
9 * @author Wiktor Niesiobędzki
10 *
11 * @param <K> cache key type
12 */
13public interface ICachedLoaderJob<K> {
14 /**
15 * returns cache entry key
16 *
17 * @return cache key for tile
18 */
19 K getCacheKey();
20
21 /**
22 * method to get download URL for Job
23 * @return URL that should be fetched
24 * @throws IOException when could not determine the URL of the tile
25 *
26 */
27 URL getUrl() throws IOException;
28
29 /**
30 * implements the main algorithm for fetching
31 */
32 void run();
33
34 /**
35 * fetches object from cache, or returns null when object is not found
36 *
37 * @return filled tile with data or null when no cache entry found
38 */
39 CacheEntry get();
40
41 /**
42 * Submit job for background fetch, and listener will be fed with value object
43 *
44 * @param listener cache loader listener
45 * @param force true if the load should skip all the caches (local &amp; remote)
46 * @throws IOException on failure from getUrl() call
47 */
48 void submit(ICachedLoaderListener listener, boolean force) throws IOException;
49}
Note: See TracBrowser for help on using the repository browser.