portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r692544 - 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/impl/ jetspeed-...
Date Fri, 05 Sep 2008 20:46:23 GMT
Author: ate
Date: Fri Sep  5 13:46:23 2008
New Revision: 692544

URL: http://svn.apache.org/viewvc?rev=692544&view=rev
Log:
Have to roll back the Generics solution from Woonsan as OJB doesn't support it anyway
and the JetspeedPrincipalAccessManager is intended to be instantiated only once (JetspeedSecurityAccessManager)
so templating it for each JetspeedPrincipal type isn't possible either.
Sorry Woonsan for having to do this: really my fault for not better explaining what the requirements
and usages here ...

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/impl/JetspeedSecurityPersistenceManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAccessManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalManagerSPI.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=692544&r1=692543&r2=692544&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  5 13:46:23 2008
@@ -43,7 +43,7 @@
 /**
  * @version $Id$
  */
-public abstract class BaseJetspeedPrincipalManager<T extends JetspeedPrincipal> implements
JetspeedPrincipalManagerSPI<T>
+public abstract class BaseJetspeedPrincipalManager implements JetspeedPrincipalManagerSPI
 {
     private static class AssociationHandlerKey
     {
@@ -80,11 +80,11 @@
     private JetspeedPrincipalType principalType;
     private Map<AssociationHandlerKey, JetspeedPrincipalAssociationHandler> assHandlers
= new HashMap<AssociationHandlerKey, JetspeedPrincipalAssociationHandler>();
     private Map<AssociationHandlerKey, JetspeedPrincipalAssociationType> reqAssociations
= new HashMap<AssociationHandlerKey, JetspeedPrincipalAssociationType>();
-    private JetspeedPrincipalAccessManager<T> jpam;
+    private JetspeedPrincipalAccessManager jpam;
     private JetspeedPrincipalStorageManager jpsm;
     private JetspeedPrincipalPermissionStorageManager jppsm;
 
-    public BaseJetspeedPrincipalManager(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager<T>
jpam,
+    public BaseJetspeedPrincipalManager(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager
jpam,
                                         JetspeedPrincipalStorageManager jpsm,
                                         JetspeedPrincipalPermissionStorageManager jppsm)
     {
@@ -116,7 +116,7 @@
         return jpam.principalExists(name, principalType);
     }
 
-    public T getPrincipal(String name)
+    public JetspeedPrincipal getPrincipal(String name)
     {
         return jpam.getPrincipal(name, principalType);
     }
@@ -126,12 +126,12 @@
         return jpam.getPrincipalNames(nameFilter, principalType);
     }
 
-    public List<T> getPrincipals(String nameFilter)
+    public List<JetspeedPrincipal> getPrincipals(String nameFilter)
     {
         return jpam.getPrincipals(nameFilter, principalType);
     }
 
-    public List<T> getPrincipalsByAttribute(String attributeName, String attributeValue)
+    public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String
attributeValue)
     {
         return jpam.getPrincipalsByAttribute(attributeName, attributeValue, principalType);
     }
@@ -145,7 +145,7 @@
         jpsm.removePrincipal(principal);
     }
 
