source: josm/trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoaderJob.java@ 9600

Last change on this file since 9600 was 8624, checked in by bastiK, 9 years ago

add missing svn:eol-style=native

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.imagery;
3
4import java.util.Map;
5import java.util.concurrent.ThreadPoolExecutor;
6
7import org.apache.commons.jcs.access.behavior.ICacheAccess;
8import org.openstreetmap.gui.jmapviewer.Tile;
9import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener;
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
12
13/**
14 * Separate class to handle WMS jobs, as it needs to react differently to HTTP response codes from WMS server
15 *
16 * @author Wiktor Niesiobędzki
17 * @since 8526
18 */
19public class WMSCachedTileLoaderJob extends TMSCachedTileLoaderJob {
20
21 /**
22 * Creates a job - that will download specific tile
23 * @param listener will be notified, when tile has loaded
24 * @param tile to load
25 * @param cache to use (get/put)
26 * @param connectTimeout to tile source
27 * @param readTimeout to tile source
28 * @param headers to be sent with request
29 * @param downloadExecutor that will execute the download task (if needed)
30 */
31 public WMSCachedTileLoaderJob(TileLoaderListener listener, Tile tile,
32 ICacheAccess<String, BufferedImageCacheEntry> cache, int connectTimeout, int readTimeout,
33 Map<String, String> headers, ThreadPoolExecutor downloadExecutor) {
34 super(listener, tile, cache, connectTimeout, readTimeout, headers, downloadExecutor);
35 }
36
37 @Override
38 public String getCacheKey() {
39 // include projection in cache key, as with different projections different response will be returned from server
40 String key = super.getCacheKey();
41 if (key != null) {
42 return key + Main.getProjection().toCode();
43 }
44 return null;
45 }
46}
Note: See TracBrowser for help on using the repository browser.