org.openstreetmap.fma.jtiledownloader
Class TileListDownloader
java.lang.Object
org.openstreetmap.fma.jtiledownloader.TileListDownloader
public class TileListDownloader
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final java.util.logging.Logger log
_tilesToDownload
private java.util.LinkedList<Tile> _tilesToDownload
_downloadPath
private java.lang.String _downloadPath
_tileProvider
private TileProviderIf _tileProvider
downloaderThreads
private java.util.ArrayList<TileListDownloader.TileListDownloaderThread> downloaderThreads
_listener
private TileDownloaderListener _listener
paused
private boolean paused
_numberOfTilesToDownload
private int _numberOfTilesToDownload
_errorCount
private int _errorCount
_updatedTilesCount
private int _updatedTilesCount
_errorTileList
private java.util.LinkedList<TileDownloadError> _errorTileList
MAX_RETRIES
private static final int MAX_RETRIES
- See Also:
- Constant Field Values
TileListDownloader
public TileListDownloader(java.lang.String downloadPath,
TileList tilesToDownload,
TileProviderIf tileProvider)
- Parameters:
downloadPath
- tilesToDownload
- tileProvider
-
start
public void start()
abort
public void abort()
pause
public void pause()
increaseUpdatedCount
private void increaseUpdatedCount()
addedTileDownloadError
private void addedTileDownloadError(TileDownloadResult result,
Tile tileToDownload)
doDownload
private TileDownloadResult doDownload(Tile tileToDownload)
doSingleDownload
private TileDownloadResult doSingleDownload(java.lang.String fileName,
java.net.URL url)
- Parameters:
fileName
- url
-
- Returns:
- TileDownloadResult
setListener
public void setListener(TileDownloaderListener listener)
fireDownloadedTileEvent
private void fireDownloadedTileEvent(java.lang.String fileName,
boolean updatedTile)
- Parameters:
fileName
- updatedTile
-
fireErrorOccuredEvent
private void fireErrorOccuredEvent(Tile tile)
- Parameters:
tile
-
fireDownloadStoppedEvent
private void fireDownloadStoppedEvent()
fireDownloadPausedEvent
private void fireDownloadPausedEvent()
fireDownloadCompleteEvent
private void fireDownloadCompleteEvent()
runningThreads
private int runningThreads()
isLastThread
private boolean isLastThread()
- Returns:
- is the current thread is the last thread
fireWaitResume
private void fireWaitResume(java.lang.String message)
fireWaitHttp500ErrorToResume
private void fireWaitHttp500ErrorToResume(java.lang.String message)
setDownloadPath
public void setDownloadPath(java.lang.String downloadPath)
- Setter for downloadPath
- Parameters:
downloadPath
- the downloadPath to set
getDownloadPath
public java.lang.String getDownloadPath()
- Getter for downloadPath
- Returns:
- the downloadPath
setTilesToDownload
public void setTilesToDownload(java.util.ArrayList<Tile> tilesToDownload)
- Setter for tilesToDownload
- Parameters:
tilesToDownload
- the tilesToDownload to set
getTilesToDownload
private Tile getTilesToDownload()
- Get tile to download
- Returns:
- a tile
requeueTile
private void requeueTile(Tile tile)