Class JavaVersionRecommendationAdminMonitor

java.lang.Object
hudson.model.AbstractModelObject
hudson.model.AdministrativeMonitor
jenkins.monitor.JavaVersionRecommendationAdminMonitor
All Implemented Interfaces:
ExtensionPoint, ModelObject, SearchableModelObject, SearchItem, org.kohsuke.stapler.StaplerProxy

@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Symbol("javaVersionRecommendation") public class JavaVersionRecommendationAdminMonitor extends AdministrativeMonitor
  • Constructor Details

    • JavaVersionRecommendationAdminMonitor

      public JavaVersionRecommendationAdminMonitor()
  • Method Details

    • isActivated

      public boolean isActivated()
      Description copied from class: AdministrativeMonitor
      Returns true if this monitor is activated and wants to produce a warning message.

      This method is called from the HTML rendering thread, so it should run efficiently.

      Specified by:
      isActivated in class AdministrativeMonitor
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class AdministrativeMonitor
    • getRequiredPermission

      public Permission getRequiredPermission()
      Description copied from class: AdministrativeMonitor
      Required permission to view this admin monitor. By default Jenkins.ADMINISTER, but Jenkins.SYSTEM_READ or Jenkins.MANAGE are also supported.

      Changing this permission check to return Jenkins.SYSTEM_READ will make the active administrative monitor appear on manage.jelly and on the globally visible AdministrativeMonitorsDecorator to users without Administer permission. AdministrativeMonitor.doDisable(StaplerRequest2, StaplerResponse2) will still always require Administer permission.

      This method only allows for a single permission to be returned. If more complex permission checks are required, override AdministrativeMonitor.checkRequiredPermission() and AdministrativeMonitor.hasRequiredPermission() instead.

      Implementers need to ensure that doAct and other web methods perform necessary permission checks: Users with System Read permissions are expected to be limited to read-only access. Form UI elements that change system state, e.g. toggling a feature on or off, need to be hidden from users lacking Administer permission.

      Overrides:
      getRequiredPermission in class AdministrativeMonitor
    • doAct

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doAct(@QueryParameter String no) throws IOException
      Depending on whether the user said "yes" or "no", send him to the right place.
      Throws:
      IOException
    • getJavaVersion

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public int getJavaVersion()
      Returns:
      The current feature-release counter.
      See Also:
    • getEndOfLifeAsDate

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public Date getEndOfLifeAsDate()
      Returns:
      The end of life date for the current Java version in the system default time zone.
    • getSeverityAsString

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public String getSeverityAsString()
      Returns:
      The severity of the administrative monitor, used to set the background color of the alert.