Package hudson.model
Class UpdateCenter.UpdateCenterConfiguration
java.lang.Object
hudson.model.UpdateCenter.UpdateCenterConfiguration
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- UpdateCenter
Strategy object for controlling the update center's behaviors.
Until 1.333, this extension point used to control the configuration of
where to get updates (hence the name of this class), but with the introduction
of multiple update center sites capability, that functionality is achieved by
simply installing another UpdateSite
.
See UpdateSite
for how to manipulate them programmatically.
- Since:
- 1.266
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
ConstructorDescriptionCreates default update center configuration - uses settings for global update center. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkConnection
(UpdateCenter.ConnectionCheckJob job, String connectionCheckUrl) Check network connectivity by trying to establish a connection to the host in connectionCheckUrl.void
checkUpdateCenter
(UpdateCenter.ConnectionCheckJob job, String updateCenterUrl) Check connection to update center server.protected URLConnection
connect
(UpdateCenter.DownloadJob job, URL src) Connects to the given URL for downloading the binary.download
(UpdateCenter.DownloadJob job, URL src) Download a plugin or core upgrade in preparation for installing it into its final location.Deprecated.Deprecated.as of 1.333update-center.json
is now signed, so we don't have to further make sure that we aren't downloading from anywhere unsecure.Deprecated.as of 1.333 With the introduction of multiple update center capability, this information is now moved toUpdateSite
.void
install
(UpdateCenter.DownloadJob job, File src, File dst) Called after a plugin has been downloaded to move it into its final location.void
postValidate
(UpdateCenter.DownloadJob job, File src) Validate the resource after it has been downloaded, before it is installed.void
preValidate
(UpdateCenter.DownloadJob job, URL src) Validate the URL of the resource before downloading it.void
upgrade
(UpdateCenter.DownloadJob job, File src, File dst) Called after an upgrade has been downloaded to move it into its final location.
-
Constructor Details
-
UpdateCenterConfiguration
public UpdateCenterConfiguration()Creates default update center configuration - uses settings for global update center.
-
-
Method Details
-
checkConnection
public void checkConnection(UpdateCenter.ConnectionCheckJob job, String connectionCheckUrl) throws IOException Check network connectivity by trying to establish a connection to the host in connectionCheckUrl.- Parameters:
job
- The connection checker that is invoking this strategy.connectionCheckUrl
- A string containing the URL of a domain that is assumed to be always available.- Throws:
IOException
- if a connection can't be established
-
checkUpdateCenter
public void checkUpdateCenter(UpdateCenter.ConnectionCheckJob job, String updateCenterUrl) throws IOException Check connection to update center server.- Parameters:
job
- The connection checker that is invoking this strategy.updateCenterUrl
- A sting containing the URL of the update center host.- Throws:
IOException
- if a connection to the update center server can't be established.
-
preValidate
Validate the URL of the resource before downloading it.- Parameters:
job
- The download job that is invoking this strategy. This job is responsible for managing the status of the download and installation.src
- The location of the resource on the network- Throws:
IOException
- if the validation fails
-
postValidate
Validate the resource after it has been downloaded, before it is installed. The default implementation does nothing.- Parameters:
job
- The download job that is invoking this strategy. This job is responsible for managing the status of the download and installation.src
- The location of the downloaded resource.- Throws:
IOException
- if the validation fails.
-
download
Download a plugin or core upgrade in preparation for installing it into its final location. Implementations will normally download the resource into a temporary location and hand off a reference to this location to the install or upgrade strategy to move into the final location.- Parameters:
job
- The download job that is invoking this strategy. This job is responsible for managing the status of the download and installation.src
- The URL to the resource to be downloaded.- Returns:
- A File object that describes the downloaded resource.
- Throws:
IOException
- if there were problems downloading the resource.- See Also:
-
connect
Connects to the given URL for downloading the binary. Useful for tweaking how the connection gets established.- Throws:
IOException
-
install
Called after a plugin has been downloaded to move it into its final location. The default implementation is a file rename.- Parameters:
job
- The install job that is invoking this strategy.src
- The temporary location of the plugin.dst
- The final destination to install the plugin to.- Throws:
IOException
- if there are problems installing the resource.
-
upgrade
Called after an upgrade has been downloaded to move it into its final location. The default implementation is a file rename.- Parameters:
job
- The upgrade job that is invoking this strategy.src
- The temporary location of the upgrade.dst
- The final destination to install the upgrade to.- Throws:
IOException
- if there are problems installing the resource.
-
getConnectionCheckUrl
Deprecated.as of 1.333 With the introduction of multiple update center capability, this information is now a part of theupdate-center.json
file. Seehttp://jenkins-ci.org/update-center.json
as an example.Returns an "always up" server for Internet connectivity testing. -
getUpdateCenterUrl
Deprecated.as of 1.333 With the introduction of multiple update center capability, this information is now moved toUpdateSite
.Returns the URL of the server that hosts the update-center.json file.- Returns:
- Absolute URL that ends with '/'.
-
getPluginRepositoryBaseUrl
Deprecated.as of 1.333update-center.json
is now signed, so we don't have to further make sure that we aren't downloading from anywhere unsecure.Returns the URL of the server that hosts plugins and core updates.
-
update-center.json
file.