Search code examples
ldapunboundid-ldap-sdknetscape

Netscape ldap migration to unboundid


What would be the best way to sort LDAPSearch results res by ascending order with unboundid?

Currently, my netscape project has it as follow:

res = ldapConfig.search(ldapConfig.getDepartment(), LDAPConnection.SCOPE_SUB, 
    grpFilter, grpAttrs, false, cons);
res.sort(new LDAPCompareAttrNames("MY_ATTRIBUTE", true));

When upgrading to com.unboundid.ldap.sdk.migrate.ldapjdk.*, LDAPCompareAttrNames() and sort() were the only two methods not supported by the unboundid .migrate.ldapjdk library.

Any input would be greatly appreciated.

Thanks,


Solution

  • Although the LDAP SDK provides client-side support for sorting entries (via the com.unboundid.ldap.sdk.EntrySorter API, which also implements Comparator so you can use to sort entries in other collections), this is not currently exposed in the code that provides compatibility assistance for the Netscape LDAP SDK. I will look into adding that.