portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r692486 - 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 16:49:43 GMT
Author: woonsan
Date: Fri Sep  5 09:49:42 2008
New Revision: 692486

URL: http://svn.apache.org/viewvc?rev=692486&view=rev
Log:
Flattening the Principal API.
Removed for-loop-copying blocks from role/group manager by using generic.

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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -43,7 +43,7 @@
 /**
  * @version $Id$
  */
-public abstract class BaseJetspeedPrincipalManager implements JetspeedPrincipalManagerSPI
+public abstract class BaseJetspeedPrincipalManager<T extends JetspeedPrincipal> implements
JetspeedPrincipalManagerSPI<T>
 {
     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 jpam;
+    private JetspeedPrincipalAccessManager<T> jpam;
     private JetspeedPrincipalStorageManager jpsm;
     private JetspeedPrincipalPermissionStorageManager jppsm;
 
-    public BaseJetspeedPrincipalManager(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager
jpam,
+    public BaseJetspeedPrincipalManager(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager<T>
jpam,
                                         JetspeedPrincipalStorageManager jpsm,
                                         JetspeedPrincipalPermissionStorageManager jppsm)
     {
@@ -116,7 +116,7 @@
         return jpam.principalExists(name, principalType);
     }
 
-    public JetspeedPrincipal getPrincipal(String name)
+    public T getPrincipal(String name)
     {
         return jpam.getPrincipal(name, principalType);
     }
@@ -126,12 +126,12 @@
         return jpam.getPrincipalNames(nameFilter, principalType);
     }
 
-    public List<JetspeedPrincipal> getPrincipals(String nameFilter)
+    public List<T> getPrincipals(String nameFilter)
     {
         return jpam.getPrincipals(nameFilter, principalType);
     }
 
-    public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String
attributeValue)
+    public List<T> getPrincipalsByAttribute(String attributeName, String attributeValue)
     {
         return jpam.getPrincipalsByAttribute(attributeName, attributeValue, principalType);
     }
@@ -145,7 +145,7 @@
         jpsm.removePrincipal(principal);
     }
 
-    public final List<JetspeedPrincipal> getAssociatedFrom(String principalFromName,
JetspeedPrincipalType from, String associationName)
+    public final List<T> 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<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
to, String associationName)
+    public final List<T> 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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -16,16 +16,14 @@
  */
 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;
 import org.apache.jetspeed.security.PrincipalAlreadyExistsException;
 import org.apache.jetspeed.security.PrincipalAssociationNotAllowedException;
@@ -33,6 +31,7 @@
 import org.apache.jetspeed.security.PrincipalNotFoundException;
 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;
