Package 

Class DownloadRequestQueue


  • 
    public final class DownloadRequestQueue
    
                        

    Create the download dispatchers according to pool size. Any number higher than 10 or less than 1, then the size will be default size.

    • Constructor Detail

      • DownloadRequestQueue

        DownloadRequestQueue(Integer threadPoolSize, Logger logger)
    • Method Detail

      • start

         final Unit start()

        Starts the dispatchers in this queue.

      • add

         final Boolean add(DownloadRequest request)

        Add download request to the download request queue.

        Parameters:
        request - download request
      • cancel

         final Boolean cancel(Integer downloadId)

        Cancel a download in progress.

        Parameters:
        downloadId - download id
      • query

         final DownloadState query(Integer downloadId)

        To check if the request is downloading according to download id.

        Parameters:
        downloadId - download id
      • query

         final DownloadState query(Uri uri)

        To check if the request is downloading according to download url.

        Parameters:
        uri - the uri to check
      • finish

         final Unit finish(DownloadRequest request)

        The download has finished and remove from set.

        Parameters:
        request - download request
      • release

         final Unit release()

        Release all the resource.