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 at...@apache.org on 2008/09/12 12:20:36 UTC

svn commit: r694672 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/ components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/ components/jet...

Author: ate
Date: Fri Sep 12 03:20:34 2008
New Revision: 694672

URL: http://svn.apache.org/viewvc?rev=694672&view=rev
Log:
- added missing association handling methods to JetspeedPrincipalManager
- added getManagerFrom/To to AssociationHandler
- added associationHandler registering at manager
- added logic to allow passing in transient principals for creating an association: they will be looked up first then 

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/spi/JetspeedPrincipalAssociationStorageManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPrincipalAssociationHandler.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/SimpleMemberOfPrincipalAssociationHandler.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.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=694672&r1=694671&r2=694672&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 03:20:34 2008
@@ -254,11 +254,11 @@
             {
                 if (ref.type == JetspeedPrincipalAssociationReference.Type.FROM)
                 {
-                    addAssociation(ref.associationName, ref.ref, principal);
+                    addAssociation(ref.ref, principal, ref.associationName);
                 }
                 else
                 {
-                    addAssociation(ref.associationName, principal, ref.ref);
+                    addAssociation(principal, ref.ref, ref.associationName);
                 }
             }
         }
@@ -296,7 +296,7 @@
     //
     // JetspeedPrincipalAssociationHandler interface invocations
     //
-    public void addAssociation(String associationName, JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException, PrincipalAssociationNotAllowedException, PrincipalAssociationUnsupportedException
+    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws PrincipalNotFoundException, PrincipalAssociationNotAllowedException, PrincipalAssociationUnsupportedException
     {
         AssociationHandlerKey key = new AssociationHandlerKey(associationName, from.getType().getName(), to.getType().getName());        
         JetspeedPrincipalAssociationHandler jpah = assHandlers.get(key);
@@ -305,11 +305,26 @@
         {
             throw new PrincipalAssociationNotAllowedException();
         }
-        
+        if (from.isTransient() || from.getId() == null)
+        {
+            from = jpah.getManagerFrom().getPrincipal(from.getName());
+        }
+        if (from == null)
+        {
+            throw new PrincipalNotFoundException();
+        }
+        if (to.isTransient() || to.getId() == null)
+        {
+            to = jpah.getManagerTo().getPrincipal(to.getName());
+        }
+        if (to == null)
+        {
+            throw new PrincipalNotFoundException();
+        }
         jpah.add(from, to);
     }
 
-    public void removeAssociation(String associationName, JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalAssociationRequiredException
+    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws PrincipalAssociationRequiredException, PrincipalNotFoundException
     {
         AssociationHandlerKey key = new AssociationHandlerKey(associationName, from.getType().getName(), to.getType().getName());
         JetspeedPrincipalAssociationHandler jpah = assHandlers.get(key);
@@ -320,6 +335,22 @@
             {
                 throw new PrincipalAssociationRequiredException();
             }
+            if (from.isTransient() || from.getId() == null)
+            {
+                from = jpah.getManagerFrom().getPrincipal(from.getName());
+            }
+            if (from == null)
+            {
+                throw new PrincipalNotFoundException();
+            }
+            if (to.isTransient() || to.getId() == null)
+            {
+                to = jpah.getManagerTo().getPrincipal(to.getName());
+            }
+            if (to == null)
+            {
+                throw new PrincipalNotFoundException();
+            }
             jpah.remove(from, to);
         }
     }

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=694672&r1=694671&r2=694672&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 03:20:34 2008
@@ -219,12 +219,21 @@
         try
         {
             User user = userManager.getUser(username);
+            if (user == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER_TYPE_NAME, username));
+            }
             Group group = getGroup(groupName);
-            super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, group);
+            if (group == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
+            }
+            super.addAssociation(user, group, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalNotFoundException e)
         {
-            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
         } 
         catch (PrincipalAssociationNotAllowedException e)
         {
@@ -246,13 +255,26 @@
         try
         {
             User user = userManager.getUser(username);
+            if (user == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER_TYPE_NAME, username));
+            }
             Group group = getGroup(groupName);
