javax.jnlp
Interface DownloadServiceListener


public interface DownloadServiceListener

The DownloadServiceListener provides an interface for a callback object implementation, which may be used by a DownloadService implementation. The DownloadServiceListener implementation's methods should be invoked by the DownloadService implementation at various stages of the download, allowing an application that uses the JNLP API to display a progress bar during a DownloadService download.

Since:
1.0
See Also:
DownloadService

Method Summary
 void downloadFailed(java.net.URL url, java.lang.String version)
          A JNLP client's DownloadService implementation should call this method if a download fails or aborts unexpectedly.
 void progress(java.net.URL url, java.lang.String version, long readSoFar, long total, int overallPercent)
          A JNLP client's DownloadService implementation should call this method several times during a download.
 void upgradingArchive(java.net.URL url, java.lang.String version, int patchPercent, int overallPercent)
          A JNLP client's DownloadService implementation should call this method at least several times when applying an incremental update to an in-cache resource.
 void validating(java.net.URL url, java.lang.String version, long entry, long total, int overallPercent)
          A JNLP client's DownloadService implementation should call this method at least several times during validation of a download.
 

Method Detail

progress

void progress(java.net.URL url,
              java.lang.String version,
              long readSoFar,
              long total,
              int overallPercent)
A JNLP client's DownloadService implementation should call this method several times during a download. A DownloadServiceListener implementation may display a progress bar and / or update information based on the parameters.

Parameters:
url - The URL representing the resource being downloaded.
version - The version of the resource being downloaded.
readSoFar - The number of bytes downloaded so far.
total - The total number of bytes to be downloaded, or -1 if the number is unknown.
overallPercent - The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.

validating

void validating(java.net.URL url,
                java.lang.String version,
                long entry,
                long total,
                int overallPercent)
A JNLP client's DownloadService implementation should call this method at least several times during validation of a download. Validation often includes ensuring that downloaded resources are authentic (appropriately signed). A DownloadServiceListener implementation may display a progress bar and / or update information based on the parameters.

Parameters:
url - The URL representing the resource being validated.
version - The version of the resource being validated.
entry - The number of JAR entries validated so far.
total - The total number of entries to be validated.
overallPercent - The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.

upgradingArchive

void upgradingArchive(java.net.URL url,
                      java.lang.String version,
                      int patchPercent,
                      int overallPercent)
A JNLP client's DownloadService implementation should call this method at least several times when applying an incremental update to an in-cache resource. A DownloadServiceListener implementation may display a progress bar and / or update information based on the parameters.

Parameters:
url - The URL representing the resource being patched.
version - The version of the resource being patched.
patchPercent - The percentage of the patch operation that is complete, or -1 if the percentage is unknown.
overallPercent - The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.

downloadFailed

void downloadFailed(java.net.URL url,
                    java.lang.String version)
A JNLP client's DownloadService implementation should call this method if a download fails or aborts unexpectedly. In response, a DownloadServiceListener implementation may display update information to the user to reflect this.

Parameters:
url - The URL representing the resource for which the download failed.
version - The version of the resource for which the download failed.


Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved