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/10 09:23:32 UTC

svn commit: r693715 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-security/src/main/java/org/apache/jetspeed/security/ components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/ jetspeed-api/src/m...

Author: ate
Date: Wed Sep 10 00:23:32 2008
New Revision: 693715

URL: http://svn.apache.org/viewvc?rev=693715&view=rev
Log:
Added RoleManager.getRoleNames() and GroupManager.getGroupNames()

Added javadoc clarification that the lists of principals or names retrieved through the JetspeedPrincipalManager are modifiable and detached.
Which means these lists can be used and modified at will, no need to copy them into another list.

Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/   (props changed)
    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/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.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/RoleManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep 10 00:23:32 2008
@@ -1,2 +1,2 @@
-target
+target
 surefire*.properties

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=693715&r1=693714&r2=693715&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 Wed Sep 10 00:23:32 2008
@@ -256,6 +256,11 @@
         return (List<Group>) super.getPrincipals(nameFilter);
     }
     
+    public List<String> getGroupNames(String nameFilter) throws SecurityException
+    {
+        return getPrincipalNames(nameFilter);
+    }
+
     /**
      * @see org.apache.jetspeed.security.GroupManager#updateGroup(org.apache.jetspeed.security.Group)
      */

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=693715&r1=693714&r2=693715&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 Wed Sep 10 00:23:32 2008
@@ -306,6 +306,11 @@
         return (List<Role>)super.getPrincipals(nameFilter);
     }
 
+    public List<String> getRoleNames(String nameFilter) throws SecurityException
+    {
+        return getPrincipalNames(nameFilter);
+    }
+
     /** 
      * @see org.apache.jetspeed.security.RoleManager#updateRole(org.apache.jetspeed.security.Role)
      */

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java?rev=693715&r1=693714&r2=693715&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java Wed Sep 10 00:23:32 2008
@@ -86,7 +86,7 @@
 
     /**
      * <p>
-     * Retrieves a {@link Group} list of all the groups associated to a specific
+     * Retrieves a detached and modifiable {@link Group} list of all the groups associated to a specific
      * user.
      * 
      * @param username The user name.
@@ -97,7 +97,7 @@
 
     /**
      * <p>
-     * Retrieves {@link Group} list of all the groups in a specific role.
+     * Retrieves a detached and modifiable {@link Group} list of all the groups in a specific role.
      * </p>
      * 
      * @param roleName The role name
@@ -141,7 +141,7 @@
     boolean isUserInGroup(String username, String groupName) throws SecurityException;
 
     /**
-     * Retrieves a {@link Group} list matching the corresponding
+     * Retrieves a detached and modifiable {@link Group} list matching the corresponding
      * group name filter.
      * </p>
      * 
@@ -151,6 +151,17 @@
    List<Group> getGroups(String nameFilter) throws SecurityException;
     
    /**
+    * <p>
+    * Retrieves a detached and modifiable List of group names, finding groups matching the corresponding
+    * group name filter.
+    * </p>
+    * 
+    * @param nameFilter The filter used to retrieve matching groups.
+    * @return A list of group names
+    */
+   List<String> getGroupNames(String nameFilter) throws SecurityException;
+
+   /**
     * Updates a group and all its attributes
     * @param group
     * @throws SecurityException

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=693715&r1=693714&r2=693715&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 Wed Sep 10 00:23:32 2008
@@ -32,8 +32,25 @@
 
     JetspeedPrincipal getPrincipal(String name);
 
+    /**
+     * <p>
+     * Retrieves a detached and modifiable List of principal names, finding principals matching the corresponding
+     * principal name filter.
+     * </p>
+     * 
+     * @param nameFilter The filter used to retrieve matching principals.
+     * @return A list of principal names
+     */
     List<String> getPrincipalNames(String nameFilter);
 
+    /**
+     * Retrieves a detached and modifiable {@link JetspeedPrincipal} list matching the corresponding
+     * principal name filter.
+     * </p>
+     * 
+     * @param nameFilter The filter used to retrieve matching principal.
+     * @return a list of {@link JetspeedPrincipal}
+     */
     List<? extends JetspeedPrincipal> getPrincipals(String nameFilter);
     
     List<? extends JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue);
@@ -44,11 +61,51 @@
     
     void removePrincipal(String name) throws PrincipalNotFoundException, PrincipalNotRemovableException, DependentPrincipalException;
 
+    /**
+     * <p>
+     * Retrieves a detached and modifiable {@link JetspeedPrincipal} list of all the principals managed by this manager which are
+     * associated <em>to</em> the specified principal by the specified association.
+     * 
+     * @param principalFromName The principal name to find the other principals associated <em>to</em>.
+     * @param from The principal type of the provided principal name
+     * @param associationName The name of the association <em>from</em> the provided principal type <em>to</em> this Manager principal type.
+     * @return The list of {@link JetspeedPrincipal} in the <em>to</em> side of the provided association for the provided principal name and its type
+     */
     List<? extends JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, String associationName);
 