-    public final List<T> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, String associationName)
+    public final List<JetspeedPrincipal> getAssociatedFrom(String principalFromName,
JetspeedPrincipalType from, String associationName)
     {
         if ( !assHandlers.containsKey(new AssociationHandlerKey(from.getName(), principalType.getName(),
associationName)))
         {
@@ -175,7 +175,7 @@
         return jpam.getAssociatedNamesTo(principalToName, principalType, to, associationName);
     }
 
-    public final List<T> getAssociatedTo(String principalToName, JetspeedPrincipalType
to, String associationName)
+    public final List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
to, String associationName)
     {
         if ( !assHandlers.containsKey(new AssociationHandlerKey(principalType.getName(),
to.getName(), associationName)))
         {

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=692544&r1=692543&r2=692544&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  5 13:46:23 2008
@@ -16,12 +16,15 @@
  */
 package org.apache.jetspeed.security.impl;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.security.Group;
 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;
@@ -56,7 +59,7 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class GroupManagerImpl extends BaseJetspeedPrincipalManager<Group> implements
GroupManager
+public class GroupManagerImpl extends BaseJetspeedPrincipalManager implements GroupManager
 {
 
     /** The logger. */
@@ -66,8 +69,8 @@
     private JetspeedPrincipalType roleType;
     private UserManager userManager;
     
-    public GroupManagerImpl(JetspeedPrincipalType principalType,
-                           JetspeedPrincipalAccessManager<Group> jpam, JetspeedPrincipalStorageManager
jpsm,
+    public GroupManagerImpl(JetspeedPrincipalType principalType, 
+                           JetspeedPrincipalAccessManager jpam, JetspeedPrincipalStorageManager
jpsm,
                            JetspeedPrincipalPermissionStorageManager jppsm,
                            UserManager userManager, RoleManager roleManager)
     {
@@ -171,7 +174,12 @@
     public Collection<Group> getGroupsForUser(String username)
             throws SecurityException
     {
-        return super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
+        ArrayList<Group> groups = new ArrayList<Group>();
+        for (JetspeedPrincipal principal : super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF))
+        {
+            groups.add((Group)principal);
+        }
+        return groups;
     }
 
     /**
@@ -180,7 +188,12 @@
     public Collection<Group> getGroupsInRole(String roleName)
             throws SecurityException
     {
-        return super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF);
+        ArrayList<Group> groups = new ArrayList<Group>();
+        for (JetspeedPrincipal principal : super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF))
+        {
+            groups.add((Group)principal);
+        }
+        return groups;
     }
 
     /**
@@ -244,7 +257,15 @@
      */
     public Collection<Group> getGroups(String filter) throws SecurityException
     {
-        return super.getPrincipals(filter);
+        Collection<Group> groups = new ArrayList<Group>();
+        List<JetspeedPrincipal> principals = super.getPrincipals(filter);
+        
+        for (JetspeedPrincipal principal : principals)
+        {
+            groups.add((Group) principal);
+        }
+        
+        return groups;
     }
     
     /**
@@ -283,12 +304,12 @@
         }
     }
 
-    public Group newPrincipal(String name, boolean mapped)
+    public JetspeedPrincipal newPrincipal(String name, boolean mapped)
     {
         return newGroup(name, mapped);
     }
 
-    public Group newTransientPrincipal(String name)
+    public JetspeedPrincipal newTransientPrincipal(String name)
     {
         return newTransientGroup(name);
     }

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=692544&r1=692543&r2=692544&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  5 13:46:23 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.security.impl;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.prefs.Preferences;
@@ -24,6 +25,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.security.Group;
 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;
@@ -61,7 +63,7 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class RoleManagerImpl extends BaseJetspeedPrincipalManager<Role> implements
RoleManager
+public class RoleManagerImpl extends BaseJetspeedPrincipalManager implements RoleManager
 {
     /** The logger. */
     private static final Log log = LogFactory.getLog(RoleManagerImpl.class);
@@ -72,7 +74,7 @@
     private GroupManager groupManager;
     
     public RoleManagerImpl(JetspeedPrincipalType principalType, 
-                           JetspeedPrincipalAccessManager<Role> jpam, JetspeedPrincipalStorageManager
jpsm,
+                           JetspeedPrincipalAccessManager jpam, JetspeedPrincipalStorageManager
jpsm,
                            JetspeedPrincipalPermissionStorageManager jppsm,
                            UserManager userManager, GroupManager groupManager)
     {
@@ -177,7 +179,12 @@
      */
     public List<Role> getRolesForUser(String username) throws SecurityException
     {
-        return super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
+        ArrayList<Role> roles = new ArrayList<Role>();
+        for (JetspeedPrincipal principal : super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF))
+        {
+            roles.add((Role)principal);
+        }
+        return roles;
     }
 
     /**
@@ -185,7 +192,12 @@
      */
     public List<Role> getRolesInGroup(String groupName) throws SecurityException
     {
-        return super.getAssociatedFrom(groupName, groupType, JetspeedPrincipalAssociationType.IS_PART_OF);
+        ArrayList<Role> roles = new ArrayList<Role>();
+        for (JetspeedPrincipal principal : super.getAssociatedFrom(groupName, groupType,
JetspeedPrincipalAssociationType.IS_PART_OF))
+        {
+            roles.add((Role)principal);
+        }
+        return roles;
     }
 
     /**
@@ -299,7 +311,15 @@
      */
     public Collection<Role> getRoles(String filter) throws SecurityException
     {
-        return super.getPrincipals(filter);
+        Collection<Role> roles = new ArrayList<Role>();
+        List<JetspeedPrincipal> principals = super.getPrincipals(filter);
+        
+        for (JetspeedPrincipal principal : principals)
+        {
+            roles.add((Role) principal);
+        }
+        
+        return roles;
     }
 
     /** 
@@ -341,7 +361,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.security.JetspeedPrincipalManager#newPrincipal(java.lang.String,
boolean)
      */
-    public Role newPrincipal(String name, boolean mapped)
+    public JetspeedPrincipal newPrincipal(String name, boolean mapped)
     {
         return newRole(name, mapped);
     }
@@ -349,7 +369,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.security.JetspeedPrincipalManager#newTransientPrincipal(java.lang.String)
      */
-    public Role newTransientPrincipal(String name)
+    public JetspeedPrincipal newTransientPrincipal(String name)
     {
         return newTransientRole(name);
     }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.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/JetspeedSecurityPersistenceManager.java?rev=692544&r1=692543&r2=692544&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
Fri Sep  5 13:46:23 2008
@@ -43,136 +43,118 @@
 /**
  * @version $Id$
  */
-public class JetspeedSecurityPersistenceManager<T extends JetspeedPrincipal> implements
JetspeedPrincipalAccessManager<T>,
+public class JetspeedSecurityPersistenceManager implements JetspeedPrincipalAccessManager,
                 JetspeedPrincipalStorageManager, UserPasswordCredentialStorageManager,
                 JetspeedPrincipalAssociationStorageManager, JetspeedPrincipalPermissionStorageManager,
                 JetspeedPermissionStorageManager
 {
-
-    public List<T> getAssociatedFrom(String principalFromName,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    //
+    // JetspeedPrincipalAccessManager interface implementation
+    //
+    public List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<T> getAssociatedFrom(Long principalFromId,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getAssociatedNamesFrom(String principalFromName,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getAssociatedNamesFrom(Long principalFromId,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getAssociatedNamesTo(String principalToName,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getAssociatedNamesTo(Long principalToId,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<T> getAssociatedTo(String principalToName,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<T> getAssociatedTo(Long principalToId,
-            JetspeedPrincipalType from, JetspeedPrincipalType to,
-            String associationName)
+    public List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public T getPrincipal(Long id)
+    public JetspeedPrincipal getPrincipal(Long id)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public T getPrincipal(String principalName, JetspeedPrincipalType type)
+    public JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getPrincipalNames(String nameFilter,
-            JetspeedPrincipalType type)
+    public List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType
type)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<T> getPrincipals(String nameFilter, JetspeedPrincipalType type)
+    public List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType
type)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getPrincipals(JetspeedPermission permission)
+    public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String
attributeValue, JetspeedPrincipalType type)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getPrincipals(JetspeedPermission permission,
-            JetspeedPrincipalType type)
+    public List<String> getPrincipals(JetspeedPermission permission)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<T> getPrincipalsByAttribute(String attributeName,
-            String attributeValue, JetspeedPrincipalType type)
+    public List<String> getPrincipals(JetspeedPermission permission, JetspeedPrincipalType
type)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public boolean principalExists(String principalName,
-            JetspeedPrincipalType type)
+    public boolean principalExists(String principalName, JetspeedPrincipalType type)
     {
         // TODO Auto-generated method stub
         return false;
     }
 
-    public void addPrincipal(JetspeedPrincipal principal,
-            Set<JetspeedPrincipalAssociationReference> associations)
-            throws PrincipalAssociationNotAllowedException,
-            PrincipalAlreadyExistsException,
-            PrincipalAssociationRequiredException
+    //
+    // JetspeedPrincipalStorageManager interface implementation
+    //
+    public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference>
associations)
+                                                                                        
                         throws PrincipalAlreadyExistsException,
+                                                                                        
                         PrincipalAssociationRequiredException
     {
         // TODO Auto-generated method stub
-        
     }
 
     public boolean isMapped()
@@ -181,92 +163,88 @@
         return false;
     }
 
-    public void removePrincipal(JetspeedPrincipal principal)
-            throws PrincipalNotFoundException, PrincipalNotRemovableException,
-            DependentPrincipalException
+    public void removePrincipal(JetspeedPrincipal principal) throws PrincipalNotFoundException,
+                                                            PrincipalNotRemovableException,
DependentPrincipalException
     {
         // TODO Auto-generated method stub
-        
     }
 
-    public void updatePrincipal(JetspeedPrincipal principal)
-            throws PrincipalUpdateException, PrincipalNotFoundException
+    public void updatePrincipal(JetspeedPrincipal principal) throws PrincipalUpdateException,
+                                                            PrincipalNotFoundException
     {
         // TODO Auto-generated method stub
-        
     }
 
+    //
+    // JetspeedPrincipalStorageManager interface implementation
+    //
     public void addCredential(PasswordCredential credential)
     {
         // TODO Auto-generated method stub
-        
     }
 
     public void removeCredential(PasswordCredential credential)
     {
         // TODO Auto-generated method stub
-        
     }
 
     public void updateCredential(PasswordCredential credential)
     {
         // TODO Auto-generated method stub
-        
     }
 
-    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to,
-            String associationName) throws PrincipalNotFoundException,
-            PrincipalAssociationUnsupportedException,
-            PrincipalAssociationNotAllowedException
+    //
+    // JetspeedPrincipalAssociationStorageManager interface implementation
+    //
+    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
+                                                                                        
           throws PrincipalNotFoundException,
+                                                                                        
           PrincipalAssociationUnsupportedException,
+                                                                                        
           PrincipalAssociationNotAllowedException
     {
         // TODO Auto-generated method stub
-        
     }
 
-    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to,
-            String associationName) throws PrincipalNotFoundException,
-            PrincipalAssociationUnsupportedException,
-            PrincipalAssociationRequiredException
+    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
+                                                                                        
              throws PrincipalNotFoundException,
+                                                                                        
              PrincipalAssociationUnsupportedException,
+                                                                                        
              PrincipalAssociationRequiredException
     {
         // TODO Auto-generated method stub
-        
     }
 
-    public void grantPermission(JetspeedPrincipal principal,
-            JetspeedPermission permission)
+    //
+    // JetspeedPrincipalPermissionStorageManager interface implementation
+    //
+    public void grantPermission(JetspeedPrincipal principal, JetspeedPermission permission)
     {
         // TODO Auto-generated method stub
-        
     }
 
     public void revokeAll(JetspeedPrincipal principal)
     {
         // TODO Auto-generated method stub
-        
     }
 
-    public void revokePermission(JetspeedPrincipal principal,
-            JetspeedPermission permission)
+    public void revokePermission(JetspeedPrincipal principal, JetspeedPermission permission)
     {
         // TODO Auto-generated method stub
-        
     }
 
+    //
+    // JetspeedPermissionStorageManager interface implementation
+    //
     public void addPermission(PortalResourcePermission p)
     {
         // TODO Auto-generated method stub
-        
     }
 
     public void removePermission(JetspeedPermission p)
     {
         // TODO Auto-generated method stub
-        
     }
 
     public void updatePermission(JetspeedPermission p)
     {
         // TODO Auto-generated method stub
-        
     }
 }

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=692544&r1=692543&r2=692544&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  5 13:46:23 2008
@@ -24,29 +24,29 @@
 /**
  * @version $Id$
  */
-public interface JetspeedPrincipalManager<T extends JetspeedPrincipal> extends JetspeedPrincipalStorageManager,
JetspeedPrincipalPermissionStorageManager
+public interface JetspeedPrincipalManager extends JetspeedPrincipalStorageManager, JetspeedPrincipalPermissionStorageManager
 {
     JetspeedPrincipalType getPrincipalType();
 
-    boolean principalExists(String name);
+     boolean principalExists(String name);
 
-    T getPrincipal(String name);
+    JetspeedPrincipal getPrincipal(String name);
 
     List<String> getPrincipalNames(String nameFilter);
 
-    List<T> getPrincipals(String nameFilter);
+    List<JetspeedPrincipal> getPrincipals(String nameFilter);
     
-    List<T> getPrincipalsByAttribute(String attributeName, String attributeValue);
+    List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue);
     
-    T newPrincipal(String name, boolean mapped);
+    JetspeedPrincipal newPrincipal(String name, boolean mapped);
 
-    T newTransientPrincipal(String name);
+    JetspeedPrincipal newTransientPrincipal(String name);
     
     void removePrincipal(String name) throws PrincipalNotFoundException, PrincipalNotRemovableException,
DependentPrincipalException;
 
-    List<T> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from,
String associationName);
+    List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, String associationName);
 
-    List<T> getAssociatedTo(String principalToName, JetspeedPrincipalType to, String
associationName);
+    List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
to, String associationName);
 
     List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType
from, String associationName);
 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAccessManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAccessManager.java?rev=692544&r1=692543&r2=692544&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAccessManager.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAccessManager.java
