Class Pagination
- All Implemented Interfaces:
Describable<Pagination>,Serializable
- Direct Known Subclasses:
ContinuationTokenPagination,LinkHeaderPagination
public abstract class Pagination
extends AbstractDescribableImpl<Pagination>
implements Serializable
How a parameter follows a paginated REST API: given one fetched page, a strategy tells where the next
page is. The fetch loop, the page limit and the origin and loop guards live in
RestValueService.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWhere the next page is: its URL and, for token based strategies, the token (used to detect loops).static final classA fetched page as seen by a strategy.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FormValidationcheckMaxPages(String value) intintincompatibilityWith(MimeType mimeType) The error that makes this strategy unusable withmimeTypeat fetch time, if any.abstract Optional<Pagination.NextPage> next(Pagination.Page page) Finds the next page to request afterpage.voidsetMaxPages(int maxPages) Runs the same checks as the configuration form's field checks, for settings that were never saved.Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Field Details
-
DEFAULT_MAX_PAGES
public static final int DEFAULT_MAX_PAGES- See Also:
-
MIN_MAX_PAGES
public static final int MIN_MAX_PAGES- See Also:
-
MAX_MAX_PAGES
public static final int MAX_MAX_PAGES- See Also:
-
-
Constructor Details
-
Pagination
public Pagination()
-
-
Method Details
-
getMaxPages
public int getMaxPages() -
setMaxPages
@DataBoundSetter public void setMaxPages(int maxPages) -
getEffectiveMaxPages
public int getEffectiveMaxPages()- Returns:
- The page limit actually applied:
getMaxPages()clamped to 1..100
-
next
Finds the next page to request afterpage.- Parameters:
page- The page just fetched- Returns:
- The next page, or empty when
pageis the last one
-
incompatibilityWith
The error that makes this strategy unusable withmimeTypeat fetch time, if any. Configuration mistakes that can still be fetched (such as an out-of-range page limit) are not errors here. -
validate
Runs the same checks as the configuration form's field checks, for settings that were never saved.- Parameters:
mimeType- The parameter's MIME type- Returns:
- The first failing check, or
FormValidation.ok()
-
checkMaxPages
-