Package hudson.model

Class UpdateSite.Plugin

    • Field Detail

      • wiki

        @Exported
        public final String wiki
        Optional URL to the Wiki page that discusses this plugin.
      • title

        @Exported
        public final String title
        Human readable title of the plugin, taken from Wiki page. Can be null.

        beware of XSS vulnerability since this data comes from Wiki

      • excerpt

        @Exported
        public final String excerpt
        Optional excerpt string.
      • compatibleSinceVersion

        @Exported
        public final String compatibleSinceVersion
        Optional version # from which this plugin release is configuration-compatible.
      • requiredCore

        @Exported
        public final String requiredCore
        Version of Jenkins core this plugin was compiled against.
      • categories

        @Exported
        @CheckForNull
        public final String[] categories
        Categories for grouping plugins, taken from labels assigned to wiki page. Can be null if the update center does not return categories.
      • dependencies

        @Exported
        public final Map<String,​String> dependencies
        Dependencies of this plugin, a name -> version mapping.
      • optionalDependencies

        @Exported
        public final Map<String,​String> optionalDependencies
        Optional dependencies of this plugin.
      • releaseTimestamp

        @Exported
        public final Date releaseTimestamp
        Date when this plugin was released.
        Since:
        2.224
      • popularity

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public final Double popularity
        Popularity of this plugin.
        Since:
        2.233
      • issueTrackers

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public UpdateSite.IssueTracker[] issueTrackers
        Issue trackers associated with this plugin. This list is sorted by preference in descending order, meaning a UI supporting only one issue tracker should reference the first one supporting the desired behavior (like having a reportUrl).
    • Constructor Detail

      • Plugin

        @DataBoundConstructor
        public Plugin​(String sourceId,
                      net.sf.json.JSONObject o)
    • Method Detail

      • isDeprecated

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isDeprecated()
      • getDeprecation

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public UpdateSite.Deprecation getDeprecation()
      • getDisplayName

        public String getDisplayName()
      • getInstalled

        @Exported
        public PluginWrapper getInstalled()
        If some version of this plugin is currently installed, return PluginWrapper. Otherwise null.
      • isCompatible

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @Exported
        public 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.
        Since:
        2.175
      • isCompatible

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isCompatible​(PluginManager.MetadataCache cache)
      • isCompatibleWithInstalledVersion

        @Exported
        public 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. If it is older, it'll return false. If it's not older, or it's not installed, or it's installed but there's no compatibleSinceVersion specified, it'll return true.
      • getNeededDependencies

        @Exported
        public List<UpdateSite.Plugin> getNeededDependencies()
        Returns a list of dependent plugins which need to be installed or upgraded for this plugin to work.
      • isForNewerHudson

        public boolean isForNewerHudson()
      • getNeededDependenciesRequiredCore

        public VersionNumber getNeededDependenciesRequiredCore()
      • isNeededDependenciesForNewerJenkins

        public boolean isNeededDependenciesForNewerJenkins()
      • isNeededDependenciesForNewerJenkins

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isNeededDependenciesForNewerJenkins​(PluginManager.MetadataCache cache)
      • isNeededDependenciesCompatibleWithInstalledVersion

        public 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. If it is older, it'll return false. If it's not older, or it's not installed, or it's installed but there's no compatibleSinceVersion specified, it'll return true.
      • isNeededDependenciesCompatibleWithInstalledVersion

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isNeededDependenciesCompatibleWithInstalledVersion​(PluginManager.MetadataCache cache)
      • fixesSecurityVulnerabilities

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean fixesSecurityVulnerabilities()
        Returns true if and only if this update addressed a currently active security vulnerability.
        Returns:
        true if and only if this update addressed a currently active security vulnerability.
      • getDependenciesIncompatibleWithInstalledVersion

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public List<UpdateSite.Plugin> getDependenciesIncompatibleWithInstalledVersion​(PluginManager.MetadataCache cache)
        Get the list of incompatible dependencies (if there are any, as determined by isNeededDependenciesCompatibleWithInstalledVersion)
        Since:
        2.203
      • setIncompatibleParentPlugins

        public void setIncompatibleParentPlugins​(Set<UpdateSite.Plugin> incompatibleParentPlugins)
      • getIncompatibleParentPlugins

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public Set<UpdateSite.Plugin> getIncompatibleParentPlugins()
      • hasIncompatibleParentPlugins

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean hasIncompatibleParentPlugins()
      • getWarnings

        @CheckForNull
        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public Set<UpdateSite.Warning> getWarnings()
        Since:
        2.40
      • hasCategory

        public boolean hasCategory​(String category)
        Checks whether a plugin has a desired category
        Since:
        2.272
      • getCategoriesStream

        public Stream<String> getCategoriesStream()
        Get categories stream for further search.
        Since:
        2.272
      • hasWarnings

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        public boolean hasWarnings()
        Since:
        2.40
      • deploy

        public Future<UpdateCenter.UpdateCenterJob> deploy​(boolean dynamicLoad)
        Schedules the installation of this plugin.

        This is mainly intended to be called from the UI. The actual installation work happens asynchronously in another thread.

        Parameters:
        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()
      • deploy

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public Future<UpdateCenter.UpdateCenterJob> deploy​(boolean dynamicLoad,
                                                           @CheckForNull
                                                           UUID correlationId,
                                                           @CheckForNull
                                                           List<PluginWrapper> batch,
                                                           boolean hasEnabledDependents)
        Schedules the installation of this plugin.

        This is mainly intended to be called from the UI. The actual installation work happens asynchronously in another thread.

        Parameters:
        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 later
        hasEnabledDependents - If true, this plugin will be enabled if this plugin is disabled. If false, this plugin will remain the current status.
      • doInstall

        public org.kohsuke.stapler.HttpResponse doInstall()
                                                   throws IOException
        Making the installation web bound.
        Throws:
        IOException
      • doInstallNow

        public org.kohsuke.stapler.HttpResponse doInstallNow()
                                                      throws IOException
        Throws:
        IOException
      • doDowngrade

        public org.kohsuke.stapler.HttpResponse doDowngrade()
                                                     throws IOException
        Performs the downgrade of the plugin.
        Throws:
        IOException