@ExportedBean public class UpdateSite extends Object
Jenkins can have multiple UpdateSite
s registered in the system, so that it can pick up plugins
from different locations.
Modifier and Type | Class and Description |
---|---|
class |
UpdateSite.Data
In-memory representation of the update center data.
|
static class |
UpdateSite.Deprecation
Represents a deprecation of a certain component.
|
static class |
UpdateSite.Entry |
class |
UpdateSite.Plugin |
static class |
UpdateSite.Warning
Represents a warning about a certain component, mostly related to known security issues.
|
static class |
UpdateSite.WarningVersionRange
A version range for
Warning s indicates which versions of a given plugin are affected
by it. |
Modifier and Type | Field and Description |
---|---|
static boolean |
neverUpdate |
Constructor and Description |
---|
UpdateSite(String id,
String url) |
Modifier and Type | Method and Description |
---|---|
protected UpdateCenter.InstallationJob |
createInstallationJob(UpdateSite.Plugin plugin,
UpdateCenter uc,
boolean dynamicLoad)
Extension point to allow implementations of
UpdateSite to create a custom
UpdateCenter.InstallationJob . |
org.kohsuke.stapler.HttpResponse |
doInvalidateData()
Invalidates the cached data and force retrieval.
|
FormValidation |
doVerifySignature() |
Api |
getApi() |
List<UpdateSite.Plugin> |
getAvailables()
Returns a list of plugins that should be shown in the "available" tab.
|
String |
getConnectionCheckUrl()
Gets a URL for the Internet connection check.
|
UpdateSite.Data |
getData()
Loads the update center data, if any.
|
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.
|
protected JSONSignatureValidator |
getJsonSignatureValidator()
Deprecated.
use
getJsonSignatureValidator(String) instead. |
protected JSONSignatureValidator |
getJsonSignatureValidator(String name)
Let sub-classes of UpdateSite provide their own signature validator.
|
String |
getMetadataUrlForDownloadable(String downloadable)
URL which exposes the metadata location in a specific update site.
|
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()
Update the data file from the given URL if the file
does not exist, or is otherwise due for update.
|
Future<FormValidation> |
updateDirectly(boolean signatureCheck)
Deprecated.
use updateDirectly()
|
FormValidation |
updateDirectlyNow()
Forces an update of the data file from the configured URL, irrespective of the last time the data was retrieved.
|
FormValidation |
updateDirectlyNow(boolean signatureCheck) |
@Exported public String getId()
@Exported public long getDataTimestamp()
@CheckForNull public Future<FormValidation> updateDirectly()
postMessage
, not raw JSON.@Deprecated @CheckForNull public Future<FormValidation> updateDirectly(boolean signatureCheck)
postMessage
, not raw JSON.signatureCheck
- whether to enforce the signature (may be off only for testing!)@NonNull public FormValidation updateDirectlyNow() throws IOException
FormValidation
indicating the if the update metadata was successfully downloaded from the configured update siteIOException
- if there was an error downloading or saving the file.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public FormValidation updateDirectlyNow(boolean signatureCheck) throws IOException
IOException
public FormValidation doVerifySignature() throws IOException
IOException
protected UpdateCenter.InstallationJob createInstallationJob(UpdateSite.Plugin plugin, UpdateCenter uc, boolean dynamicLoad)
UpdateSite
to create a custom
UpdateCenter.InstallationJob
.plugin
- the plugin to create the UpdateCenter.InstallationJob
for.uc
- the UpdateCenter
.dynamicLoad
- true
if the plugin should be attempted to be dynamically loaded.UpdateCenter.InstallationJob
.@Deprecated @NonNull protected JSONSignatureValidator getJsonSignatureValidator()
getJsonSignatureValidator(String)
instead.@NonNull protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name)
name,
- the name for the JSON signature Validator object.
if name is null, then the default name will be used,
which is "update site" followed by the update site idpublic boolean isDue()
public org.kohsuke.stapler.HttpResponse doInvalidateData()
@CheckForNull public UpdateSite.Data getData()
public net.sf.json.JSONObject getJSONObject()
@Exported public List<UpdateSite.Plugin> getAvailables()
@CheckForNull public UpdateSite.Plugin getPlugin(String artifactId)
artifactId
- The short name of the plugin. Corresponds to PluginWrapper.getShortName()
.null
if no such information is found.public Api getApi()
@Exported @CheckForNull public String getConnectionCheckUrl()
null
if we are going to skip the test.@Exported public List<UpdateSite.Plugin> getUpdates()
@Exported public boolean hasUpdates()
@Exported public String getUrl()
@CheckForNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getMetadataUrlForDownloadable(String downloadable)
downloadable,
- the downloadable id of a specific metatadata json (e.g. hudson.tasks.Maven.MavenInstaller.json)@Deprecated public String getDownloadUrl()
public boolean isLegacyDefault()
Copyright © 2004–2021. All rights reserved.