@@ -57,7 +56,7 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class GroupManagerImpl extends BaseJetspeedPrincipalManager implements GroupManager
+public class GroupManagerImpl extends BaseJetspeedPrincipalManager<Group> implements
GroupManager
 {
 
     /** The logger. */
@@ -67,14 +66,14 @@
     private JetspeedPrincipalType roleType;
     private UserManager userManager;
     
-    public GroupManagerImpl(JetspeedPrincipalType principalType, JetspeedPrincipalType userType,
JetspeedPrincipalType roleType, 
-                           JetspeedPrincipalAccessManager jpam, JetspeedPrincipalStorageManager
jpsm,
+    public GroupManagerImpl(JetspeedPrincipalType principalType,
+                           JetspeedPrincipalAccessManager<Group> jpam, JetspeedPrincipalStorageManager
jpsm,
                            JetspeedPrincipalPermissionStorageManager jppsm,
-                           UserManager userManager)
+                           UserManager userManager, RoleManager roleManager)
     {
         super(principalType, jpam, jpsm, jppsm);
-        this.userType = userType;
-        this.roleType = roleType;
+        this.userType = ((JetspeedPrincipalManager) userManager).getPrincipalType();
+        this.roleType = ((JetspeedPrincipalManager) roleManager).getPrincipalType();
         this.userManager = userManager;
     }
 
@@ -172,12 +171,7 @@
     public Collection<Group> getGroupsForUser(String username)
             throws SecurityException
     {
-        ArrayList<Group> groups = new ArrayList<Group>();
-        for (JetspeedPrincipal principal : super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF))
-        {
-            groups.add((Group)principal);
-        }
-        return groups;
+        return super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
     }
 
     /**
@@ -186,12 +180,7 @@
     public Collection<Group> getGroupsInRole(String roleName)
             throws SecurityException
     {
-        ArrayList<Group> groups = new ArrayList<Group>();
-        for (JetspeedPrincipal principal : super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF))
-        {
-            groups.add((Group)principal);
-        }
-        return groups;
+        return super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_PART_OF);
     }
 
     /**
@@ -255,15 +244,7 @@
      */
     public Collection<Group> getGroups(String filter) throws SecurityException
     {
-        Collection<Group> groups = new ArrayList<Group>();
-        List<JetspeedPrincipal> principals = super.getPrincipals(filter);
-        
-        for (JetspeedPrincipal principal : principals)
-        {
-            groups.add((Group) principal);
-        }
-        
-        return groups;
+        return super.getPrincipals(filter);
     }
     
     /**
@@ -302,12 +283,12 @@
         }
     }
 
-    public JetspeedPrincipal newPrincipal(String name, boolean mapped)
+    public Group newPrincipal(String name, boolean mapped)
     {
         return newGroup(name, mapped);
     }
 
-    public JetspeedPrincipal newTransientPrincipal(String name)
+    public Group 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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.jetspeed.security.impl;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.prefs.Preferences;
@@ -25,7 +24,6 @@
 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;
@@ -63,7 +61,7 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class RoleManagerImpl extends BaseJetspeedPrincipalManager implements RoleManager
+public class RoleManagerImpl extends BaseJetspeedPrincipalManager<Role> implements
RoleManager
 {
     /** The logger. */
     private static final Log log = LogFactory.getLog(RoleManagerImpl.class);
@@ -74,7 +72,7 @@
     private GroupManager groupManager;
     
     public RoleManagerImpl(JetspeedPrincipalType principalType, 
-                           JetspeedPrincipalAccessManager jpam, JetspeedPrincipalStorageManager
jpsm,
+                           JetspeedPrincipalAccessManager<Role> jpam, JetspeedPrincipalStorageManager
jpsm,
                            JetspeedPrincipalPermissionStorageManager jppsm,
                            UserManager userManager, GroupManager groupManager)
     {
@@ -179,12 +177,7 @@
      */
     public List<Role> getRolesForUser(String username) throws SecurityException
     {
-        ArrayList<Role> roles = new ArrayList<Role>();
-        for (JetspeedPrincipal principal : super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF))
-        {
-            roles.add((Role)principal);
-        }
-        return roles;
+        return super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_PART_OF);
     }
 
     /**
@@ -192,12 +185,7 @@
      */
     public List<Role> getRolesInGroup(String groupName) throws SecurityException
     {
-        ArrayList<Role> roles = new ArrayList<Role>();
-        for (JetspeedPrincipal principal : super.getAssociatedFrom(groupName, groupType,
JetspeedPrincipalAssociationType.IS_PART_OF))
-        {
-            roles.add((Role)principal);
-        }
-        return roles;
+        return super.getAssociatedFrom(groupName, groupType, JetspeedPrincipalAssociationType.IS_PART_OF);
     }
 
     /**
@@ -311,15 +299,7 @@
      */
     public Collection<Role> getRoles(String filter) throws SecurityException
     {
-        Collection<Role> roles = new ArrayList<Role>();
-        List<JetspeedPrincipal> principals = super.getPrincipals(filter);
-        
-        for (JetspeedPrincipal principal : principals)
-        {
-            roles.add((Role) principal);
-        }
-        
-        return roles;
+        return super.getPrincipals(filter);
     }
 
     /** 
@@ -361,7 +341,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.security.JetspeedPrincipalManager#newPrincipal(java.lang.String,
boolean)
      */
