use of org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException in project aws-iam-ldap-bridge by denismo.
the class LDAPIAMPoller method getExistingGroup.
private Entry getExistingGroup(Group iamGroup) throws Exception {
Dn dn = directory.getDnFactory().create(String.format(GROUP_FMT, iamGroup.getGroupName()));
LookupOperationContext lookupContext = new LookupOperationContext(directory.getAdminSession(), dn, SchemaConstants.ALL_USER_ATTRIBUTES, SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES);
try {
Entry groupEntry = directory.getPartitionNexus().lookup(lookupContext);
if (groupEntry != null && groupEntry.hasObjectClass("iamgroup")) {
return groupEntry;
}
} catch (LdapNoSuchObjectException e) {
// Fallthrough
}
return null;
}
Aggregations