portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r694737 - /portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/
Date Fri, 12 Sep 2008 16:51:19 GMT
Author: vkumar
Date: Fri Sep 12 09:51:19 2008
New Revision: 694737

URL: http://svn.apache.org/viewvc?rev=694737&view=rev
Log:
Removing circular dependencies from managers

Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java?rev=694737&r1=694736&r2=694737&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/BaseJetspeedPrincipalManager.java
Fri Sep 12 09:51:19 2008
@@ -27,6 +27,7 @@
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationHandler;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationReference;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationType;
+import org.apache.jetspeed.security.JetspeedPrincipalManagerProvider;
 import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.PrincipalAlreadyExistsException;
 import org.apache.jetspeed.security.PrincipalAssociationNotAllowedException;
@@ -82,7 +83,8 @@
     private Map<AssociationHandlerKey, JetspeedPrincipalAssociationType> reqAssociations
= new HashMap<AssociationHandlerKey, JetspeedPrincipalAssociationType>();
     private JetspeedPrincipalAccessManager jpam;
     private JetspeedPrincipalStorageManager jpsm;
-
+    //added for removing circular dependciese
+    protected static JetspeedPrincipalManagerProvider jpmp;
     public BaseJetspeedPrincipalManager(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager
jpam,
                                         JetspeedPrincipalStorageManager jpsm)
     {
@@ -102,7 +104,17 @@
             throw new IllegalArgumentException("Principal is transient");
         }
     }
-
+    
+    public static void setJetspeedPrincipalManagerProvider(JetspeedPrincipalManagerProvider
Jpmp)
+    {
+    	jpmp = Jpmp;
+    }
+    
+    protected JetspeedPrincipalManagerProvider getJetspeedPrincipalManagerProvider()
+    {
+    	return jpmp;
+    }
+    
     public final JetspeedPrincipalType getPrincipalType()
     {
         return principalType;

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java?rev=694737&r1=694736&r2=694737&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
Fri Sep 12 09:51:19 2008
@@ -34,6 +34,7 @@
 import org.apache.jetspeed.security.PrincipalNotRemovableException;
 import org.apache.jetspeed.security.PrincipalReadOnlyException;
 import org.apache.jetspeed.security.PrincipalUpdateException;
+import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
@@ -74,11 +75,10 @@
         this.userType = userType;
         this.roleType = roleType;
     }
-    
-    public void setUserManager(UserManager manager)
-    {
-    	this.userManager = manager;
-    }
+    public void init()
+    {    	
+    	userManager = (UserManager)getJetspeedPrincipalManagerProvider().getManager(userType);
+    }      
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.security.GroupManager#newGroup(java.lang.String, boolean)

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java?rev=694737&r1=694736&r2=694737&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
Fri Sep 12 09:51:19 2008
@@ -79,7 +79,11 @@
         this.userType = userType;
         this.groupType = groupType;
     }
-    
+    public void init()
+    {    	
+    	userManager = (UserManager)getJetspeedPrincipalManagerProvider().getManager(userType);
+    	groupManager = (GroupManager)getJetspeedPrincipalManagerProvider().getManager(groupType);
+    }
     public void setUserManager(UserManager manager)
     {
     	this.userManager = manager;

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java?rev=694737&r1=694736&r2=694737&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
Fri Sep 12 09:51:19 2008
@@ -31,6 +31,7 @@
 import org.apache.jetspeed.security.GroupManager;
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationType;
+import org.apache.jetspeed.security.JetspeedPrincipalManager;
 import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.JetspeedSubjectFactory;
 import org.apache.jetspeed.security.PasswordCredential;
@@ -81,16 +82,12 @@
 		this.groupType = groupType;
 	}
 
-    public void setGroupManager(GroupManager manager)
-    {
-    	this.groupManager = manager;
+    public void init()
+    {    	
+    	groupManager = (GroupManager)getJetspeedPrincipalManagerProvider().getManager(groupType);
+    	roleManager = (RoleManager)getJetspeedPrincipalManagerProvider().getManager(roleType);

     }
-    
-    public void setRoleManager(RoleManager manager)
-    {
-    	this.roleManager = manager;
-    }
-    
+       
 	public User addUser(String username) throws SecurityException
 	{
 	    return addUser(username, true);



---------------------------------------------------------------------
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