archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1551100 - in /archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src: main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java test/java/org/apache/archiva/web/rss/SecuritySystemStub.java
Date Mon, 16 Dec 2013 01:26:30 GMT
Author: olamy
Date: Mon Dec 16 01:26:30 2013
New Revision: 1551100

URL: http://svn.apache.org/r1551100
Log:
implements findUser with useCache method

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java?rev=1551100&r1=1551099&r2=1551100&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
Mon Dec 16 01:26:30 2013
@@ -188,12 +188,12 @@ public class ArchivaConfigurableUsersMan
         }
     }
 
-    public User findUser( String username )
-        throws UserManagerException
+    @Override
+    public User findUser( String username, boolean useCache )
+        throws UserNotFoundException, UserManagerException
     {
-
         User user = null;
-        if ( useUsersCache() )
+        if ( useUsersCache() && useCache )
         {
             user = usersCache.get( username );
             if ( user != null )
@@ -242,6 +242,12 @@ public class ArchivaConfigurableUsersMan
         return user;
     }
 
+    public User findUser( String username )
+        throws UserManagerException
+    {
+        return findUser( username, useUsersCache() );
+    }
+
 
     @Override
     public User getGuestUser()
@@ -365,7 +371,10 @@ public class ArchivaConfigurableUsersMan
     public User updateUser( User user )
         throws UserNotFoundException, UserManagerException
     {
-        user = userManagerPerId.get( user.getUserManagerId() ).updateUser( user );
+
+        UserManager userManager = userManagerPerId.get( user.getUserManagerId() );
+
+        user = userManager.updateUser( user );
 
         if ( useUsersCache() )
         {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java?rev=1551100&r1=1551099&r2=1551100&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java
Mon Dec 16 01:26:30 2013
@@ -32,6 +32,7 @@ import org.apache.archiva.redback.system
 import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
+import org.apache.archiva.redback.users.UserManagerException;
 import org.apache.archiva.redback.users.UserManagerListener;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.users.UserQuery;
@@ -359,6 +360,13 @@ public class SecuritySystemStub
                 return null;  //To change body of implemented methods use File | Settings
| File Templates.
             }
 
+            @Override
+            public User findUser( String username, boolean useCache )
+                throws UserNotFoundException, UserManagerException
+            {
+                return null;
+            }
+
             public User getGuestUser()
                 throws UserNotFoundException
             {



Mime
View raw message