Class FilterParser

java.lang.Object
io.jenkins.plugins.batchcontrol.ui.FilterParser

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class FilterParser extends Object
Parses and validates the history filter query parameters (SPEC item 12): from, to (ISO dates, inclusive), job (case-insensitive substring of the full name), user (exact id), result and status (enum-name tokens).

All parsing is forgiving: garbage values fall back to the default instead of failing, so a hand-edited URL can never produce a stack trace.

Bounds (SPEC item 4): a query span is capped by records, not by files — the store's page queries stop after Store.MAX_SCANNED_RECORDS and the screen asks the user to narrow the filter. There is no month cap on the span. Dates themselves are validated: only plain yyyy-MM-dd with a year in 1970..9999 is accepted, and FilterParser.Filter.months(Collection) only yields months that exist in the store, so a wide span never iterates over empty months.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The validated filter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default range length in days (inclusive of today) when no dates are given.
    static final int
    Highest accepted year of a from/to date (input validation).
    static final int
    Lowest accepted year of a from/to date (input validation).
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(org.kohsuke.stapler.StaplerRequest2 req)
    Parses the filter from the current request; never returns null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_YEAR

      public static final int MIN_YEAR
      Lowest accepted year of a from/to date (input validation).
      See Also:
    • MAX_YEAR

      public static final int MAX_YEAR
      Highest accepted year of a from/to date (input validation).
      See Also:
    • DEFAULT_RANGE_DAYS

      public static final int DEFAULT_RANGE_DAYS
      Default range length in days (inclusive of today) when no dates are given.
      See Also:
  • Method Details

    • parse

      public static FilterParser.Filter parse(@CheckForNull org.kohsuke.stapler.StaplerRequest2 req)
      Parses the filter from the current request; never returns null.