Skip to content

Commit

Permalink
Use the newly configurable paging support/size
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylinsic committed Apr 18, 2024
1 parent 1bf2e5f commit e39b711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ protected List<String> getBaseDNs() {

protected LdapSearchStrategy getSearchStrategy() {
LdapSearchStrategy result = conn.getConfiguration().newDefaultSearchStrategy(false);
if (options.getPageSize() != null) {
if (conn.getConfiguration().isUsePaging()) {
if (conn.getConfiguration().isUseVlvControls() && conn.supportsControl(VirtualListViewControl.OID)) {
String vlvSortAttr = conn.getConfiguration().getVlvSortAttribute();
result = new VlvIndexSearchStrategy(vlvSortAttr, options.getPageSize());
result = new VlvIndexSearchStrategy(vlvSortAttr, conn.getConfiguration().getPageSize());
} else if (conn.supportsControl(PagedResultsControl.OID)) {
result = new PagedSearchStrategy(
options.getPageSize(),
conn.getConfiguration().getPageSize(),
options.getPagedResultsCookie(),
options.getPagedResultsOffset(),
handler instanceof SearchResultsHandler ? (SearchResultsHandler) handler : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected static String searchControlsToString(final SearchControls controls) {

public static Class<? extends LdapSearchStrategy> getSearchStrategy(LdapConnection conn, OperationOptions options) {
Class<? extends LdapSearchStrategy> clazz = DefaultSearchStrategy.class;
if (options.getPageSize() != null) {
if (conn.getConfiguration().isUsePaging()) {
if (conn.getConfiguration().isUseVlvControls() && conn.supportsControl(VirtualListViewControl.OID)) {
clazz = VlvIndexSearchStrategy.class;
} else if (conn.supportsControl(PagedResultsControl.OID)) {
Expand Down

0 comments on commit e39b711

Please sign in to comment.