public class ChangesetContentDownloadTask extends PleaseWaitRunnable implements ChangesetDownloadTask
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled
true if the task was canceled
|
private java.util.Set<Changeset> |
downloadedChangesets
the set of downloaded changesets
|
private java.lang.Exception |
lastException
keeps the last exception thrown in the task, if any
|
private OsmServerChangesetReader |
reader
the reader object used to read changesets from the API
|
private java.util.List<java.lang.Integer> |
toDownload
the list of changeset ids to download
|
progressMonitor| Constructor and Description |
|---|
ChangesetContentDownloadTask(java.util.Collection<java.lang.Integer> changesetIds)
Creates a download task for a collection of changesets.
|
ChangesetContentDownloadTask(java.awt.Component parent,
java.util.Collection<java.lang.Integer> changesetIds)
Creates a download task for a collection of changesets.
|
ChangesetContentDownloadTask(java.awt.Component parent,
int changesetId)
Creates a download task for a single changeset
|
ChangesetContentDownloadTask(int changesetId)
Creates a download task for a single changeset
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancel()
User pressed cancel button.
|
protected void |
downloadChangeset(int changesetId)
Downloads the changeset with id
changesetId (only "header"
information, no content) |
protected void |
finish()
Finish up the data work.
|
java.util.Set<Changeset> |
getDownloadedChangesets() |
protected void |
init(java.util.Collection<java.lang.Integer> ids)
Initialize the task with a collection of changeset ids to download
|
protected boolean |
isAvailableLocally(int changesetId)
Replies true if the local
ChangesetCache already includes the changeset with
id changesetId. |
boolean |
isCanceled() |
boolean |
isFailed() |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate final java.util.List<java.lang.Integer> toDownload
private boolean canceled
private java.lang.Exception lastException
private OsmServerChangesetReader reader
private java.util.Set<Changeset> downloadedChangesets
public ChangesetContentDownloadTask(int changesetId) throws java.lang.IllegalArgumentException
changesetId - the changeset id. > 0 required.java.lang.IllegalArgumentException - thrown if changesetId <= 0public ChangesetContentDownloadTask(java.util.Collection<java.lang.Integer> changesetIds)
changesetIds - the changeset ids. Empty collection assumed, if null.public ChangesetContentDownloadTask(java.awt.Component parent, int changesetId) throws java.lang.IllegalArgumentException
parent - the parent component for the PleaseWaitDialog. Must not be null.changesetId - the changeset id. >0 required.java.lang.IllegalArgumentException - thrown if changesetId <= 0java.lang.IllegalArgumentException - thrown if parent is nullpublic ChangesetContentDownloadTask(java.awt.Component parent, java.util.Collection<java.lang.Integer> changesetIds) throws java.lang.IllegalArgumentException
parent - the parent component for the PleaseWaitDialog. Must not be null.changesetIds - the changeset ids. Empty collection assumed, if null.java.lang.IllegalArgumentException - thrown if parent is nullprotected void init(java.util.Collection<java.lang.Integer> ids)
ids - the collection of ids. May be null.protected boolean isAvailableLocally(int changesetId)
ChangesetCache already includes the changeset with
id changesetId.changesetId - the changeset idChangesetCache already includes the changeset with
id changesetIdprotected void downloadChangeset(int changesetId) throws OsmTransferException
changesetId (only "header"
information, no content)changesetId - the changeset idOsmTransferException - thrown if something went wrongprotected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableorg.xml.sax.SAXExceptionjava.io.IOExceptionOsmTransferExceptionpublic java.util.Set<Changeset> getDownloadedChangesets()
getDownloadedChangesets in interface ChangesetDownloadTaskpublic boolean isCanceled()
isCanceled in interface ChangesetDownloadTaskpublic boolean isFailed()
isFailed in interface ChangesetDownloadTask