Skip to content

DIRSTUDIO-1214: Follow the paged results cookie in the DSML export - #129

Open
zx97 wants to merge 1 commit into
apache:masterfrom
zx97:fix/DIRSTUDIO-1214-dsml-export
Open

zx97 wants to merge 1 commit into
apache:masterfrom
zx97:fix/DIRSTUDIO-1214-dsml-export

Conversation

@zx97

@zx97 zx97 commented Dec 3, 2026

Copy link
Copy Markdown

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 PagedResults response 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:

  • the cookie of the given SearchParameter is 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);
  • pagination stops when no PagedResults request 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant