Repository navigation
Conversation
The DSML export only returned the first page of a paged search. When the response control carries a cookie, search again with that cookie, as the LDIF export already does. The cookie of the given search parameter is restored afterwards, so a second export does not resume in the middle of the entries. Pagination stops when no PagedResults request control can take the cookie, and a cancelled export writes no file instead of a truncated one. The test exports all entries as DSML request and as DSML response, without a paged results control and with page sizes smaller, equal and larger than the number of entries, checks that the cookie of the request control is left untouched, and checks that a cancelled export writes no file.
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.
JIRA: https://issues.apache.org/jira/browse/DIRSTUDIO-1214
The DSML export stopped after the first page of a paged search, which is why an export is capped at the page size (1000 records by default). When the search result done carries a
PagedResultsresponse control with a cookie, the export now searches again with that cookie, as the LDIF export already does, and appends every page to the same batch response.Two details:
SearchParameteris restored afterwards, so a second export does not resume in the middle of the entries (SearchParameter.clone()shares the control instances, so cloning would not protect it);PagedResultsrequest control can take the cookie, and a cancelled export writes no file instead of a truncated one that would claim success.Tests:
ExportDsmlTest(new) exports 25 entries as DSML request and as DSML response, without a paged results control and with page sizes 4, 25 and 100, then checks that all 25 entries are exported, that there is exactly one<searchResultDone>, that the cookie of the request control is unchanged, and that a cancelled export writes no file. Removing the paging or the cookie restore makes it fail (expected: <25> but was: <4>,array lengths differ).Full build and tests pass with Maven 3.8.8 / JDK 17 against ApacheDS.