public final class UpdateSite.Plugin extends UpdateSite.Entry
Modifier and Type | Field and Description |
---|---|
String[] |
categories
Categories for grouping plugins, taken from labels assigned to wiki page.
|
String |
compatibleSinceVersion
Optional version # from which this plugin release is configuration-compatible.
|
Map<String,String> |
dependencies
Dependencies of this plugin, a name -> version mapping.
|
String |
excerpt
Optional excerpt string.
|
String |
latest
The latest existing version of this plugin.
|
String |
minimumJavaVersion
Version of Java this plugin requires to run.
|
Map<String,String> |
optionalDependencies
Optional dependencies of this plugin.
|
Double |
popularity
Popularity of this plugin.
|
Date |
releaseTimestamp
Date when this plugin was released.
|
String |
requiredCore
Version of Jenkins core this plugin was compiled against.
|
String |
title
Human readable title of the plugin, taken from Wiki page.
|
String |
wiki
Optional URL to the Wiki page that discusses this plugin.
|
name, sourceId, url, version
Constructor and Description |
---|
Plugin(String sourceId,
net.sf.json.JSONObject o) |
Modifier and Type | Method and Description |
---|---|
Future<UpdateCenter.UpdateCenterJob> |
deploy() |
Future<UpdateCenter.UpdateCenterJob> |
deploy(boolean dynamicLoad)
Schedules the installation of this plugin.
|
Future<UpdateCenter.UpdateCenterJob> |
deploy(boolean dynamicLoad,
UUID correlationId,
List<PluginWrapper> batch)
Schedules the installation of this plugin.
|
Future<UpdateCenter.UpdateCenterJob> |
deployBackup()
Schedules the downgrade of this plugin.
|
org.kohsuke.stapler.HttpResponse |
doDowngrade()
Performs the downgrade of the plugin.
|
org.kohsuke.stapler.HttpResponse |
doInstall()
Making the installation web bound.
|
org.kohsuke.stapler.HttpResponse |
doInstallNow() |
boolean |
fixesSecurityVulnerabilities()
Returns true if and only if this update addressed a currently active security vulnerability.
|
Stream<String> |
getCategoriesStream()
Get categories stream for further search.
|
List<UpdateSite.Plugin> |
getDependenciesIncompatibleWithInstalledVersion(PluginManager.MetadataCache cache)
Get the list of incompatible dependencies (if there are any, as determined by isNeededDependenciesCompatibleWithInstalledVersion)
|
UpdateSite.Deprecation |
getDeprecation() |
String |
getDisplayName() |
Set<UpdateSite.Plugin> |
getIncompatibleParentPlugins() |
PluginWrapper |
getInstalled()
If some version of this plugin is currently installed, return
PluginWrapper . |
List<UpdateSite.Plugin> |
getNeededDependencies()
Returns a list of dependent plugins which need to be installed or upgraded for this plugin to work.
|
VersionNumber |
getNeededDependenciesMinimumJavaVersion()
Returns the minimum Java version needed to use the plugin and all its dependencies.
|
VersionNumber |
getNeededDependenciesRequiredCore() |
Set<UpdateSite.Warning> |
getWarnings() |
boolean |
hasCategory(String category)
Checks whether a plugin has a desired category
|
boolean |
hasIncompatibleParentPlugins() |
boolean |
hasWarnings() |
void |
install()
Deprecated.
as of 1.326
Use
deploy() . |
boolean |
isCompatible()
Returns true if the plugin and its dependencies are fully compatible with the current installation
This is set to restricted for now, since it is only being used by Jenkins UI or Restful API at the moment.
|
boolean |
isCompatible(PluginManager.MetadataCache cache) |
boolean |
isCompatibleWithInstalledVersion()
If the plugin is already installed, and the new version of the plugin has a "compatibleSinceVersion"
value (i.e., it's only directly compatible with that version or later), this will check to
see if the installed version is older than the compatible-since version.
|
boolean |
isDeprecated() |
boolean |
isForNewerHudson() |
boolean |
isForNewerJava()
Returns true iff the plugin declares a minimum Java version and it's newer than what the Jenkins master is running on.
|
boolean |
isNeededDependenciesCompatibleWithInstalledVersion()
If at least some of the plugin's needed dependencies are already installed, and the new version of the
needed dependencies plugin have a "compatibleSinceVersion"
value (i.e., it's only directly compatible with that version or later), this will check to
see if the installed version is older than the compatible-since version.
|
boolean |
isNeededDependenciesCompatibleWithInstalledVersion(PluginManager.MetadataCache cache) |
boolean |
isNeededDependenciesForNewerJava()
Returns true iff any of the plugin dependencies require a newer Java than Jenkins is running on.
|
boolean |
isNeededDependenciesForNewerJenkins() |
boolean |
isNeededDependenciesForNewerJenkins(PluginManager.MetadataCache cache) |
void |
setIncompatibleParentPlugins(Set<UpdateSite.Plugin> incompatibleParentPlugins) |
getApi, getSha1, getSha256, getSha512, isNewerThan
@Exported public final String wiki
@Exported public final String title
beware of XSS vulnerability since this data comes from Wiki
@Exported public final String excerpt
@Exported public final String compatibleSinceVersion
@Exported public final String requiredCore
@Exported public final String minimumJavaVersion
@Exported @CheckForNull public final String[] categories
null
if the update center does not return categories.@Exported public final Map<String,String> dependencies
@Exported public final Map<String,String> optionalDependencies
@Exported public final Date releaseTimestamp
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public final Double popularity
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String latest
@DataBoundConstructor public Plugin(String sourceId, net.sf.json.JSONObject o)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isDeprecated()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public UpdateSite.Deprecation getDeprecation()
public String getDisplayName()
@Exported public PluginWrapper getInstalled()
PluginWrapper
.
Otherwise null.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported public boolean isCompatible()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isCompatible(PluginManager.MetadataCache cache)
@Exported public boolean isCompatibleWithInstalledVersion()
@Exported public List<UpdateSite.Plugin> getNeededDependencies()
public boolean isForNewerHudson()
public boolean isForNewerJava()
public VersionNumber getNeededDependenciesRequiredCore()
@CheckForNull public VersionNumber getNeededDependenciesMinimumJavaVersion()
public boolean isNeededDependenciesForNewerJenkins()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isNeededDependenciesForNewerJenkins(PluginManager.MetadataCache cache)
public boolean isNeededDependenciesForNewerJava()
public boolean isNeededDependenciesCompatibleWithInstalledVersion()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isNeededDependenciesCompatibleWithInstalledVersion(PluginManager.MetadataCache cache)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean fixesSecurityVulnerabilities()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<UpdateSite.Plugin> getDependenciesIncompatibleWithInstalledVersion(PluginManager.MetadataCache cache)
public void setIncompatibleParentPlugins(Set<UpdateSite.Plugin> incompatibleParentPlugins)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<UpdateSite.Plugin> getIncompatibleParentPlugins()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean hasIncompatibleParentPlugins()
@CheckForNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<UpdateSite.Warning> getWarnings()
public boolean hasCategory(String category)
public Stream<String> getCategoriesStream()
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean hasWarnings()
@Deprecated public void install()
deploy()
.public Future<UpdateCenter.UpdateCenterJob> deploy()
public Future<UpdateCenter.UpdateCenterJob> deploy(boolean dynamicLoad)
This is mainly intended to be called from the UI. The actual installation work happens asynchronously in another thread.
dynamicLoad
- If true, the plugin will be dynamically loaded into this Jenkins. If false,
the plugin will only take effect after the reboot.
See UpdateCenter.isRestartRequiredForCompletion()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public Future<UpdateCenter.UpdateCenterJob> deploy(boolean dynamicLoad, @CheckForNull UUID correlationId, @CheckForNull List<PluginWrapper> batch)
This is mainly intended to be called from the UI. The actual installation work happens asynchronously in another thread.
dynamicLoad
- If true, the plugin will be dynamically loaded into this Jenkins. If false,
the plugin will only take effect after the reboot.
See UpdateCenter.isRestartRequiredForCompletion()
correlationId
- A correlation ID to be set on the job.batch
- if defined, a list of plugins to add to, which will be started laterpublic Future<UpdateCenter.UpdateCenterJob> deployBackup()
public org.kohsuke.stapler.HttpResponse doInstall() throws IOException
IOException
public org.kohsuke.stapler.HttpResponse doInstallNow() throws IOException
IOException
public org.kohsuke.stapler.HttpResponse doDowngrade() throws IOException
IOException
Copyright © 2004–2021. All rights reserved.