private Map getUsers() throws NamingException {

        String filter = "(" + roleNameRDN + "=*)";

        HashMap users = new HashMap();

        NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
        while (results != null && results.hasMore()) {

            SearchResult roleResult = (SearchResult) results.next();

            String roleResultName = roleResult.getName();
            if ("".equals(roleResultName)) {
                continue;
            }

            String roleResultValue = (roleResultName.split("="))[1];

            Attributes roleAttrs = roleResult.getAttributes();

            Attribute roleAttr = roleAttrs.get(roleMemberRDN);
            NamingEnumeration valueEnum = roleAttr.getAll();
            while (valueEnum != null && valueEnum.hasMore()) {
                String value = (String) valueEnum.next();

                String name;
                if (value.endsWith("," + userBase)) {
                    name = value.substring(0, value.length() - userBase.length() - 1);
                    name = name.split("=")[1];
                } else {
                    logger.debug("found unrecognized DN: " + value);
                    continue;
                }

                if (users.containsKey(name)) {
                    HashSet roles = (HashSet) users.get(name);
                    roles.add(roleResultValue);
                } else {
                    HashSet roles = new HashSet();
                    roles.add(roleResultValue);
                    users.put(name, roles);
                }
            }
        }
        return users;

    }