-            super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, group);
+            if (group == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
+            }
+            super.removeAssociation(user, group, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalAssociationRequiredException e)
         {
             throw new SecurityException(SecurityException.PRINCIPAL_ASSOCIATION_REQUIRED.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
         }
+        catch (PrincipalNotFoundException e)
+        {
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
+        }
     }
 
     /**

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=694672&r1=694671&r2=694672&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 03:20:34 2008
@@ -226,12 +226,21 @@
         try
         {
             User user = userManager.getUser(username);
+            if (user == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER_TYPE_NAME, username));
+            }
             Role role = getRole(roleName);
-            super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, role);
+            if (role == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            }
+            super.addAssociation(user, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalNotFoundException e)
         {
-            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
         } 
         catch (PrincipalAssociationNotAllowedException e)
         {
@@ -252,13 +261,26 @@
         try
         {
             User user = userManager.getUser(username);
+            if (user == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER_TYPE_NAME, username));
+            }
             Role role = getRole(roleName);
-            super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, user, role);
+            if (role == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            }
+            super.removeAssociation(user, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalAssociationRequiredException e)
         {
             throw new SecurityException(SecurityException.PRINCIPAL_ASSOCIATION_REQUIRED.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
         }
+        catch (PrincipalNotFoundException e)
+        {
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
+        } 
     }
 
     /**
@@ -279,12 +301,21 @@
         try
         {
             Group group = groupManager.getGroup(groupName);
+            if (group == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
+            }
             Role role = getRole(roleName);
-            super.addAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, group, role);
+            if (role == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            }
+            super.addAssociation(group, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalNotFoundException e)
         {
-            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
         } 
         catch (PrincipalAssociationNotAllowedException e)
         {
@@ -305,13 +336,26 @@
         try
         {
             Group group = groupManager.getGroup(groupName);
+            if (group == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP_TYPE_NAME, groupName));
+            }
             Role role = getRole(roleName);
-            super.removeAssociation(JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME, group, role);
+            if (role == null)
+            {
+                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
+            }
+            super.removeAssociation(group, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF_ASSOCIATION_TYPE_NAME);
         } 
         catch (PrincipalAssociationRequiredException e)
         {
             throw new SecurityException(SecurityException.PRINCIPAL_ASSOCIATION_REQUIRED.createScoped(JetspeedPrincipalType.ROLE_TYPE_NAME, roleName));
         }
+        catch (PrincipalNotFoundException e)
+        {
+            // TODO: determine *which* principal does not exist to provide the correct error message...
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST);
+        } 
     }
 
     /**

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java?rev=694672&r1=694671&r2=694672&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java Fri Sep 12 03:20:34 2008
@@ -31,5 +31,5 @@
         throws PrincipalNotFoundException, PrincipalAssociationUnsupportedException, PrincipalAssociationNotAllowedException;
 
     void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
-        throws PrincipalAssociationRequiredException;
+        throws PrincipalAssociationRequiredException, PrincipalNotFoundException;
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPrincipalAssociationHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPrincipalAssociationHandler.java?rev=694672&r1=694671&r2=694672&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPrincipalAssociationHandler.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPrincipalAssociationHandler.java Fri Sep 12 03:20:34 2008
@@ -20,11 +20,13 @@
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationHandler;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationType;
+import org.apache.jetspeed.security.JetspeedPrincipalManager;
 import org.apache.jetspeed.security.PrincipalAssociationNotAllowedException;
 import org.apache.jetspeed.security.PrincipalAssociationRequiredException;
 import org.apache.jetspeed.security.PrincipalAssociationUnsupportedException;
 import org.apache.jetspeed.security.PrincipalNotFoundException;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager;
+import org.apache.jetspeed.security.spi.JetspeedPrincipalManagerSPI;
 
 /**
  * @version $Id$
@@ -35,13 +37,22 @@
     private JetspeedPrincipalAssociationType associationType;
     private JetspeedPrincipalAssociationStorageManager jpasm;
 
+    private JetspeedPrincipalManagerSPI from;
+    private JetspeedPrincipalManagerSPI to;
     
-    
-    public BaseJetspeedPrincipalAssociationHandler(JetspeedPrincipalAssociationType associationType,
-                                                   JetspeedPrincipalAssociationStorageManager jpasm)
+    public BaseJetspeedPrincipalAssociationHandler(JetspeedPrincipalAssociationType associationType, JetspeedPrincipalManagerSPI from, JetspeedPrincipalManagerSPI to, JetspeedPrincipalAssociationStorageManager jpasm)
     {
         this.associationType = associationType;
+        this.from = from;
+        this.to = to;
         this.jpasm = jpasm;
+        if (!associationType.getFromPrincipalType().getName().equals(from.getPrincipalType().getName()) ||
+                        !associationType.getToPrincipalType().getName().equals(to.getPrincipalType().getName()))
+        {
+            throw new IllegalArgumentException("Provided ManagerFrom or ManagerTo PrincipalType do not correspond with the AssociationType");
+        }
+        from.addAssociationHandler(this);
+        to.addAssociationHandler(this);
     }
 
     public void add(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException,
@@ -57,8 +68,18 @@
     {
         return associationType;
     }
+    
+    public JetspeedPrincipalManager getManagerFrom()
+    {
+        return from;
+    }
+    
+    public JetspeedPrincipalManager getManagerTo()
+    {
+        return to;
+    }
 
-    public void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalAssociationRequiredException
+    public void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalAssociationRequiredException, PrincipalNotFoundException
     {
         if (from.getType().equals(associationType.getFromPrincipalType()) && to.getType().equals(associationType.getToPrincipalType()))
         {

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/SimpleMemberOfPrincipalAssociationHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/SimpleMemberOfPrincipalAssociationHandler.java?rev=694672&r1=694671&r2=694672&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/SimpleMemberOfPrincipalAssociationHandler.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/SimpleMemberOfPrincipalAssociationHandler.java Fri Sep 12 03:20:34 2008
@@ -20,10 +20,10 @@
 import org.apache.jetspeed.security.DependentPrincipalException;
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationType;
-import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.PrincipalNotRemovableException;
 import org.apache.jetspeed.security.impl.JetspeedPrincipalAssociationTypeImpl;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager;
+import org.apache.jetspeed.security.spi.JetspeedPrincipalManagerSPI;
 
 /**
  * @version $Id$
@@ -31,14 +31,14 @@
  */
 public class SimpleMemberOfPrincipalAssociationHandler extends BaseJetspeedPrincipalAssociationHandler
 {
-    public SimpleMemberOfPrincipalAssociationHandler(JetspeedPrincipalAssociationType associationType, JetspeedPrincipalAssociationStorageManager jpasm)
+    public SimpleMemberOfPrincipalAssociationHandler(JetspeedPrincipalAssociationType associationType, JetspeedPrincipalManagerSPI from, JetspeedPrincipalManagerSPI to, JetspeedPrincipalAssociationStorageManager jpasm)
     {
-        super(associationType, jpasm);
+        super(associationType, from, to, jpasm);
     }
     
-    public SimpleMemberOfPrincipalAssociationHandler(String associationName, JetspeedPrincipalType fromType,JetspeedPrincipalType toType, boolean required, JetspeedPrincipalAssociationStorageManager jpasm)
+    public SimpleMemberOfPrincipalAssociationHandler(String associationName, JetspeedPrincipalManagerSPI from,JetspeedPrincipalManagerSPI to, boolean required, JetspeedPrincipalAssociationStorageManager jpasm)
     {
-        this(new JetspeedPrincipalAssociationTypeImpl(associationName, fromType, toType, required), jpasm);
+        this(new JetspeedPrincipalAssociationTypeImpl(associationName, from.getPrincipalType(), to.getPrincipalType(), required), from, to, jpasm);
     }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java?rev=694672&r1=694671&r2=694672&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java Fri Sep 12 03:20:34 2008
@@ -22,10 +22,12 @@
 public interface JetspeedPrincipalAssociationHandler
 {
     JetspeedPrincipalAssociationType getAssociationType();
+    JetspeedPrincipalManager getManagerFrom();
+    JetspeedPrincipalManager getManagerTo();
 
     void add(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException, PrincipalAssociationNotAllowedException, PrincipalAssociationUnsupportedException;
 
-    void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalAssociationRequiredException;
+    void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalAssociationRequiredException, PrincipalNotFoundException;
 
     /**
      * <p>

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.java?rev=694672&r1=694671&r2=694672&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.java Fri Sep 12 03:20:34 2008
@@ -114,4 +114,10 @@
 
     void removePrincipal(JetspeedPrincipal principal)
         throws PrincipalNotFoundException, PrincipalNotRemovableException, DependentPrincipalException;
+
+    void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
+        throws PrincipalNotFoundException, PrincipalAssociationUnsupportedException, PrincipalAssociationNotAllowedException;
+
+    void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
+        throws PrincipalAssociationRequiredException, PrincipalNotFoundException;
 }



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