Class RequestsSection

java.lang.Object
io.jenkins.plugins.batchcontrol.action.RequestsSection
All Implemented Interfaces:
ModelObject, org.kohsuke.stapler.StaplerProxy

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class RequestsSection extends Object implements ModelObject, org.kohsuke.stapler.StaplerProxy
The run request lists at /batch-control/requests/ (D-66): pending requests (oldest first), active ones (approved, run not started) and ended ones (newest first), each in pages of 50 selected with ?pendingPage=N, ?activePage=N and ?endedPage=N.

No state transition logic lives here; everything is delegated to RunRequestService. Viewing requires one of the plugin permissions (requesters need to see their own requests, approvers their inbox), enforced for the whole subtree by getTarget().

  • Field Details

    • PAGE_SIZE

      public static final int PAGE_SIZE
      Page size for the request list.
      See Also:
  • Constructor Details

    • RequestsSection

      public RequestsSection()
  • Method Details

    • getTarget

      public Object getTarget()
      Specified by:
      getTarget in interface org.kohsuke.stapler.StaplerProxy
    • getDisplayName

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

      public Permission[] getViewPermissions()
      Permissions for this screen's l:layout (the same set its section gate checks).
    • getDynamic

      @CheckForNull public RequestItem getDynamic(String id)
      Stapler: serves /batch-control/requests/<id>/; null renders a 404. A request the caller may not see (P-09, S-01) renders exactly like a nonexistent one so its existence is not disclosed, and so does every failed lookup (S-39-01, RecordLookup): a malformed id such as <id>.VALUES never reaches the store, and an unreadable record answers 404, not 500.
    • getPendingItems

      public List<RunRequest> getPendingItems()
      Pending requests on the current page, oldest first (closest to its timeout on top).
    • getPendingPage

      public int getPendingPage()
    • getPendingTotal

      public int getPendingTotal()
    • isHasPendingPrevious

      public boolean isHasPendingPrevious()
    • isHasPendingNext

      public boolean isHasPendingNext()
    • getActiveItems

      public List<RunRequest> getActiveItems()
      Approved requests whose run has not started yet, on the current page, newest first.
    • getActivePage

      public int getActivePage()
    • getActiveTotal

      public int getActiveTotal()
    • isHasActivePrevious

      public boolean isHasActivePrevious()
    • isHasActiveNext

      public boolean isHasActiveNext()
    • getEndedItems

      public List<RunRequest> getEndedItems()
      Executed, rejected, cancelled, expired and invalidated requests, newest first.
    • getEndedPage

      public int getEndedPage()
    • getEndedTotal

      public int getEndedTotal()
    • isHasEndedPrevious

      public boolean isHasEndedPrevious()
    • isHasEndedNext

      public boolean isHasEndedNext()
    • join

      public String join(@CheckForNull List<String> approvers)
      Jelly helper: an approver set for display (a1, a2).
    • format

      public String format(Instant instant)
      Jelly helper: human-readable timestamp.