Class AbstractUploadTask

    • Constructor Detail

      • AbstractUploadTask

        protected AbstractUploadTask​(String title,
                                     boolean ignoreException)
        Constructs a new AbstractUploadTask.
        Parameters:
        title - message for the user
        ignoreException - 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)
      • AbstractUploadTask

        protected AbstractUploadTask​(String title,
                                     ProgressMonitor progressMonitor,
                                     boolean ignoreException)
        Constructs a new AbstractUploadTask.
        Parameters:
        title - message for the user
        progressMonitor - progress monitor
        ignoreException - 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)
      • AbstractUploadTask

        protected AbstractUploadTask​(String title)
        Constructs a new AbstractUploadTask.
        Parameters:
        title - message for the user
    • Method Detail

      • synchronizePrimitive

        protected void synchronizePrimitive​(OsmPrimitiveType type,
                                            long id)
        Synchronizes the local state of an OsmPrimitive with its state on the server. The method uses an individual GET for the primitive.
        Parameters:
        type - the primitive type
        id - the primitive ID
      • handleUploadConflictForKnownConflict

        protected void handleUploadConflictForKnownConflict​(OsmPrimitiveType primitiveType,
                                                            long id,
                                                            String serverVersion,
                                                            String myVersion)
        Handles the case that a conflict in a specific OsmPrimitive was detected while uploading
        Parameters:
        primitiveType - the type of the primitive, either node, way or relation
        id - the id of the primitive
        serverVersion - the version of the primitive on the server
        myVersion - the version of the primitive in the local dataset
      • handleUploadConflictForClosedChangeset

        protected void handleUploadConflictForClosedChangeset​(long changesetId,
                                                              Instant 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)
        Parameters:
        changesetId - changeset ID
        d - changeset date
      • handleUploadConflict

        protected void handleUploadConflict​(OsmApiException e)
        handles an upload conflict, i.e. an error indicated by a HTTP return code 409.
        Parameters:
        e - the exception
      • handlePreconditionFailed

        protected void handlePreconditionFailed​(OsmApiException e)
        handles an precondition failed conflict, i.e. an error indicated by a HTTP return code 412.
        Parameters:
        e - the exception
      • handleGone

        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. a HTTP response code of 410. Note that an update on an already deleted object results in a 409, not a 410.
        Parameters:
        e - the exception
      • handleFailedUpload

        protected void handleFailedUpload​(Exception e)
        error handler for any exception thrown during upload
        Parameters:
        e - the exception