use of org.apache.directory.api.ldap.model.cursor.CursorException in project jackrabbit-oak by apache.
the class LdapIdentityProvider method getUser.
@Override
public ExternalUser getUser(@Nonnull String userId) throws ExternalIdentityException {
DebugTimer timer = new DebugTimer();
LdapConnection connection = connect();
timer.mark("connect");
try {
Entry entry = getEntry(connection, config.getUserConfig(), userId, config.getCustomAttributes());
timer.mark("lookup");
if (log.isDebugEnabled()) {
log.debug("getUser({}) {}", userId, timer.getString());
}
if (entry != null) {
return createUser(entry, userId);
} else {
return null;
}
} catch (LdapException e) {
throw lookupFailedException(e, timer);
} catch (CursorException e) {
throw lookupFailedException(e, timer);
} finally {
disconnect(connection);
}
}
Aggregations