Class JobTriggerLockAction

java.lang.Object
io.jenkins.plugins.batchcontrol.action.JobTriggerLockAction
All Implemented Interfaces:
Action, ModelObject

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class JobTriggerLockAction extends Object implements Action
The job-page notice for blocked unattended triggers (SPEC item 6). A job whose blockTimer or blockUpstream switch is on refuses those runs with nobody to tell, so its main page (jobMain.jelly, included for every action by both the Freestyle and the Pipeline job page) names the switch and says it is cleared in the job configuration, which is change-controlled.

The action has no sidebar entry and no URL (getIconFileName() and getUrlName() are null); it is attached to every job by JobRequestActionFactory and decides from getBlockingSwitches() whether there is anything to show. It never changes state.

  • Constructor Details

    • JobTriggerLockAction

      public JobTriggerLockAction(Job<?,?> job)
  • Method Details

    • getJob

      public Job<?,?> getJob()
    • getIconFileName

      @CheckForNull public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      @CheckForNull public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getBlockingSwitches

      public List<String> getBlockingSwitches()
      The switches that refuse unattended runs of this job right now, for a viewer holding Item/Read, whether or not the job requires approval for manual runs; empty when run control is off, both switches are off, or the viewer may not read the job (the notice is then not rendered).
    • isTimerBlocked

      public boolean isTimerBlocked()
      Whether blockTimer is refusing cron runs (Jelly).
    • isUpstreamBlocked

      public boolean isUpstreamBlocked()
      Whether blockUpstream is refusing upstream-triggered runs (Jelly).
    • isCanConfigure

      public boolean isCanConfigure()
      Whether the viewer may open the job configuration, so the notice links to it.
    • isChangeControlEnabled

      public boolean isChangeControlEnabled()
      Whether change control is on, so clearing a switch needs a permission window.
    • getLinks

      public SectionAccess getLinks()
      Link predicates: the Grants screen is linked only for a user who may open it.