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, run
private 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) throws java.lang.IllegalArgumentException
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
- thrown if layer is null.public DownloadPrimitivesTask(OsmDataLayer layer, java.util.List<PrimitiveId> ids, boolean fullRelation, ProgressMonitor progressMonitor) throws java.lang.IllegalArgumentException
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
- thrown if layer is null.protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void initMultiFetchReader(MultiFetchServerObjectReader reader)
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
OsmTransferException
public java.util.Set<PrimitiveId> getMissingPrimitives()