Interface UploadCallback

All Known Implementing Classes:
ListenerService

public interface UploadCallback
Callback for progress and results of an upload operation.
  • Method Summary

    Modifier and Type Method Description
    void onError​(java.lang.String requestId, ErrorInfo error)
    Called when a request encounters an error.
    void onProgress​(java.lang.String requestId, long bytes, long totalBytes)
    Called on upload progress updates.
    void onReschedule​(java.lang.String requestId, ErrorInfo error)
    Called when a request fails with a recoverable error and is rescheduled to a later time.
    void onStart​(java.lang.String requestId)
    Called when a request starts uploading.
    void onSuccess​(java.lang.String requestId, java.util.Map resultData)
    Called when a requests completes successfully.
  • Method Details

    • onStart

      void onStart​(java.lang.String requestId)
      Called when a request starts uploading.
      Parameters:
      requestId - Id of the request sending this callback.
    • onProgress

      void onProgress​(java.lang.String requestId, long bytes, long totalBytes)
      Called on upload progress updates.
      Parameters:
      requestId - Id of the request sending this callback.
      bytes - Total bytes uploaded so far.
      totalBytes - Total bytes to upload (if known).
    • onSuccess

      void onSuccess​(java.lang.String requestId, java.util.Map resultData)
      Called when a requests completes successfully.
      Parameters:
      requestId - Id of the request sending this callback.
      resultData - Result data about the newly uploaded resource.
    • onError

      void onError​(java.lang.String requestId, ErrorInfo error)
      Called when a request encounters an error.
      Parameters:
      requestId - Id of the request sending this callback.
      error - Error object containing description and code.
    • onReschedule

      void onReschedule​(java.lang.String requestId, ErrorInfo error)
      Called when a request fails with a recoverable error and is rescheduled to a later time. This is useful to update UI (e.g hide progress notifications), otherwise this callback can be ignored.
      Parameters:
      requestId - Id of the request sending this callback.
      error - Error object containing technical description and code.