+    /**
+     * <p>
+     * Retrieves a detached and modifiable {@link JetspeedPrincipal} list of all the principals managed by this manager which are
+     * associated <em>from</em> the specified principal by the specified association.
+     * 
+     * @param principalToName The principal name to find the other principals associated <em>from</em>.
+     * @param to The principal type of the provided principal name
+     * @param associationName The name of the association <em>from</em> this Manager principal type <em>to</em> the provided principal type
+     * @return The list of {@link JetspeedPrincipal} in the <em>from</em> side of the provided association for the provided principal name and its type
+     */
     List<? extends JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType to, String associationName);
 
+    /**
+     * <p>
+     * Retrieves a detached and modifiable list of the names of all the principals managed by this manager which are
+     * associated <em>to</em> the specified principal by the specified association.
+     * 
+     * @param principalFromName The principal name to find the other principals associated <em>to</em>.
+     * @param from The principal type of the provided principal name
+     * @param associationName The name of the association <em>from</em> the provided principal type <em>to</em> this Manager principal type
+     * @return The list of the names of the principals in the <em>from</em> side of the provided association for the provided principal name and its type
+     */
     List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, String associationName);
 
+    /**
+     * <p>
+     * Retrieves a detached and modifiable list of the names of all the principals managed by this manager which are
+     * associated <em>from</em> the specified principal by the specified association.
+     * 
+     * @param principalToName The principal name to find the other principals associated <em>from</em>.
+     * @param to The principal type of the provided principal name
+     * @param associationName The name of the association <em>from</em> this Manager principal type the <em>to</em> principal type
+     * @return The list of the names of the principals in the <em>from</em> side of the provided association for the provided principal name and its type
+     */
     List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType to, String associationName);
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java?rev=693715&r1=693714&r2=693715&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java Wed Sep 10 00:23:32 2008
@@ -76,7 +76,7 @@
     Role getRole(String roleName) throws SecurityException;
 
     /**
-     * <p>Retrieves a {@link Role} list of all the roles
+     * <p>Retrieves a detached and modifiable {@link Role} list of all the roles
      * associated to a specific user.</p>
      * @param username The user name.
      * @return A List of {@link Role}.
@@ -85,7 +85,7 @@
     List<Role> getRolesForUser(String username) throws SecurityException;
 
     /**
-     * <p>Retrieves a {@link Role} list of all the roles
+     * <p>Retrieves a detached and modifiable {@link Role} list of all the roles
      * associated to a specific group.</p>
      * @param groupName The group name
      * @return A Collection of {@link Role}.
@@ -144,7 +144,7 @@
     boolean isGroupInRole(String groupName, String roleName) throws SecurityException;
 
     /**
-     * Retrieves a {@link Role} list matching the corresponding
+     * Retrieves a detached and modifiable {@link Role} list matching the corresponding
      * role name filter.
      * </p>
      * 
@@ -154,6 +154,17 @@
     List<Role> getRoles(String nameFilter) throws SecurityException;
     
     /**
+     * <p>
+     * Retrieves a detached and modifiable List of role names, finding roles matching the corresponding
+     * role name filter.
+     * </p>
+     * 
+     * @param nameFilter The filter used to retrieve matching roles.
+     * @return A list of role names
+     */
+    List<String> getRoleNames(String nameFilter) throws SecurityException;
+
+    /**
      * Updates a role and all its attributes
      * @param role
      * @throws SecurityException

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java?rev=693715&r1=693714&r2=693715&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java Wed Sep 10 00:23:32 2008
@@ -135,7 +135,7 @@
 
     /**
      * <p>
-     * Retrieves a {@link User} list matching the corresponding
+     * Retrieves a detached and modifiable {@link User} list matching the corresponding
      * user name filter.
      * </p>
      * 
@@ -146,7 +146,7 @@
 
     /**
      * <p>
-     * Retrieves a List user names, finding users matching the corresponding
+     * Retrieves a a detached and modifiable List user names, finding users matching the corresponding
      * user name filter.
      * </p>
      * 
@@ -157,7 +157,7 @@
 
     /**
      * <p>
-     * Retrieves a {@link User} list of all the users in a specific role.
+     * Retrieves a a detached and modifiable {@link User} list of all the users in a specific role.
      * </p>
      * 
      * @param roleName The role name
@@ -167,7 +167,7 @@
     List<User> getUsersInRole(String roleName) throws SecurityException;
     
     /**
-     * <p>Retrieves a {@link User} list of all the users in a specific group.</p>
+     * <p>Retrieves a a detached and modifiable {@link User} list of all the users in a specific group.</p>
      * @param groupName The group name
      * @return A list of {@link User}.
      * @throws Throws security exception if the group does not exist.
@@ -182,7 +182,7 @@
     void updateUser(User user) throws SecurityException;
     
     /**
-     * <p>Retrieves a {@link User} list of all the users having a specific value for a specific attribute
+     * <p>Retrieves a a detached and modifiable {@link User} list of all the users having a specific value for a specific attribute
      * @param attributeName
      * @param attributeValue
      * @return a List of users



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