public class DownloadPrimitivesTask extends PleaseWaitRunnable
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled |
private DataSet |
ds |
private boolean |
fullRelation |
private java.util.List<PrimitiveId> |
ids |
private java.lang.Exception |
lastException |
private OsmDataLayer |
layer |
private java.util.Set<PrimitiveId> |
missingPrimitives |
private MultiFetchServerObjectReader |
multiObjectReader |
private OsmServerObjectReader |
objectReader |
progressMonitor| Constructor and Description |
|---|
DownloadPrimitivesTask(OsmDataLayer layer,
java.util.List<PrimitiveId> ids,
boolean fullRelation)
Constructs a new
DownloadPrimitivesTask. |
DownloadPrimitivesTask(OsmDataLayer layer,
java.util.List<PrimitiveId> ids,
boolean fullRelation,
ProgressMonitor progressMonitor)
Constructs a new
DownloadPrimitivesTask. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
java.util.Set<PrimitiveId> |
getMissingPrimitives()
replies the set of ids of all primitives for which a fetch request to the
server was submitted but which are not available from the server (the server
replied a return code of 404)
|
protected void |
initMultiFetchReader(MultiFetchServerObjectReader reader) |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate boolean canceled
private java.lang.Exception lastException
private final java.util.List<PrimitiveId> ids
private java.util.Set<PrimitiveId> missingPrimitives
private final OsmDataLayer layer
private final boolean fullRelation
private MultiFetchServerObjectReader multiObjectReader
private OsmServerObjectReader objectReader
public DownloadPrimitivesTask(OsmDataLayer layer, java.util.List<PrimitiveId> ids, boolean fullRelation)
DownloadPrimitivesTask.layer - the layer in which primitives are updated. Must not be null.ids - a collection of primitives to update from the server. Set to
the empty collection if null.fullRelation - true if a full download is required, i.e.,
a download including the immediate children of a relation.java.lang.IllegalArgumentException - if layer is null.public DownloadPrimitivesTask(OsmDataLayer layer, java.util.List<PrimitiveId> ids, boolean fullRelation, ProgressMonitor progressMonitor)
DownloadPrimitivesTask.layer - the layer in which primitives are updated. Must not be null.ids - a collection of primitives to update from the server. Set to
the empty collection if null.fullRelation - true if a full download is required, i.e.,
a download including the immediate children of a relation.progressMonitor - ProgressMonitor to use or null to create a new one.java.lang.IllegalArgumentException - if layer is null.protected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void initMultiFetchReader(MultiFetchServerObjectReader reader)
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableorg.xml.sax.SAXException - if a SAX error occursjava.io.IOException - if an I/O error occursOsmTransferException - if a communication error with the OSM server occurspublic java.util.Set<PrimitiveId> getMissingPrimitives()