Attribute attrName = result.getAttributes().get(sNameAttribute);
if ((attrName != null) && (attrName.size() > 0)) {
sName = Val.chkStr(attrName.get(0).toString());
}
}
Group group = new Group();
group.setDistinguishedName(sDN);
group.setKey(group.getDistinguishedName());
group.setName(sName);
user.getGroups().add(group);
}
}
} catch (PartialResultException pre) {
LogUtil.getLogger().finer(pre.toString());
} catch (LimitExceededException lee) {
LogUtil.getLogger().finer(lee.toString());
}
}
} else {
// read group membership based upon a dynamic attribute
StringSet groupDNs = readAttribute(dirContext,sUserDN,sDynamicAttribute);
for (String sDN: groupDNs) {
sDN = sDN.toLowerCase();
if (sDN.length() > 0) {
String sName = "";
if (sNameAttribute.length() > 0) {
StringSet ss = readAttribute(dirContext,sDN,sNameAttribute);
if (ss.size() > 0) {
sName = ss.iterator().next();
}
}
Group group = new Group(sDN);
group.setDistinguishedName(sDN);
group.setName(sName);
user.getGroups().add(group);
}
}
}