Class ChangesSection

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

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

Change records are append-only audit data: this section is strictly read-only (no POST endpoints at all) and requires ViewHistory, enforced for the whole subtree by getTarget().

  • Field Details

    • PAGE_SIZE

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

    • ChangesSection

      public ChangesSection()
  • 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).
    • getLinks

      public SectionAccess getLinks()
      Link predicates: a link to another screen is rendered only if the user may open it.
    • 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 records exist in the future).
    • getPage

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

      public List<ChangeRecord> getPageItems()
      The change records shown on the current page, newest first.
    • getTotal

      public int getTotal()
      Matching records 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)
      Jelly helper: human-readable timestamp.
    • diffSummary

      public String diffSummary(@CheckForNull String diff)
      Jelly helper: +12 / -3 lines for a record's diff, shown next to the disclosure control so the size of a configuration change is readable without opening it (U-07).
      Returns:
      an empty string when there is no countable diff (no diff, or the "too large to store" placeholder), in which case the view shows no summary