userSearchConfig.setLdapIdAttribute("uid");
userSearchConfig.setAttributeDefinitions(userAttrDefs);
userSearchConfig.setEntityType("user");
userSearchConfig.setObjectClasses("inetOrgPerson,organizationalPerson,person,top");
SpringLDAPEntityDAO userDAO = new SpringLDAPEntityDAO(userSearchConfig);
userDAO.setLdapTemplate(ldapTemplate);
// setting up role DAO
roleAttrDefs = new HashSet<AttributeDef>();
roleAttrDefs.addAll(basicAttrDefs);
roleAttrDefs.add(DESCRIPTION_ATTR_DEF);
LDAPEntityDAOConfiguration roleSearchConfig = new LDAPEntityDAOConfiguration();
roleSearchConfig.setBaseDN("o=sevenSeas");
roleSearchConfig.setSearchDN("ou=Roles,o=Jetspeed");
roleSearchConfig.setSearchFilter(new SimpleFilter(
"(objectClass=groupOfUniqueNames)"));
roleSearchConfig.setLdapIdAttribute("cn");
roleSearchConfig.setAttributeDefinitions(roleAttrDefs);
roleSearchConfig.setEntityType("role");
roleSearchConfig.setObjectClasses("groupOfUniqueNames,extensibleObject");
SpringLDAPEntityDAO roleDAO = new SpringLDAPEntityDAO(roleSearchConfig);
roleDAO.setLdapTemplate(ldapTemplate);
groupAttrDefs = new HashSet<AttributeDef>();
groupAttrDefs.addAll(basicAttrDefs);
groupAttrDefs.add(DESCRIPTION_ATTR_DEF);
groupAttrDefs.add(UNIQUEMEMBER_ATTR_DEF);
LDAPEntityDAOConfiguration groupSearchConfig = new LDAPEntityDAOConfiguration();
groupSearchConfig.setBaseDN("o=sevenSeas");
groupSearchConfig.setSearchDN("ou=Groups,o=Jetspeed");
groupSearchConfig.setSearchFilter(new SimpleFilter(
"(objectClass=groupOfUniqueNames)"));
groupSearchConfig.setLdapIdAttribute("cn");
groupSearchConfig.setAttributeDefinitions(groupAttrDefs);
groupSearchConfig.setEntityType("group");
groupSearchConfig.setObjectClasses("groupOfUniqueNames,extensibleObject");
SpringLDAPEntityDAO groupDAO = new SpringLDAPEntityDAO(groupSearchConfig);
groupDAO.setLdapTemplate(ldapTemplate);
Map<String, EntityDAO> daos = new HashMap<String, EntityDAO>();
daos.put("user", userDAO);
daos.put("role", roleDAO);