You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/09/16 00:39:51 UTC
cvs commit: jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl UserManagerImpl.java
taylor 2004/09/15 15:39:51
Modified: components/security/src/java/org/apache/jetspeed/security/impl
UserManagerImpl.java
Log:
implemented getUsers
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.8 +17 -3 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
Index: UserManagerImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- UserManagerImpl.java 16 Jul 2004 19:31:51 -0000 1.7
+++ UserManagerImpl.java 15 Sep 2004 22:39:51 -0000 1.8
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
@@ -231,8 +232,21 @@
*/
public Iterator getUsers(String filter)
{
- throw new UnsupportedOperationException("getUsers no implemented yet.");
- // return null;
+ Collection users = new LinkedList();
+ PersistenceStore store = getPersistenceStore();
+ Iterator result = store.getExtent(JetspeedUserPrincipalImpl.class).iterator();
+ while (result.hasNext())
+ {
+ JetspeedUserPrincipal omUser = (JetspeedUserPrincipal)result.next();
+ String path = omUser.getFullPath();
+ if (path == null || !path.startsWith("/user")) // TODO: FIXME: the extend shouldn't return roles!
+ {
+ continue;
+ }
+ User user = super.getUser(omUser);
+ users.add(user);
+ }
+ return users.iterator();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org