- if (attrs.get(objectClass.name()).contains(
- getGroupObjectClass()))
- role = new LdifGroup(this, toDn(searchBase, searchResult),
- attrs);
- else if (attrs.get(objectClass.name()).contains(
- getUserObjectClass()))
- role = new LdifUser(this, toDn(searchBase, searchResult),
- attrs);
- else
- throw new UserDirectoryException(
- "Unsupported LDAP type for "
- + searchResult.getName());
+ if (objectClassAttr.contains(getGroupObjectClass()))
+ role = new LdifGroup(this, dn, attrs);
+ else if (objectClassAttr.contains(getUserObjectClass()))
+ role = new LdifUser(this, dn, attrs);
+ else {
+ log.warn("Unsupported LDAP type for " + searchResult.getName());
+ continue results;
+ }