org.apache.geronimo.system.plugin
Class DownloadResults

java.lang.Object
  extended by org.apache.geronimo.system.plugin.DownloadResults
All Implemented Interfaces:
Serializable, DownloadPoller

public class DownloadResults
extends Object
implements Serializable, DownloadPoller

Provides the results of a configuration download operation. This is updated along the way for callers who want to monitor the ongoing progress.

See Also:
Serialized Form

Constructor Summary
DownloadResults()
           
 
Method Summary
 void addDependencyInstalled(Artifact dep)
          Notes that the current install operation found a dependency, and that dependency was downloaded from a remote repository and installed into the local server environment.
 void addDependencyPresent(Artifact dep)
          Notes that the current install operation found a dependency, and that dependency was satisfied by an artifact already available in the current server environment.
 void addDownloadBytes(long bytes)
          Called at the end of a file download with the number of bytes downloaded in the current operation.
 void addInstalledConfigID(Artifact dep)
          Notes that a configuration passed as an argument to the install operation was successfully installed.
 void addRemovedConfigID(Artifact obsolete)
          Notes a configuration that was removed because it was obsoleted by a newly-installed configuration.
 void addRestartedConfigID(Artifact target)
          Notes that a configuration was restarted as a result of the current operation.
 DownloadResults duplicate()
           
 String getCurrentFile()
          Gets the name of the file that is currently being operated on.
 int getCurrentFilePercent()
          Gets the progress on the current file expressed as a percentage.
 String getCurrentMessage()
          Gets a description of the work currently being done.
 Artifact[] getDependenciesInstalled()
          Gets the dependencies that we've successfully downloaded and installed into the local server environment.
 Artifact[] getDependenciesPresent()
          Gets the dependencies that we've needed but they're already present in the local server so no installation was necessary.
 Exception getFailure()
          If the operation failed, the Exception that caused the failure.
 Artifact[] getInstalledConfigIDs()
          Gets the list of the originally requested Config IDs that were successfully installed.
 Artifact[] getRemovedConfigIDs()
           
 Artifact[] getRestartedConfigIDs()
           
 long getTotalDownloadBytes()
          The total number of bytes in the archives downloaded from remote repositories.
 boolean isFailed()
           
 boolean isFinished()
           
 void setCurrentFile(String currentFile)
          Indicates which file the configuration installer is working on at the moment.
 void setCurrentFilePercent(int currentFileProgress)
          Gives the percent complete for a file currently being downloaded.
 void setCurrentMessage(String currentMessage)
          Describes the current operation status as a text message.
 void setFailure(Exception failure)
          Indicates that a failure was encountered during the installation operation.
 void setFinished()
          Always called when the operation is complete, regardless of whether there was a failure or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadResults

public DownloadResults()
Method Detail

duplicate

public DownloadResults duplicate()

addInstalledConfigID

public void addInstalledConfigID(Artifact dep)
Description copied from interface: DownloadPoller
Notes that a configuration passed as an argument to the install operation was successfully installed. This will only be called on the original arguments to the install command, not on anything installed because it was a dependency.

Specified by:
addInstalledConfigID in interface DownloadPoller

addRemovedConfigID

public void addRemovedConfigID(Artifact obsolete)
Description copied from interface: DownloadPoller
Notes a configuration that was removed because it was obsoleted by a newly-installed configuration.

Specified by:
addRemovedConfigID in interface DownloadPoller

addRestartedConfigID

public void addRestartedConfigID(Artifact target)
Description copied from interface: DownloadPoller
Notes that a configuration was restarted as a result of the current operation. This usually means that it depended on a configuration that was obsoleted (removed), so it shut down when the remove happened, and was started up again after the replacement was installed.

Specified by:
addRestartedConfigID in interface DownloadPoller

addDependencyPresent

public void addDependencyPresent(Artifact dep)
Description copied from interface: DownloadPoller
Notes that the current install operation found a dependency, and that dependency was satisfied by an artifact already available in the current server environment.

Specified by:
addDependencyPresent in interface DownloadPoller

addDependencyInstalled

public void addDependencyInstalled(Artifact dep)
Description copied from interface: DownloadPoller
Notes that the current install operation found a dependency, and that dependency was downloaded from a remote repository and installed into the local server environment.

Specified by:
addDependencyInstalled in interface DownloadPoller

setCurrentFile

public void setCurrentFile(String currentFile)
Description copied from interface: DownloadPoller
Indicates which file the configuration installer is working on at the moment. Mainly for purposes of user feedback during asynchronous requests.

Specified by:
setCurrentFile in interface DownloadPoller

setCurrentMessage

public void setCurrentMessage(String currentMessage)
Description copied from interface: DownloadPoller
Describes the current operation status as a text message. Mainly for purposes of user feedback during asynchronous requests.

Specified by:
setCurrentMessage in interface DownloadPoller

setCurrentFilePercent

public void setCurrentFilePercent(int currentFileProgress)
Description copied from interface: DownloadPoller
Gives the percent complete for a file currently being downloaded. Mainly for purposes of user feedback during asynchronous requests. This may be -1 if the download server does not supply the file size in advance.

Specified by:
setCurrentFilePercent in interface DownloadPoller

setFailure

public void setFailure(Exception failure)
Description copied from interface: DownloadPoller
Indicates that a failure was encountered during the installation operation. Any failure is currently treated as fatal -- the installer will not attempt to complete additional tasks after a failure.

Specified by:
setFailure in interface DownloadPoller

setFinished

public void setFinished()
Description copied from interface: DownloadPoller
Always called when the operation is complete, regardless of whether there was a failure or not.

Specified by:
setFinished in interface DownloadPoller

addDownloadBytes

public void addDownloadBytes(long bytes)
Description copied from interface: DownloadPoller
Called at the end of a file download with the number of bytes downloaded in the current operation. This can be used to calculate a rough transfer rate (the time between setCurrentFile and setDownloadBytes) as well as if the caller wants to total the size of all downloads for the current installation.

Specified by:
addDownloadBytes in interface DownloadPoller

isFinished

public boolean isFinished()

isFailed

public boolean isFailed()

getTotalDownloadBytes

public long getTotalDownloadBytes()
The total number of bytes in the archives downloaded from remote repositories.


getFailure

public Exception getFailure()
If the operation failed, the Exception that caused the failure.


getInstalledConfigIDs

public Artifact[] getInstalledConfigIDs()
Gets the list of the originally requested Config IDs that were successfully installed. Ordinarily this is not necessary, but it may be important in case of failure midway through, or if the request passed previously downloaded configurations on the command line and the caller doesn't know what the Config IDs are.


getRemovedConfigIDs

public Artifact[] getRemovedConfigIDs()

getRestartedConfigIDs

public Artifact[] getRestartedConfigIDs()

getDependenciesPresent

public Artifact[] getDependenciesPresent()
Gets the dependencies that we've needed but they're already present in the local server so no installation was necessary.


getDependenciesInstalled

public Artifact[] getDependenciesInstalled()
Gets the dependencies that we've successfully downloaded and installed into the local server environment.


getCurrentFile

public String getCurrentFile()
Gets the name of the file that is currently being operated on.


getCurrentMessage

public String getCurrentMessage()
Gets a description of the work currently being done.


getCurrentFilePercent

public int getCurrentFilePercent()
Gets the progress on the current file expressed as a percentage. This value may be -1 in which case the progress cannot be calculated (e.g. a download where the server doesn't supply the file size up front).



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.