-    public JetspeedPrincipal newPrincipal(String name, boolean mapped)
+    public Role newPrincipal(String name, boolean mapped)
     {
         return newRole(name, mapped);
     }
@@ -369,7 +349,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.security.JetspeedPrincipalManager#newTransientPrincipal(java.lang.String)
      */
-    public JetspeedPrincipal newTransientPrincipal(String name)
+    public Role 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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -33,7 +33,6 @@
 import org.apache.jetspeed.security.PrincipalNotFoundException;
 import org.apache.jetspeed.security.PrincipalNotRemovableException;
 import org.apache.jetspeed.security.PrincipalUpdateException;
-import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.spi.JetspeedPermissionStorageManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager;
@@ -44,84 +43,96 @@
 /**
  * @version $Id$
  */
-public class JetspeedSecurityPersistenceManager implements JetspeedPrincipalAccessManager,
+public class JetspeedSecurityPersistenceManager<T extends JetspeedPrincipal> implements
JetspeedPrincipalAccessManager<T>,
                 JetspeedPrincipalStorageManager, UserPasswordCredentialStorageManager,
                 JetspeedPrincipalAssociationStorageManager, JetspeedPrincipalPermissionStorageManager,
                 JetspeedPermissionStorageManager
 {
-    //
-    // JetspeedPrincipalAccessManager interface implementation
-    //
-    public List<JetspeedPrincipal> getAssociatedFrom(String principalName, JetspeedPrincipalType
type,
-                                                     String associationName)
+
+    public List<T> getAssociatedFrom(String principalFromName,
+            JetspeedPrincipalType from, JetspeedPrincipalType to,
+            String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<JetspeedPrincipal> getAssociatedFrom(Long principalId, JetspeedPrincipalType
type,
-                                                     String associationName)
+    public List<T> getAssociatedFrom(Long principalFromId,
+            JetspeedPrincipalType from, JetspeedPrincipalType to,
+            String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<String> getAssociatedNamesFrom(String principalName, JetspeedPrincipalType
type, 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 principalId, JetspeedPrincipalType
type, 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 principalName, JetspeedPrincipalType
type, 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 principalId, JetspeedPrincipalType
type, String associationName)
+    public List<String> getAssociatedNamesTo(Long principalToId,
+            JetspeedPrincipalType from, JetspeedPrincipalType to,
+            String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<JetspeedPrincipal> getAssociatedTo(String principalName, JetspeedPrincipalType
type,
-                                                   String associationName)
+    public List<T> getAssociatedTo(String principalToName,
+            JetspeedPrincipalType from, JetspeedPrincipalType to,
+            String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public List<JetspeedPrincipal> getAssociatedTo(Long principalId, JetspeedPrincipalType
type, String associationName)
+    public List<T> getAssociatedTo(Long principalToId,
+            JetspeedPrincipalType from, JetspeedPrincipalType to,
+            String associationName)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public JetspeedPrincipal getPrincipal(Long id)
+    public T getPrincipal(Long id)
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type)
+    public T 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<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType
type)
+    public List<T> getPrincipals(String nameFilter, JetspeedPrincipalType type)
     {
         // TODO Auto-generated method stub
         return null;
@@ -133,26 +144,35 @@
         return null;
     }
 
-    public List<String> getPrincipals(JetspeedPermission permission, JetspeedPrincipalType
type)
+    public List<String> getPrincipals(JetspeedPermission permission,
+            JetspeedPrincipalType type)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<T> getPrincipalsByAttribute(String attributeName,
+            String attributeValue, 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;
     }
 
-    //
-    // JetspeedPrincipalStorageManager interface implementation
-    //
-    public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference>
associations)
-                                                                                        
                         throws PrincipalAlreadyExistsException,
-                                                                                        
                         PrincipalAssociationRequiredException
+    public void addPrincipal(JetspeedPrincipal principal,
+            Set<JetspeedPrincipalAssociationReference> associations)
+            throws PrincipalAssociationNotAllowedException,
+            PrincipalAlreadyExistsException,
+            PrincipalAssociationRequiredException
     {
         // TODO Auto-generated method stub
+        
     }
 
     public boolean isMapped()
@@ -161,88 +181,92 @@
         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, User user)
+    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
+        
     }
 
