Package hudson.model

Class UpdateCenter.UpdateCenterConfiguration

java.lang.Object
hudson.model.UpdateCenter.UpdateCenterConfiguration
All Implemented Interfaces:
ExtensionPoint
Enclosing class:
UpdateCenter

public static class UpdateCenter.UpdateCenterConfiguration extends Object implements ExtensionPoint
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
  • 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

      public void preValidate(UpdateCenter.DownloadJob job, URL src) throws IOException
      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

      public void postValidate(UpdateCenter.DownloadJob job, File src) throws IOException
      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

      public File download(UpdateCenter.DownloadJob job, URL src) throws IOException
      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

      protected URLConnection connect(UpdateCenter.DownloadJob job, URL src) throws IOException
      Connects to the given URL for downloading the binary. Useful for tweaking how the connection gets established.
      Throws:
      IOException
    • install

      public void install(UpdateCenter.DownloadJob job, File src, File dst) throws IOException
      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

      public void upgrade(UpdateCenter.DownloadJob job, File src, File dst) throws IOException
      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 public String getConnectionCheckUrl()
      Deprecated.
      as of 1.333 With the introduction of multiple update center capability, this information is now a part of the update-center.json file. See http://jenkins-ci.org/update-center.json as an example.
      Returns an "always up" server for Internet connectivity testing.
    • getUpdateCenterUrl

      @Deprecated public String getUpdateCenterUrl()
      Deprecated.
      as of 1.333 With the introduction of multiple update center capability, this information is now moved to UpdateSite.
      Returns the URL of the server that hosts the update-center.json file.
      Returns:
      Absolute URL that ends with '/'.
    • getPluginRepositoryBaseUrl

      @Deprecated public String getPluginRepositoryBaseUrl()
      Deprecated.
      as of 1.333 update-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.