Class IncidentsSection

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

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class IncidentsSection extends Object implements ModelObject, org.kohsuke.stapler.StaplerProxy
The incident list at /batch-control/incidents/ (SPEC item 11). One month is shown at a time, selected with ?month=YYYY-MM (default: current month), newest first, pages of 50 (?page=N).

Viewing requires ViewHistory, enforced for the whole subtree by getTarget(). The list itself is read-only (PUT/DELETE/PATCH are 405); the state-changing endpoints live on IncidentItem under /batch-control/incidents/<id>/.

  • Field Details

    • PAGE_SIZE

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

    • IncidentsSection

      public IncidentsSection()
  • 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 IncidentItem getDynamic(String id)
      Stapler: serves /batch-control/incidents/<id>/; null renders a 404, also for every failed lookup (S-39-01, RecordLookup). Every ViewHistory holder, whom getTarget() has admitted, may see every incident.
    • getMonth

      public YearMonth getMonth()
      The selected month, from ?month=YYYY-MM; current month on absence or garbage.
    • getMonthValue

      public String getMonthValue()
      Selected month as YYYY-MM (value of the month input and the query parameter).
    • getPreviousMonth

      public String getPreviousMonth()
      Previous month as YYYY-MM (for the navigation link).
    • getNextMonth

      public String getNextMonth()
      Next month as YYYY-MM (for the navigation link).
    • isHasNextMonth

      public boolean isHasNextMonth()
      Whether a next-month link makes sense (no incidents exist in the future).
    • getPage

      public int getPage()
      Current 1-based page, from the page query parameter (Paging).
    • getPageItems

      public List<Incident> getPageItems()
      The incidents shown on the current page, newest first.
    • getTotal

      public int getTotal()
      Matching incidents read (a lower bound when isTruncated()).
    • isTruncated

      public boolean isTruncated()
      Whether the per-request record cap stopped the read: ask to narrow the filter.
    • getOversized

      public int getOversized()
      Over-long lines (over 1 MiB) skipped while reading this page (security-11 N-02); the CSV export skips the same lines, so the screen says so rather than look complete.
    • getCsvUrl

      public String getCsvUrl()
      The complete CSV export of what this screen lists (S-03), relative to this section. Pointed to by the truncation notice: the export is not bound by the per-screen record cap. Only ISO dates and constant names go into it, so no encoding is needed.
    • isHasPrevious

      public boolean isHasPrevious()
    • isHasNext

      public boolean isHasNext()
    • format

      public String format(Instant instant)
      Human-readable timestamp.
    • runUrl

      @CheckForNull public String runUrl(Incident incident)
      Root-relative build URL for the incident's originating run, or null for plain text (D-44).
    • createdAt

      @CheckForNull public Instant createdAt(Incident incident)
      Creation timestamp of an incident (Jelly helper for the list column).