Fri Sep  5 13:46:23 2008
@@ -25,27 +25,27 @@
 /**
  * @version $Id$
  */
-public interface JetspeedPrincipalAccessManager<T extends JetspeedPrincipal>
+public interface JetspeedPrincipalAccessManager
 {
     boolean principalExists(String principalName, JetspeedPrincipalType type);
 
-    T getPrincipal(Long id);
+    JetspeedPrincipal getPrincipal(Long id);
 
-    T getPrincipal(String principalName, JetspeedPrincipalType type);
+    JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type);
 
-    List<T> getPrincipals(String nameFilter, JetspeedPrincipalType type);
+    List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType
type);
 
-    List<T> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType
type);
+    List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue,
JetspeedPrincipalType type);
 
     List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type);
 
-    List<T> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from,
JetspeedPrincipalType to, String associationName);
+    List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
 
-    List<T> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType
to, String associationName);
+    List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
 
-    List<T> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType
to, String associationName);
+    List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
 
-    List<T> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType
to, String associationName);
+    List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
 
     List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalManagerSPI.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalManagerSPI.java?rev=692544&r1=692543&r2=692544&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalManagerSPI.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalManagerSPI.java
Fri Sep  5 13:46:23 2008
@@ -17,7 +17,6 @@
 
 package org.apache.jetspeed.security.spi;
 
-import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationHandler;
 import org.apache.jetspeed.security.JetspeedPrincipalManager;
 
@@ -25,7 +24,7 @@
  * @version $Id$
  *
  */
-public interface JetspeedPrincipalManagerSPI<T extends JetspeedPrincipal> extends JetspeedPrincipalManager<T>
+public interface JetspeedPrincipalManagerSPI extends JetspeedPrincipalManager
 {
     void addAssociationHandler(JetspeedPrincipalAssociationHandler ah);
 }



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