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