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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault range length in days (inclusive of today) when no dates are given.static final intHighest accepted year of afrom/todate (input validation).static final intLowest accepted year of afrom/todate (input validation). -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterParser.Filterparse(org.kohsuke.stapler.StaplerRequest2 req) Parses the filter from the current request; never returns null.
-
Field Details
-
MIN_YEAR
public static final int MIN_YEARLowest accepted year of afrom/todate (input validation).- See Also:
-
MAX_YEAR
public static final int MAX_YEARHighest accepted year of afrom/todate (input validation).- See Also:
-
DEFAULT_RANGE_DAYS
public static final int DEFAULT_RANGE_DAYSDefault range length in days (inclusive of today) when no dates are given.- See Also:
-
-
Method Details
-
parse
Parses the filter from the current request; never returns null.
-