-    //
-    // JetspeedPrincipalAssociationStorageManager interface implementation
-    //
-    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
-                                                                                        
           throws PrincipalNotFoundException,
-                                                                                        
           PrincipalAssociationUnsupportedException,
-                                                                                        
           PrincipalAssociationNotAllowedException
+    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
+        
     }
 
-    //
-    // JetspeedPrincipalPermissionStorageManager interface implementation
-    //
-    public void grantPermission(JetspeedPrincipal principal, JetspeedPermission permission)
+    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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -24,29 +24,29 @@
 /**
  * @version $Id$
  */
-public interface JetspeedPrincipalManager extends JetspeedPrincipalStorageManager, JetspeedPrincipalPermissionStorageManager
+public interface JetspeedPrincipalManager<T extends JetspeedPrincipal> extends JetspeedPrincipalStorageManager,
JetspeedPrincipalPermissionStorageManager
 {
     JetspeedPrincipalType getPrincipalType();
 
-     boolean principalExists(String name);
+    boolean principalExists(String name);
 
-    JetspeedPrincipal getPrincipal(String name);
+    T getPrincipal(String name);
 
     List<String> getPrincipalNames(String nameFilter);
 
-    List<JetspeedPrincipal> getPrincipals(String nameFilter);
+    List<T> getPrincipals(String nameFilter);
     
-    List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue);
+    List<T> getPrincipalsByAttribute(String attributeName, String attributeValue);
     
-    JetspeedPrincipal newPrincipal(String name, boolean mapped);
+    T newPrincipal(String name, boolean mapped);
 
-    JetspeedPrincipal newTransientPrincipal(String name);
+    T newTransientPrincipal(String name);
     
     void removePrincipal(String name) throws PrincipalNotFoundException, PrincipalNotRemovableException,
DependentPrincipalException;
 
-    List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, String associationName);
+    List<T> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from,
String associationName);
 
-    List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
to, String associationName);
+    List<T> 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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -25,27 +25,27 @@
 /**
  * @version $Id$
  */
-public interface JetspeedPrincipalAccessManager
+public interface JetspeedPrincipalAccessManager<T extends JetspeedPrincipal>
 {
     boolean principalExists(String principalName, JetspeedPrincipalType type);
 
-    JetspeedPrincipal getPrincipal(Long id);
+    T getPrincipal(Long id);
 
-    JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type);
+    T getPrincipal(String principalName, JetspeedPrincipalType type);
 
-    List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType
type);
+    List<T> getPrincipals(String nameFilter, JetspeedPrincipalType type);
 
-    List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue,
JetspeedPrincipalType type);
+    List<T> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType
type);
 
     List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type);
 
-    List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
+    List<T> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from,
JetspeedPrincipalType to, String associationName);
 
-    List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
+    List<T> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType
to, String associationName);
 
-    List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
+    List<T> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType
to, String associationName);
 
-    List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType
from, JetspeedPrincipalType to, String associationName);
+    List<T> 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=692486&r1=692485&r2=692486&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 09:49:42 2008
@@ -17,6 +17,7 @@
 
 package org.apache.jetspeed.security.spi;
 
+import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationHandler;
 import org.apache.jetspeed.security.JetspeedPrincipalManager;
 
@@ -24,7 +25,7 @@
  * @version $Id$
  *
  */
-public interface JetspeedPrincipalManagerSPI extends JetspeedPrincipalManager
+public interface JetspeedPrincipalManagerSPI<T extends JetspeedPrincipal> extends JetspeedPrincipalManager<T>
 {
     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