Interface RequestDispatcher


public interface RequestDispatcher
Entry point to dispatch new upload requests.
  • Method Summary

    Modifier and Type Method Description
    int cancelAllRequests()
    Cancels all upload requests.
    boolean cancelRequest​(java.lang.String requestId)
    Cancel an upload request.
    java.lang.String dispatch​(UploadRequest request)
    Dispatch a new upload request.
    void queueRoomFreed()
    Called every time a request finishes, meaning there's room for new requests.
    java.lang.String startNow​(android.content.Context context, UploadRequest request)
    Run an upload request immediately ignoring all constraints.
  • Method Details

    • dispatch

      java.lang.String dispatch​(UploadRequest request)
      Dispatch a new upload request. Will get queued and handled based on network policy, phone policy and time constraints. For immediate requests or preprocessing, a context needs to be provided.
    • startNow

      java.lang.String startNow​(android.content.Context context, UploadRequest request)
      Run an upload request immediately ignoring all constraints. Note: Requests that run through here are never rescheduled.
      Parameters:
      request - The request to run
      context - Android context, required for immediate requests.
      Returns:
      The request id.
    • cancelRequest

      boolean cancelRequest​(java.lang.String requestId)
      Cancel an upload request.
      Parameters:
      requestId - Id of the request to cancel.
      Returns:
      True if the request was found and cancelled successfully.
    • queueRoomFreed

      void queueRoomFreed()
      Called every time a request finishes, meaning there's room for new requests.
    • cancelAllRequests

      int cancelAllRequests()
      Cancels all upload requests.
      Returns:
      The count of canceled requests and running jobs.