public class UploadPrimitivesTask extends AbstractUploadTask
Modifier and Type | Field and Description |
---|---|
private Changeset |
changeset |
private Exception |
lastException |
private OsmDataLayer |
layer |
private Set<IPrimitive> |
processedPrimitives |
private UploadStrategySpecification |
strategy |
private APIDataSet |
toUpload |
private boolean |
uploadCanceled |
private OsmServerWriter |
writer |
progressMonitor
Constructor and Description |
---|
UploadPrimitivesTask(UploadStrategySpecification strategy,
OsmDataLayer layer,
APIDataSet toUpload,
Changeset changeset)
Creates the task
|
Modifier and Type | Method and Description |
---|---|
protected MaxChangesetSizeExceededPolicy |
askMaxChangesetSizeExceedsPolicy() |
protected void |
cancel()
User pressed cancel button.
|
protected void |
cleanupAfterUpload() |
protected void |
finish()
Finish up the data work.
|
protected void |
openNewChangeset() |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
protected boolean |
recoverFromChangesetFullException() |
protected void |
recoverFromGoneOnServer(OsmApiPrimitiveGoneException e,
ProgressMonitor monitor)
Retries to recover the upload operation from an exception which was thrown because
an uploaded primitive was already deleted on the server.
|
handleFailedUpload, handleGone, handlePreconditionFailed, handleUploadConflict, handleUploadConflictForClosedChangeset, handleUploadConflictForKnownConflict, handleUploadConflictForUnknownConflict, handleUploadPreconditionFailedConflict, synchronizeDataSet, synchronizePrimitive
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
private boolean uploadCanceled
private Exception lastException
private final APIDataSet toUpload
private OsmServerWriter writer
private final OsmDataLayer layer
private final Set<IPrimitive> processedPrimitives
private final UploadStrategySpecification strategy
public UploadPrimitivesTask(UploadStrategySpecification strategy, OsmDataLayer layer, APIDataSet toUpload, Changeset changeset)
strategy
- the upload strategy. Must not be null.layer
- the OSM data layer for which data is uploaded. Must not be null.toUpload
- the collection of primitives to upload. Set to the empty collection if null.changeset
- the changeset to use for uploading. Must not be null. changeset.getId()
can be 0 in which case the upload task creates a new changesetIllegalArgumentException
- if layer is nullIllegalArgumentException
- if toUpload is nullIllegalArgumentException
- if strategy is nullIllegalArgumentException
- if changeset is nullprotected MaxChangesetSizeExceededPolicy askMaxChangesetSizeExceedsPolicy()
protected void openNewChangeset()
protected boolean recoverFromChangesetFullException()
protected void recoverFromGoneOnServer(OsmApiPrimitiveGoneException e, ProgressMonitor monitor) throws OsmTransferException
e
- the exception throw by the APImonitor
- a progress monitorOsmTransferException
- if we can't recover from the exceptionprotected void cleanupAfterUpload()
protected void realRun()
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable