portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r409663 - in /portals/jetspeed-2/trunk: applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/ components/security/src/java/org/apache/jetspeed/security/impl/ jetspeed-api/src/java/org/apache/jetspeed/security/
Date Fri, 26 May 2006 12:51:43 GMT
Author: ate
Date: Fri May 26 05:51:42 2006
New Revision: 409663

URL: http://svn.apache.org/viewvc?rev=409663&view=rev
Log:
Big performance improvement for the UserBrowser when managing large amounts (1000+) of users
by only requesting user names from the UserManager as (currently) no more is needed.
Note: we *do* need to look at improving performance more generally as this is just an isolated
(and simple) case. 

Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/UserBrowser.java
    portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/security/UserManager.java

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/UserBrowser.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/UserBrowser.java?rev=409663&r1=409662&r2=409663&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/UserBrowser.java
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/users/UserBrowser.java
Fri May 26 05:51:42 2006
@@ -145,13 +145,11 @@
         List list = new ArrayList();
         try
         {
-            Iterator users = userManager.getUsers(filter);
+            Iterator users = userManager.getUserNames(filter);
 
             while (users.hasNext())
             {
-                User user = (User)users.next();
-                Principal principal = SecurityUtil.getPrincipal(user.getSubject(),UserPrincipal.class);
               
-                list.add(principal.getName());
+                list.add(users.next());
             }            
         }
         catch (SecurityException sex)

Modified: portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java?rev=409663&r1=409662&r2=409663&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
Fri May 26 05:51:42 2006
@@ -381,6 +381,20 @@
     }
 
     /**
+     * @see org.apache.jetspeed.security.UserManager#getUserNames(java.lang.String)
+     */
+    public Iterator getUserNames(String filter) throws SecurityException
+    {
+        List usernames = new LinkedList();
+        Iterator userPrincipals = atnProviderProxy.getUserPrincipals(filter).iterator();
+        while (userPrincipals.hasNext())
+        {
+            usernames.add(((Principal) userPrincipals.next()).getName());
+        }
+        return usernames.iterator();
+    }
+
+    /**
      * @see org.apache.jetspeed.security.UserManager#getUsersInRole(java.lang.String)
      */
     public Collection getUsersInRole(String roleFullPathName)

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/security/UserManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/security/UserManager.java?rev=409663&r1=409662&r2=409663&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/security/UserManager.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/security/UserManager.java
Fri May 26 05:51:42 2006
@@ -108,16 +108,24 @@
      * An iterator of {@link User}finding users matching the corresponding
      * filter criteria.
      * </p>
+     * TODO Complete filter implementation.
+     * 
+     * @param filter The filter used to retrieve matching users.
+     * @return The Iterator of {@link User}.
+     */
+    Iterator getUsers(String filter) throws SecurityException;
+
+    /**
      * <p>
-     * Current implementation only allows for getting back all users with "" as
-     * a fitler.
+     * An iterator of user names, finding users matching the corresponding
+     * filter criteria.
      * </p>
      * TODO Complete filter implementation.
      * 
      * @param filter The filter used to retrieve matching users.
      * @return The Iterator of {@link User}.
      */
-    Iterator getUsers(String filter) throws SecurityException;
+    Iterator getUserNames(String filter) throws SecurityException;
 
     /**
      * <p>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message