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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  DownloadProgress.Status  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DownloadArtifact getArtifact​(java.lang.String artifactId)
      Retrieves the artifacts with the passed id.
      java.util.Collection<DownloadArtifact> getArtifacts()
      Retrieves all the artifacts that were the final output of the download process.
      java.util.Calendar getExpiry()
      Return the date at which the download will expire.
      int getFailureCount()
      Of the total number of items in the download, the number of items that failed to process correctly.
      java.util.Calendar getFinished()
      Return the date that the archive process started.
      int getProcessedCount()
      Retrieves the total number of items that have been processed, and have either succeeded or failed.
      int getProgress()
      Retrieves the current percentage complete value of the download process.
      java.lang.String getRequestingUser()
      Answer the user who requested the download.
      java.util.Calendar getStarted()
      Return the date that the archive process started.
      DownloadProgress.Status getStatus()
      Retrieves the current status of the processing job.
      int getSuccessCount()
      Of the total number of items in the download, the number of items that processed correctly.
      int getTotalCount()
      Retrieves the total number of items that are included in the download.
      long getTotalSize()
      Retrieves the total size, in bytes, of all items included in the download.
      boolean isComplete()
      Indicates whether or not the entire download creation process has finished.
    • Method Detail

      • getRequestingUser

        java.lang.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

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

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

        java.util.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

        java.util.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.
      • getArtifact

        DownloadArtifact getArtifact​(java.lang.String artifactId)
        Retrieves the artifacts with the passed id. Artifact information will include the URI where an artifact can be retrieved, or a description of why the artifact failed.
        Returns:
        The artifact represented by the passed id or null if no artifact with this name exists.