[SDK-2664] Add support for checkpoint pagination#362
Merged
jimmyjames merged 3 commits intomasterfrom Jul 26, 2021
Merged
Conversation
2c8d90e to
25bfbbe
Compare
25bfbbe to
e425ba0
Compare
lbalmaceda
reviewed
Jul 23, 2021
| super(start, length, total, limit, items); | ||
| } | ||
|
|
||
| public MembersPage(Integer start, Integer length, Integer total, Integer limit, String next, List<Member> items) { |
Contributor
There was a problem hiding this comment.
who could be using the old constructors today? should we deprecate them, now that we have these? (separate PR)
Contributor
Author
There was a problem hiding this comment.
The deserializers call these constructors in their overridden createPage implementations. It probably is worth deprecating these like you said. And also worth considering if there are refactorings we could do (likely in a new major) to make the paging deserialization more future-proof to these types of changes. I can deprecate the old constructors in a follow-up PR.
Contributor
There was a problem hiding this comment.
Yes, that would be great.
lbalmaceda
approved these changes
Jul 23, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This change adds checkpoint pagination support to the following APIs:
OrganizationEntity#list(PageFilter filter)OrganizationEntity#getMembers(String orgId, PageFilter filter)RolesEntity#listUsers(String roleId, PageFilter filter)While the methods listed above are not changed directly, the following changes enable supporting checkpoint pagination:
withFrom(String from)andwithTake(int take)toPageFilterto support thefromandtakequery parameters.PagePOJO for thenextfield that may be returned when using checkpoint pagination, along with a new constructor that accepts thenextparameter.PageDeserializerto create aPagewith thenextparameter. Unlike the other methods in this class, this new method is not abstract, as doing so would require all subclasses to implement this method, and would be a breaking change. Instead, the new method delegates to the existing method to create thePage, and any subclasses that need to support checkpoint pagination will need to override this method to construct thePagewith thenextfield.References
In addition to SDK-2664, the following API2 endpoints can be consulted for documentation on the checkpoint pagination support they offer:
Testing
In addition to the unit tests included, manual testing was also performed with the changes.