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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.AdministrativeMonitor
id
-
-
Constructor Summary
Constructors Constructor Description JavaVersionRecommendationAdminMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponsedoAct(String no)Depending on whether the user said "yes" or "no", send him to the right place.StringgetDisplayName()DategetEndOfLifeAsDate()intgetJavaVersion()PermissiongetRequiredPermission()Required permission to view this admin monitor.StringgetSeverityAsString()booleanisActivated()Returns true if this monitor is activated and wants to produce a warning message.-
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getSearchUrl, getTarget, getUrl, isEnabled, isSecurity
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Method Detail
-
isActivated
public boolean isActivated()
Description copied from class:AdministrativeMonitorReturns 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:
isActivatedin classAdministrativeMonitor
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceModelObject- Overrides:
getDisplayNamein classAdministrativeMonitor
-
getRequiredPermission
public Permission getRequiredPermission()
Description copied from class:AdministrativeMonitorRequired permission to view this admin monitor. By defaultJenkins.ADMINISTER, butJenkins.SYSTEM_READis also supported.Changing this permission check to return
Jenkins.SYSTEM_READwill make the active administrative monitor appear onmanage.jellyand on the globally visibleAdministrativeMonitorsDecoratorto users without Administer permission.AdministrativeMonitor.doDisable(StaplerRequest, StaplerResponse)will still always require Administer permission.Implementers need to ensure that
doActand 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:
getRequiredPermissionin classAdministrativeMonitor
-
doAct
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doAct(@QueryParameter String no) throws IOExceptionDepending 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:
Runtime.version()
-
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.
-
-