use of io.apiman.gateway.engine.components.ldap.LdapSearchScope in project apiman by apiman.
the class DefaultLdapSearchImpl method getResults.
private void getResults(String searchDn, String filter, LdapSearchScope scope, final IAsyncResultHandler<List<SearchResultEntry>> result) {
try {
SearchScope searchScope = (scope == LdapSearchScope.ONE) ? SearchScope.ONE : SearchScope.SUB;
List<SearchResultEntry> searchResults = connection.search(searchDn, searchScope, filter).getSearchEntries();
result.handle(AsyncResultImpl.create(searchResults));
} catch (LDAPException e) {
if (ldapErrorHandler == null) {
LOGGER.error("LDAP Error Handler not set. Error may be swallowed; " + "this is probably not what you intended.", e);
}
ldapErrorHandler.handle(DefaultExceptionFactory.create(e));
} catch (Exception e) {
result.handle(AsyncResultImpl.<List<SearchResultEntry>>create(e));
}
}
Aggregations