- @Override
- public Role createRole(String name, int type) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean removeRole(String name) {
- throw new UnsupportedOperationException();
+ @SuppressWarnings("unchecked")
+ protected List<DirectoryUser> doGetRoles(Filter f) {
+ ArrayList<DirectoryUser> res = new ArrayList<DirectoryUser>();
+ if (f == null) {
+ res.addAll(users.values());
+ res.addAll(groups.values());
+ } else {
+ for (DirectoryUser user : users.values()) {
+ // System.out.println("\n" + user.getName());
+ // Dictionary<String, Object> props = user.getProperties();
+ // for (Enumeration<String> keys = props.keys(); keys
+ // .hasMoreElements();) {
+ // String key = keys.nextElement();
+ // System.out.println(" " + key + "=" + props.get(key));
+ // }
+ if (f.match(user.getProperties()))
+ res.add(user);
+ }
+ for (DirectoryUser group : groups.values())
+ if (f.match(group.getProperties()))
+ res.add(group);
+ }
+ return res;