public abstract class AbstractUploadTask extends PleaseWaitRunnable
progressMonitor
Constructor and Description |
---|
AbstractUploadTask(java.lang.String title)
Constructs a new
AbstractUploadTask . |
AbstractUploadTask(java.lang.String title,
boolean ignoreException)
Constructs a new
AbstractUploadTask . |
AbstractUploadTask(java.lang.String title,
ProgressMonitor progressMonitor,
boolean ignoreException)
Constructs a new
AbstractUploadTask . |
Modifier and Type | Method and Description |
---|---|
protected void |
handleFailedUpload(java.lang.Exception e)
error handler for any exception thrown during upload
|
protected void |
handleGone(OsmApiPrimitiveGoneException e)
Handles an error which is caused by a delete request for an already deleted
OsmPrimitive on the server, i.e. |
protected void |
handlePreconditionFailed(OsmApiException e)
handles an precondition failed conflict, i.e.
|
protected void |
handleUploadConflict(OsmApiException e)
handles an upload conflict, i.e.
|
protected void |
handleUploadConflictForClosedChangeset(long changesetId,
java.util.Date d)
Handles the case that a conflict was detected while uploading where we don't
know what
OsmPrimitive actually caused the conflict (for whatever reason) |
protected void |
handleUploadConflictForKnownConflict(OsmPrimitiveType primitiveType,
long id,
java.lang.String serverVersion,
java.lang.String myVersion)
Handles the case that a conflict in a specific
OsmPrimitive was detected while
uploading |
protected void |
handleUploadConflictForUnknownConflict()
Handles the case that a conflict was detected while uploading where we don't
know what
OsmPrimitive actually caused the conflict (for whatever reason) |
protected void |
handleUploadPreconditionFailedConflict(OsmApiException e,
Pair<OsmPrimitive,java.util.Collection<OsmPrimitive>> conflict)
Handles the case where deleting a node failed because it is still in use in
a non-deleted way on the server.
|
protected void |
synchronizeDataSet()
Synchronizes the local state of the dataset with the state on the server.
|
protected void |
synchronizePrimitive(OsmPrimitiveType type,
long id)
Synchronizes the local state of an
OsmPrimitive with its state on the
server. |
afterFinish, cancel, canRunInBackground, finish, getProgressMonitor, operationCanceled, realRun, run
public AbstractUploadTask(java.lang.String title, boolean ignoreException)
AbstractUploadTask
.title
- message for the userignoreException
- If true, exception will be silently ignored. If false then
exception will be handled by showing a dialog. When this runnable is executed using executor framework
then use false unless you read result of task (because exception will get lost if you don't)public AbstractUploadTask(java.lang.String title, ProgressMonitor progressMonitor, boolean ignoreException)
AbstractUploadTask
.title
- message for the userprogressMonitor
- progress monitorignoreException
- If true, exception will be silently ignored. If false then
exception will be handled by showing a dialog. When this runnable is executed using executor framework
then use false unless you read result of task (because exception will get lost if you don't)public AbstractUploadTask(java.lang.String title)
AbstractUploadTask
.title
- message for the userprotected void synchronizePrimitive(OsmPrimitiveType type, long id)
OsmPrimitive
with its state on the
server. The method uses an individual GET for the primitive.type
- the primitive typeid
- the primitive IDprotected void synchronizeDataSet()
UpdateDataAction
.protected void handleUploadConflictForKnownConflict(OsmPrimitiveType primitiveType, long id, java.lang.String serverVersion, java.lang.String myVersion)
OsmPrimitive
was detected while
uploadingprimitiveType
- the type of the primitive, either node
, way
or
relation
id
- the id of the primitiveserverVersion
- the version of the primitive on the servermyVersion
- the version of the primitive in the local datasetprotected void handleUploadConflictForUnknownConflict()
OsmPrimitive
actually caused the conflict (for whatever reason)protected void handleUploadConflictForClosedChangeset(long changesetId, java.util.Date d)
OsmPrimitive
actually caused the conflict (for whatever reason)changesetId
- changeset IDd
- changeset dateprotected void handleUploadPreconditionFailedConflict(OsmApiException e, Pair<OsmPrimitive,java.util.Collection<OsmPrimitive>> conflict)
e
- exceptionconflict
- conflictprotected void handleUploadConflict(OsmApiException e)
e
- the exceptionprotected void handlePreconditionFailed(OsmApiException e)
e
- the exceptionprotected void handleGone(OsmApiPrimitiveGoneException e)
OsmPrimitive
on the server, i.e. a HTTP response code of 410.
Note that an update on an already deleted object results
in a 409, not a 410.e
- the exceptionprotected void handleFailedUpload(java.lang.Exception e)
e
- the exception