LDAPResultSet getList(String attrName)
Brought to you by:
pavelsavin
Add this method to retrieve by name instead of number:
// getList by attribute name
public List getList(String attrName) throws DAOException {
try {
ArrayList list = new ArrayList();
Attribute attr = attrs.get(attrName);
if(attr != null){
NamingEnumeration en = attr.getAll();
while(en.hasMore()) {
String val = (String) en.next();
list.add(val);
}
}
return list;
}
catch(NamingException ex) {
throw new DAOException(ex);
}
}