hudson.model
Class UpdateSite

java.lang.Object
  extended by hudson.model.UpdateSite

@ExportedBean
public class UpdateSite
extends Object

Source of the update center information, like "http://jenkins-ci.org/update-center.json"

Jenkins can have multiple UpdateSites registered in the system, so that it can pick up plugins from different locations.

Since:
1.333
Author:
Andrew Bayer, Kohsuke Kawaguchi

Nested Class Summary
 class UpdateSite.Data
          In-memory representation of the update center data.
static class UpdateSite.Entry
           
 class UpdateSite.Plugin
           
 
Field Summary
static boolean neverUpdate
           
 
Constructor Summary
UpdateSite(String id, String url)
           
 
Method Summary
 org.kohsuke.stapler.HttpResponse doInvalidateData()
          Invalidates the cached data and force retrieval.
 FormValidation doPostBack(org.kohsuke.stapler.StaplerRequest req)
          This is the endpoint that receives the update center data file from the browser.
 FormValidation doVerifySignature()
           
 Api getApi()
           
 List<UpdateSite.Plugin> getAvailables()
          Returns a list of plugins that should be shown in the "available" tab.
 String getConnectionCheckUrl()
          Returns an "always up" server for Internet connectivity testing, or null if we are going to skip the test.
 UpdateSite.Data getData()
          Loads the update center data, if any and if modified since last read.
 long getDataTimestamp()
           
 String getDownloadUrl()
          Deprecated. Exposed only for UI.
 String getId()
          Get ID string.
 net.sf.json.JSONObject getJSONObject()
          Gets the raw update center JSON data.
 UpdateSite.Plugin getPlugin(String artifactId)
          Gets the information about a specific plugin.
 List<UpdateSite.Plugin> getUpdates()
          Returns the list of plugins that are updates to currently installed ones.
 String getUrl()
          Exposed to get rid of hardcoding of the URL that serves up update-center.json in Javascript.
 boolean hasUpdates()
          Does any of the plugin has updates?
 boolean isDue()
          Returns true if it's time for us to check for new version.
 boolean isLegacyDefault()
          Is this the legacy default update center site?
 Future<FormValidation> updateDirectly(boolean signatureCheck)
          Update the data file from the given URL if the file does not exist, or is otherwise due for update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

neverUpdate

public static boolean neverUpdate
Constructor Detail

UpdateSite

public UpdateSite(String id,
                  String url)
Method Detail

getId

@Exported
public String getId()
Get ID string.


getDataTimestamp

@Exported
public long getDataTimestamp()

updateDirectly

public Future<FormValidation> updateDirectly(boolean signatureCheck)
Update the data file from the given URL if the file does not exist, or is otherwise due for update. Accepted formats are JSONP or HTML with postMessage, not raw JSON.

Parameters:
signatureCheck - whether to enforce the signature (may be off only for testing!)
Returns:
null if no updates are necessary, or the future result
Since:
1.502

doPostBack

public FormValidation doPostBack(org.kohsuke.stapler.StaplerRequest req)
                          throws IOException,
                                 GeneralSecurityException
This is the endpoint that receives the update center data file from the browser.

Throws:
IOException
GeneralSecurityException

doVerifySignature

public FormValidation doVerifySignature()
                                 throws IOException
Throws:
IOException

isDue

public boolean isDue()
Returns true if it's time for us to check for new version.


doInvalidateData

public org.kohsuke.stapler.HttpResponse doInvalidateData()
Invalidates the cached data and force retrieval.

Since:
1.432

getData

public UpdateSite.Data getData()
Loads the update center data, if any and if modified since last read.

Returns:
null if no data is available.

getJSONObject

public net.sf.json.JSONObject getJSONObject()
Gets the raw update center JSON data.


getAvailables

@Exported
public List<UpdateSite.Plugin> getAvailables()
Returns a list of plugins that should be shown in the "available" tab. These are "all plugins - installed plugins".


getPlugin

public UpdateSite.Plugin getPlugin(String artifactId)
Gets the information about a specific plugin.

Parameters:
artifactId - The short name of the plugin. Corresponds to PluginWrapper.getShortName().
Returns:
null if no such information is found.

getApi

public Api getApi()

getConnectionCheckUrl

@Exported
public String getConnectionCheckUrl()
Returns an "always up" server for Internet connectivity testing, or null if we are going to skip the test.


getUpdates

@Exported
public List<UpdateSite.Plugin> getUpdates()
Returns the list of plugins that are updates to currently installed ones.

Returns:
can be empty but never null.

hasUpdates

@Exported
public boolean hasUpdates()
Does any of the plugin has updates?


getUrl

@Exported
public String getUrl()
Exposed to get rid of hardcoding of the URL that serves up update-center.json in Javascript.


getDownloadUrl

public String getDownloadUrl()
Deprecated. Exposed only for UI.

Where to actually download the update center?


isLegacyDefault

public boolean isLegacyDefault()
Is this the legacy default update center site?



Copyright © 2004-2013. All Rights Reserved.