Skip to content

Commit

Permalink
lsc-project#176: Minor changes for pagesize setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
abpai94 committed Jul 26, 2024
1 parent 1d09c13 commit bea2639
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/lsc/jndi/JndiServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,13 @@ private void initConnection()
throw new NamingException(e.getMessage());
}

// Setting global pageSize variable for LDAPContext
String pageSizeStr = (String) ctx.getEnvironment().get("java.naming.ldap.pageSize");
if (pageSizeStr != null && Integer.parseInt(pageSizeStr) > -1) {
pageSize = Integer.parseInt(pageSizeStr);
List<PagedResultsControl> requestControls = new ArrayList<>();
requestControls.add(new PagedResultsControl(pageSize, Control.CRITICAL));
ctx.setRequestControls(requestControls.toArray(new Control[requestControls.size()]));
} else {
pageSize = -1;
}

sortedBy = (String) ctx.getEnvironment().get("java.naming.ldap.sortedBy");
Expand Down

0 comments on commit bea2639

Please sign in to comment.