public class DownloadPrimitivesTask extends PleaseWaitRunnable
Modifier and Type | Field and Description |
---|---|
private boolean |
canceled |
private DataSet |
ds |
private boolean |
fullRelation |
private List<PrimitiveId> |
ids |
private Exception |
lastException |
private OsmDataLayer |
layer |
private Set<PrimitiveId> |
missingPrimitives |
private MultiFetchServerObjectReader |
multiObjectReader |
private OsmServerObjectReader |
objectReader |
progressMonitor
Constructor and Description |
---|
DownloadPrimitivesTask(OsmDataLayer layer,
List<PrimitiveId> ids,
boolean fullRelation)
Creates the task
|
Modifier and Type | Method and Description |
---|---|
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
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 Exception lastException
private final List<PrimitiveId> ids
private Set<PrimitiveId> missingPrimitives
private final OsmDataLayer layer
private final boolean fullRelation
private MultiFetchServerObjectReader multiObjectReader
private OsmServerObjectReader objectReader
public DownloadPrimitivesTask(OsmDataLayer layer, List<PrimitiveId> ids, boolean fullRelation) throws IllegalArgumentException
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.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 SAXException, IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
SAXException
IOException
OsmTransferException
public Set<PrimitiveId> getMissingPrimitives()