public class ChangesetContentDownloadTask extends PleaseWaitRunnable implements ChangesetDownloadTask
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled
true if the task was canceled
|
private Set<Changeset> |
downloadedChangesets
the set of downloaded changesets
|
private 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 List<Integer> |
toDownload
the list of changeset ids to download
|
progressMonitor| Constructor and Description |
|---|
ChangesetContentDownloadTask(Collection<Integer> changesetIds)
Creates a download task for a collection of changesets. null values and id <=0 in
the collection are sillently discarded.
|
ChangesetContentDownloadTask(Component parent,
Collection<Integer> changesetIds)
Creates a download task for a collection of changesets. null values and id <=0 in
the collection are sillently discarded.
|
ChangesetContentDownloadTask(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.
|
Set<Changeset> |
getDownloadedChangesets() |
protected void |
init(Collection<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 List<Integer> toDownload
private boolean canceled
private Exception lastException
private OsmServerChangesetReader reader
private Set<Changeset> downloadedChangesets
public ChangesetContentDownloadTask(int changesetId) throws IllegalArgumentException
changesetId - the changeset id. >0 required.IllegalArgumentException - thrown if changesetId <= 0public ChangesetContentDownloadTask(Collection<Integer> changesetIds)
changesetIds - the changeset ids. Empty collection assumed, if null.public ChangesetContentDownloadTask(Component parent, int changesetId) throws IllegalArgumentException
parent - the parent component for the PleaseWaitDialog. Must not be null.changesetId - the changeset id. >0 required.IllegalArgumentException - thrown if changesetId <= 0IllegalArgumentException - thrown if parent is nullpublic ChangesetContentDownloadTask(Component parent, Collection<Integer> changesetIds) throws IllegalArgumentException
parent - the parent component for the PleaseWaitDialog. Must not be null.changesetIds - the changeset ids. Empty collection assumed, if null.IllegalArgumentException - thrown if parent is nullprotected void init(Collection<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 SAXException, IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableSAXExceptionIOExceptionOsmTransferExceptionpublic Set<Changeset> getDownloadedChangesets()
getDownloadedChangesets in interface ChangesetDownloadTaskpublic boolean isCanceled()
isCanceled in interface ChangesetDownloadTaskpublic boolean isFailed()
isFailed in interface ChangesetDownloadTask