Package hudson.model
Class UpdateCenter.InstallationJob
- java.lang.Object
-
- hudson.model.UpdateCenter.UpdateCenterJob
-
- hudson.model.UpdateCenter.DownloadJob
-
- hudson.model.UpdateCenter.InstallationJob
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
UpdateCenter.EnableJob
- Enclosing class:
- UpdateCenter
public class UpdateCenter.InstallationJob extends UpdateCenter.DownloadJob
Represents the state of the installation activity of one plugin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.UpdateCenter.DownloadJob
UpdateCenter.DownloadJob.Failure, UpdateCenter.DownloadJob.InstallationStatus, UpdateCenter.DownloadJob.Installing, UpdateCenter.DownloadJob.Pending, UpdateCenter.DownloadJob.Skipped, UpdateCenter.DownloadJob.Success, UpdateCenter.DownloadJob.SuccessButRequiresRestart
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandynamicLoadTrue to load the plugin into this Jenkins, false to wait until restart.UpdateSite.PluginpluginWhat plugin are we trying to install?protected PluginManagerpm-
Fields inherited from class hudson.model.UpdateCenter.DownloadJob
status
-
Fields inherited from class hudson.model.UpdateCenter.UpdateCenterJob
error, id, site
-
-
Constructor Summary
Constructors Constructor Description InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, Authentication auth, boolean dynamicLoad)InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, org.springframework.security.core.Authentication auth)Deprecated.as of 1.442InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, org.springframework.security.core.Authentication auth, boolean dynamicLoad)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void_run()longgetContentLength()Indicate the expected size of the download as provided in update site metadata.protected FilegetDestination()Where to download the file to.StringgetDisplayName()Display name used for the GUI.StringgetName()Code name used for logging.protected URLgetURL()Where to download the file from.protected voidonSuccess()Called when the whole thing went successfully.protected voidreplace(File dst, File src)Called when the download is completed to overwrite the old file with the new file.StringtoString()protected booleanwasInstalled()Indicates there is another installation job for this plugin-
Methods inherited from class hudson.model.UpdateCenter.DownloadJob
getComputedSHA1, getComputedSHA256, getComputedSHA512, getUser, run
-
Methods inherited from class hudson.model.UpdateCenter.UpdateCenterJob
getApi, getCorrelationId, getError, getErrorMessage, getType, schedule, setCorrelationId, submit
-
-
-
-
Field Detail
-
plugin
@Exported public final UpdateSite.Plugin plugin
What plugin are we trying to install?
-
pm
protected final PluginManager pm
-
dynamicLoad
protected final boolean dynamicLoad
True to load the plugin into this Jenkins, false to wait until restart.
-
-
Constructor Detail
-
InstallationJob
@Deprecated public InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, org.springframework.security.core.Authentication auth)
Deprecated.as of 1.442
-
InstallationJob
@Deprecated public InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, Authentication auth, boolean dynamicLoad)
-
InstallationJob
public InstallationJob(UpdateSite.Plugin plugin, UpdateSite site, org.springframework.security.core.Authentication auth, boolean dynamicLoad)
-
-
Method Detail
-
getURL
protected URL getURL() throws MalformedURLException
Description copied from class:UpdateCenter.DownloadJobWhere to download the file from.- Specified by:
getURLin classUpdateCenter.DownloadJob- Throws:
MalformedURLException
-
getDestination
protected File getDestination()
Description copied from class:UpdateCenter.DownloadJobWhere to download the file to.- Specified by:
getDestinationin classUpdateCenter.DownloadJob
-
getName
public String getName()
Description copied from class:UpdateCenter.DownloadJobCode name used for logging.- Specified by:
getNamein classUpdateCenter.DownloadJob
-
getDisplayName
public String getDisplayName()
Description copied from class:UpdateCenter.DownloadJobDisplay name used for the GUI.- Overrides:
getDisplayNamein classUpdateCenter.DownloadJob
-
getContentLength
public long getContentLength()
Description copied from class:UpdateCenter.DownloadJobIndicate the expected size of the download as provided in update site metadata.- Overrides:
getContentLengthin classUpdateCenter.DownloadJob- Returns:
- the expected size, or -1 if unknown.
-
_run
public void _run() throws IOException, UpdateCenter.DownloadJob.InstallationStatus- Overrides:
_runin classUpdateCenter.DownloadJob- Throws:
IOExceptionUpdateCenter.DownloadJob.InstallationStatus
-
wasInstalled
protected boolean wasInstalled()
Indicates there is another installation job for this plugin- Since:
- 2.1
-
onSuccess
protected void onSuccess()
Description copied from class:UpdateCenter.DownloadJobCalled when the whole thing went successfully.- Specified by:
onSuccessin classUpdateCenter.DownloadJob
-
replace
protected void replace(File dst, File src) throws IOException
Called when the download is completed to overwrite the old file with the new file.- Overrides:
replacein classUpdateCenter.DownloadJob- Throws:
IOException
-
-