Interface DownloadProgress


  • @ProviderType
    public interface DownloadProgress

    The information that will be provided to consumers when they request the status of a download being generated by the DownloadService.

    The download status is the primary means of delivering information about the service's output to the consumer. This includes:

    • The current progress of the operation that generates download artifacts.
    • URIs to the download artifacts once they're available.
    • Error information for any targets that may have failed to process correctly.

    See DownloadService.getProgress(String, org.apache.sling.api.resource.ResourceResolver) for how to retrieve the status of a download.

    See Also:
    DownloadService
    • Method Detail

      • getRequestingUser

        String getRequestingUser()
        Answer the user who requested the download.
        Returns:
        ID of the user that requested the download.
      • getStatus

        DownloadProgress.Status getStatus()
        Retrieves the current status of the processing job.
        Returns:
        Arbitrary status text.
      • getTotalCount

        int getTotalCount()
        Retrieves the total number of items that are included in the download.
        Returns:
        Number of download items.
      • getTotalSize

        long getTotalSize()
        Retrieves the total size, in bytes, of all items included in the download.
        Returns:
        Size in bytes.
      • getProcessedCount

        int getProcessedCount()
        Retrieves the total number of items that have been processed, and have either succeeded or failed.
        Returns:
        Number of processed download items.
      • getProgress

        int getProgress()
        Retrieves the current percentage complete value of the download process.
        Returns:
        A percent value between 0 and 100.
      • getFailureCount

        int getFailureCount()
        Of the total number of items in the download, the number of items that failed to process correctly.
        Returns:
        Number of failed download items.
      • getSuccessCount

        int getSuccessCount()
        Of the total number of items in the download, the number of items that processed correctly.
        Returns:
        Number of successful download items.
      • isComplete

        boolean isComplete()
        Indicates whether or not the entire download creation process has finished.
        Returns:
        true if the process is done, false otherwise.
      • getStarted

        Calendar getStarted()
        Return the date that the archive process started.
        Returns:
        The date that processing started.
      • getFinished

        Calendar getFinished()
        Return the date that the archive process started.
        Returns:
        The date that processing finished.
      • getExpiry

        Calendar getExpiry()
        Return the date at which the download will expire. Note that it is possible that a download will be unavailable before the expiry date. This is the latest date that a download could possibly be available
        Returns:
        The expiry date for a download
      • getArtifacts

        Collection<DownloadArtifact> getArtifacts()
        Retrieves all the artifacts that were the final output of the download process. Artifact information will include the URI where an artifact can be retrieved, or a description of why the artifact failed.
        Returns:
        The artifacts that are the output of the download.