-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK-2664] Add support for checkpoint pagination #362
Conversation
2c8d90e
to
25bfbbe
Compare
25bfbbe
to
e425ba0
Compare
@@ -23,4 +23,8 @@ public MembersPage(List<Member> items) { | |||
public MembersPage(Integer start, Integer length, Integer total, Integer limit, List<Member> items) { | |||
super(start, length, total, limit, items); | |||
} | |||
|
|||
public MembersPage(Integer start, Integer length, Integer total, Integer limit, String next, List<Member> items) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who could be using the old constructors today? should we deprecate them, now that we have these? (separate PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be great.
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)
toPageFilter
to support thefrom
andtake
query parameters.Page
POJO for thenext
field that may be returned when using checkpoint pagination, along with a new constructor that accepts thenext
parameter.PageDeserializer
to create aPage
with thenext
parameter. 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 thePage
with thenext
field.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.