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 ta...@apache.org on 2008/08/07 05:52:09 UTC

svn commit: r683497 [6/7] - in /portals/jetspeed-2/portal/branches/JS2-869: components/jetspeed-capability/src/main/java/org/apache/jetspeed/serializer/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/ components/jetspeed-...

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java Wed Aug  6 20:52:05 2008
@@ -85,9 +85,7 @@
 
     /**
      * PersitenceBrokerSSOProvider()
-     * @param repository Location of repository mapping file.  Must be available within the classpath.
-     * @param prefsFactoryImpl <code>java.util.prefs.PreferencesFactory</code> implementation to use.
-     * @param enablePropertyManager  Whether or not we chould be suing the property manager.
+     * @param repositoryPath Location of repository mapping file.  Must be available within the classpath.
      * @throws ClassNotFoundException if the <code>prefsFactoryImpl</code> argument does not reperesent
      * a Class that exists in the current classPath.
      */
@@ -105,7 +103,7 @@
     {
         // Get the principal from the subject
         BasePrincipal principal = (BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class);
-        String fullPath = principal.getFullPath();
+        String fullPath = principal.getName();
         
         /* ProxyID is used for the cache. The http client object will be cached for a
          * given user site url combination
@@ -140,7 +138,7 @@
     {
         // Get the principal from the subject
         BasePrincipal principal = (BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class);
-        String fullPath = principal.getFullPath();
+        String fullPath = principal.getName();
 
         
         /* ProxyID is used for the cache. The http client object will be cached for a
@@ -195,7 +193,7 @@
             InternalUserPrincipal rp  = (InternalUserPrincipal)itRemotePrincipal.next();
             if (rp != null)
             {
-                temp.add(rp.getFullPath());
+                temp.add(rp.getName());
             }
         }
         
@@ -224,7 +222,7 @@
     {
         // Get the principal from the subject
         BasePrincipal principal = (BasePrincipal)SecurityHelper.getBestPrincipal(user, UserPrincipal.class);
-        String fullPath = principal.getFullPath();
+        String fullPath = principal.getName();
         
         // Call into API
         return this.getCookiesForUser(fullPath);
@@ -395,7 +393,7 @@
         
         // Get the principal from the subject
         BasePrincipal principal = (BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class);
-        String fullPath = principal.getFullPath();
+        String fullPath = principal.getName();
         
                 
         // Get remotePrincipals for Site and match them with the Remote Principal for the Principal attached to site
@@ -436,7 +434,7 @@
         
         // Get the principal from the subject
         BasePrincipal principal = (BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class);
-        String fullPath = principal.getFullPath();
+        String fullPath = principal.getName();
         
         // Filter the credentials for the given principals
         SSOContext context = getCredential(ssoSite, fullPath);  
@@ -481,7 +479,7 @@
         }
         
         // Get the Principal information (logged in user)
-        String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getFullPath();
+        String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getName();
         String principalName = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getName();
         
         // Add an entry for the principal to the site if it doesn't exist
@@ -524,9 +522,9 @@
          * The convention for the path is the following: /sso/SiteID/{user|group}/{user name | group name}/remote user name
          */
         if ( fullPath.indexOf("/group/") > -1)
-            remotePrincipal.setFullPath("/sso/" + ssoSite.getSiteId() + "/group/"+  principalName + "/" + remoteUser);
+            remotePrincipal.setName("/sso/" + ssoSite.getSiteId() + "/group/"+  principalName + "/" + remoteUser); // FIXME:
         else
-            remotePrincipal.setFullPath("/sso/" + ssoSite.getSiteId() + "/user/"+ principalName + "/" + remoteUser);
+            remotePrincipal.setName("/sso/" + ssoSite.getSiteId() + "/user/"+ principalName + "/" + remoteUser); // FIXME:
         
         // New credential object for remote principal
          InternalCredentialImpl credential = 
@@ -579,7 +577,7 @@
         }
         
         // Get the Principal information
-        String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getFullPath();
+        String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getName();
         
         try
         {
@@ -669,7 +667,7 @@
             }
             
             // Get the Principal information
-            String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getFullPath();
+            String fullPath = ((BasePrincipal)SecurityHelper.getBestPrincipal(subject, UserPrincipal.class)).getName();
             
             //  Get remotePrincipals for Site and match them with the Remote Principal for the Principal attached to site
             Collection principalsForSite    = ssoSite.getPrincipals();
@@ -801,13 +799,13 @@
             // Error checking  -- should have a credential at this point
             if ( credential == null)
             {
-//              System.out.println("Warning: Remote User " + remotePrincipal.getFullPath() + " doesn't have a credential");
+//              System.out.println("Warning: Remote User " + remotePrincipal.getName() + " doesn't have a credential");
                 return null; 
             }
         }
         
         //  Create new context
-        String name = stripPrincipalName(remotePrincipal.getFullPath());
+        String name = stripPrincipalName(remotePrincipal.getName());
         
         SSOContext context = new SSOContextImpl(credential.getPrincipalId(), name, this.unscramble(credential.getValue()));
         
@@ -842,7 +840,7 @@
         {
             SSOPrincipal principal = (SSOPrincipal)ixPrincipals.next();
             if (         principal != null 
-                    && principal.getFullPath().compareToIgnoreCase(fullPath) == 0 )
+                    && principal.getName().compareToIgnoreCase(fullPath) == 0 )
             {
                 // Found Principal -- extract remote principals 
                 return principal.getRemotePrincipals();
@@ -920,7 +918,7 @@
             while (itPrincipals.hasNext())
             {
                 SSOPrincipal tmp = (SSOPrincipal)itPrincipals.next();
-                if (tmp.getFullPath().compareToIgnoreCase(fullPath) == 0)
+                if (tmp.getName().compareToIgnoreCase(fullPath) == 0)
                 {
                     // Found -- get the remotePrincipal
                     Collection collRemotePrincipals = tmp.getRemotePrincipals() ;
@@ -1016,7 +1014,7 @@
                         while (itUsers.hasNext())
                         {
                             InternalUserPrincipal user = (InternalUserPrincipal)itUsers.next();
-                            if (user.getFullPath().compareToIgnoreCase(fullPath) == 0)
+                            if (user.getName().compareToIgnoreCase(fullPath) == 0)
                             {
                                 // User is member of the group
                                 return principal.getRemotePrincipals();
@@ -1171,9 +1169,9 @@
             {
                 InternalCredential cred = (InternalCredential) creds.next();
                 SSOContext context = new SSOContextImpl(remotePrincipal.getPrincipalId(), 
-                                                stripPrincipalName(remotePrincipal.getFullPath()), 
+                                                stripPrincipalName(remotePrincipal.getName()), 
                                                 cred.getValue(), 
-                                                stripPortalPrincipalName(remotePrincipal.getFullPath()));
+                                                stripPortalPrincipalName(remotePrincipal.getName()));
                 list.add(context);
             }
         }
@@ -1277,12 +1275,12 @@
                             if (credential != null)
                             {
                                 if (log.isInfoEnabled())
-                                    log.info("SSOComponent -- Remote Principal ["+stripPrincipalName(remotePrincipal.getFullPath())+"] has credential ["+this.unscramble(credential.getValue())+ "]");
+                                    log.info("SSOComponent -- Remote Principal ["+stripPrincipalName(remotePrincipal.getName())+"] has credential ["+this.unscramble(credential.getValue())+ "]");
                                 
                                 client.getState().setCredentials(
                                         site.getRealm(),
                                         urlObj.getHost(),
-                                        new UsernamePasswordCredentials(stripPrincipalName(remotePrincipal.getFullPath()),  this.unscramble(credential.getValue()))
+                                        new UsernamePasswordCredentials(stripPrincipalName(remotePrincipal.getName()),  this.unscramble(credential.getValue()))
                                     );
                                 
                                 // Build URL if it's Form authentication
@@ -1291,7 +1289,7 @@
                                 // Check if it's form based or ChallengeResponse
                                 if (site.isFormAuthentication())
                                 {
-                                    siteURL.append("?").append(site.getFormUserField()).append("=").append(stripPrincipalName(remotePrincipal.getFullPath())).append("&").append(site.getFormPwdField()).append("=").append(this.unscramble(credential.getValue()));
+                                    siteURL.append("?").append(site.getFormUserField()).append("=").append(stripPrincipalName(remotePrincipal.getName())).append("&").append(site.getFormPwdField()).append("=").append(this.unscramble(credential.getValue()));
                                 }
                                 
                                 get = new GetMethod(siteURL.toString());
@@ -1441,7 +1439,7 @@
     throws SSOException 
     {
         String fullPath = ((BasePrincipal) SecurityHelper.getBestPrincipal(
-                subject, UserPrincipal.class)).getFullPath();
+                subject, UserPrincipal.class)).getName();
         String principalName = ((BasePrincipal) SecurityHelper
                 .getBestPrincipal(subject, UserPrincipal.class)).getName();
 
@@ -1492,10 +1490,10 @@
          * name}/remote user name
          */
         if (fullPath.indexOf("/group/") > -1)
-            remotePrincipal.setFullPath("/sso/" + ssoSite.getSiteId()
+            remotePrincipal.setName("/sso/" + ssoSite.getSiteId() // FIXME:
                     + "/group/" + principalName + "/" + remoteUser);
         else
-            remotePrincipal.setFullPath("/sso/" + ssoSite.getSiteId()
+            remotePrincipal.setName("/sso/" + ssoSite.getSiteId() // FIXME:
                     + "/user/" + principalName + "/" + remoteUser);
 
         // New credential object for remote principal

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/FailedToRenderFragmentException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/FailedToRenderFragmentException.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/FailedToRenderFragmentException.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/FailedToRenderFragmentException.java Wed Aug  6 20:52:05 2008
@@ -14,12 +14,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-/*
- * Created on Jul 27, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
 package org.apache.jetspeed.aggregator;
 
 import org.apache.jetspeed.exception.JetspeedException;

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletContent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletContent.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletContent.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletContent.java Wed Aug  6 20:52:05 2008
@@ -14,12 +14,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-/*
- * Created on Jan 11, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
 package org.apache.jetspeed.aggregator;
 
 import java.io.PrintWriter;
@@ -30,9 +24,6 @@
  * <p>
  * PortletContent
  * </p>
- * <p>
- *
- * </p>
  * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  * @author <a href="mailto:taylor@apache.org">David S. Taylor</a>  
  * @version $Id$

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/UnrenderedContentException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/UnrenderedContentException.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/UnrenderedContentException.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/UnrenderedContentException.java Wed Aug  6 20:52:05 2008
@@ -14,12 +14,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-/*
- * Created on Dec 22, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
 package org.apache.jetspeed.aggregator;
 
 import org.apache.jetspeed.exception.JetspeedException;
@@ -41,6 +35,11 @@
     /**
      * 
      */
+    private static final long serialVersionUID = -1789466316051850231L;
+
+    /**
+     * 
+     */
     public UnrenderedContentException()
     {
         super();

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/FailedToStorePortletDefinitionException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/FailedToStorePortletDefinitionException.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/FailedToStorePortletDefinitionException.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/FailedToStorePortletDefinitionException.java Wed Aug  6 20:52:05 2008
@@ -14,12 +14,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-/*
- * Created on Oct 22, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
 package org.apache.jetspeed.components.portletregistry;
 
 import org.apache.pluto.om.portlet.PortletDefinition;
@@ -41,6 +35,11 @@
     /**
      * 
      */
+    private static final long serialVersionUID = -4999734419792110127L;
+
+    /**
+     * 
+     */
     public FailedToStorePortletDefinitionException()
     {
         super();

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/engine/JetspeedEngineConstants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/engine/JetspeedEngineConstants.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/engine/JetspeedEngineConstants.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/engine/JetspeedEngineConstants.java Wed Aug  6 20:52:05 2008
@@ -94,8 +94,7 @@
     public static final String PIPELINE_DIRECTORY = "pipeline.directory";
 
     /**
-     * This specifies the factory to use the Jetspeed java.util.prefs.Preferences
-     * implementation.
+     * This specifies the factory to use the Jetspeed Prefernces implementation
      */
     public static final String PREFERENCES_FACTORY = "preferences.factory";
     public static final String PREFERENCES_FACTORY_DEFAULT =

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/PreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/PreferencesProvider.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/PreferencesProvider.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/PreferencesProvider.java Wed Aug  6 20:52:05 2008
@@ -17,7 +17,6 @@
 package org.apache.jetspeed.prefs;
 
 import java.util.Collection;
-import java.util.prefs.Preferences;
 
 import org.apache.jetspeed.prefs.om.Node;
 import org.apache.jetspeed.prefs.om.Property;

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/om/Node.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/om/Node.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/om/Node.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/prefs/om/Node.java Wed Aug  6 20:52:05 2008
@@ -21,7 +21,7 @@
 import java.sql.Timestamp;
 
 /**
- * <p>Interface representing a {@link java.util.prefs.Preferences}
+ * <p>Interface representing a single preference
  * node.</p>
  *
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/BasePrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/BasePrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/BasePrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/BasePrincipal.java Wed Aug  6 20:52:05 2008
@@ -17,7 +17,6 @@
 package org.apache.jetspeed.security;
 
 import java.io.Serializable;
-
 import java.security.Principal;
 
 /**
@@ -25,21 +24,21 @@
 * @author <a href="mailto:taylor@apache.org">David Taylor</a>, <a href="mailto:dlestrat@apache.org">David Le Strat</a>
 */
 public interface BasePrincipal extends Principal, Serializable
-{
+{  
     /** <p>The Preferences user root node</p> */
     final static String  PREFS_USER_ROOT = "/user/";
-    
     /** <p>The Preferences group root node</p> */
     final static String PREFS_GROUP_ROOT = "/group/";
-    
     /** <p>The Preferences role root node</p> */
     final static String  PREFS_ROLE_ROOT = "/role/";
-    
+    /** <p>The Preferences role root node</p> */
+    final static String  PREFS_REMOTE_ROOT = "/sso/";
+
     /**
-     * <p>Provides the principal full path prepending PREFS_{PRINCPAL}_ROOT if not prepended.</p>
-     * @return The principal full path.
+     * <p>Provides the principal name.</p>
+     * @return The principal name.
      */
-    String getFullPath();
+    String getName();
 
     /**
      * <p>Getter for the enabled state</p>
@@ -59,4 +58,10 @@
      */
     boolean isMapping();
     
+    /**
+     * Optional ID used for OR systems, this is used by Jetspeed default impll
+     * @return
+     */
+    long getId();      
+    
 }

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Credential.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Credential.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Credential.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Credential.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,23 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.jetspeed.security;
+
+
+public interface Credential
+{
+
+}

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Group.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Group.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Group.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Group.java Wed Aug  6 20:52:05 2008
@@ -17,7 +17,8 @@
 package org.apache.jetspeed.security;
 
 import java.security.Principal;
-import java.util.prefs.Preferences;
+
+import org.apache.jetspeed.security.attributes.SecurityAttributes;
 
 /**
  * <p>A group made of a {@link GroupPrincipal} and the group {@link Preferences}.</p>
@@ -38,16 +39,16 @@
     void setPrincipal(Principal groupPrincipal);
 
     /**
-     * <p>Getter for the group {@link Preferences} node, providing access to the
-     * group preferences properties.</p>
-     * @return The {@link Preferences}.
+     * <p>Getter providing access to the
+     * group security attributes.</p>
+     * @return The security attributes for a group
      */
-    Preferences getPreferences();
+    SecurityAttributes getAttributes();
 
     /**
-     * <p>Setter for the group {@link Preferences} node, providing access to the
-     * group preferences properties.</p>
-     * @param preferences The {@link Preferences}.
+     * <p>Setter providing access to the
+     * group security attributes.</p>
+     * @param attributes The security attributes for a group
      */
-    void setPreferences(Preferences preferences);
+    void setAttributes(SecurityAttributes attributes);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupManager.java Wed Aug  6 20:52:05 2008
@@ -17,7 +17,6 @@
 package org.apache.jetspeed.security;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 /**
  * <p>
@@ -108,7 +107,7 @@
      * @return A collection of {@link Group}.
      * @throws Throws security exception if the user does not exist.
      */
-    Collection getGroupsForUser(String username) throws SecurityException;
+    Collection<Group> getGroupsForUser(String username) throws SecurityException;
 
     /**
      * <p>
@@ -120,7 +119,7 @@
      * @return A Collection of {@link Group}.
      * @throws Throws a security exception if the role does not exist.
      */
-    Collection getGroupsInRole(String roleFullPathName) throws SecurityException;
+    Collection<Group> getGroupsInRole(String roleFullPathName) throws SecurityException;
 
     /**
      * <p>
@@ -163,15 +162,15 @@
      * Get all groups available from all group handlers
      * 
      * @param filter The filter used to retrieve matching groups.
-     * @return all groups available as {@link Principal} 
+     * @return all groups available as Group 
      */
-   Iterator getGroups(String filter) throws SecurityException;
+   Collection<Group> getGroups(String filter) throws SecurityException;
     
    /**
     * Enable or disable a group.
-    * @param groupFullPathName The group name full path 
+    * @param groupName The group name full path 
      *            theGroupName.theGroupChildName).
     * @param enabled enabled flag for the group
     */
-   void setGroupEnabled(String groupFullPathName, boolean enabled) throws SecurityException;
+   void setGroupEnabled(String groupName, boolean enabled) throws SecurityException;
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupPrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/GroupPrincipal.java Wed Aug  6 20:52:05 2008
@@ -23,5 +23,5 @@
  */
 public interface GroupPrincipal extends BasePrincipal
 {
-
+    final String PRINCIPAL_TYPE = "group"; 
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/HierarchyResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/HierarchyResolver.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/HierarchyResolver.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/HierarchyResolver.java Wed Aug  6 20:52:05 2008
@@ -15,39 +15,66 @@
  * limitations under the License.
  */
 package org.apache.jetspeed.security;
-
-import java.util.prefs.Preferences;
+
+import java.util.Set;
 
 /**
  * <p>
- * This class allows to implement different types of groups/roles hierarchy.
+ * Resolves hierarchies of roles or groups. Given a path, the resolver will determine all permutations of a role or group
+ * and return them as a List.
  * </p>
  * 
- * @author <a href="mailto:Artem.Grinshtein@t-systems.com">Artem Grinshtein </a>
+ * @author <a href="mailto:Artem.Grinshtein@t-systems.com">Artem Grinshtein </a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * 
  * @version $Id: HierarchyResolver.java 187640 2004-09-30 04:01:42Z dlestrat $
  */
 public interface HierarchyResolver 
-{
-    
-    /**
-     * <p>
-     * Returns absolute path names of the hierarchy roles/groups.
-     * </p>
-     * 
-     * @param prefs Preferences for the role/group
-     * @return Returns absolute path names of the dependcy roles/groups.
-     */
-    public String[] resolve(Preferences prefs);
+{    
+    static final String DEFAULT_HIERARCHY_SEPARATOR = ".";
+    
+    /**
+     * Usually hierarchies are separated by ".", as in a role named "user.admin". The separator is configurable
+     * and queried from this service.
+     * @return The hierarchy separator such as a "."
+     */
+    String getHierarchySeparator();
     
     /**
      * <p>
-     * Returns the absolute path names of the children of the given hierarchy
-     * roles/groups node.
+     * Returns absolute path names of a given role, depending on the algorithm.
+     * Path names are decomposed based on the algorithm. There are two kinds of algorithms available:
+     * </p>
+     * <p>
+     * Generalization: given a role "engineering.software.developer", 
+     *          will return ["engineering.software.developer", "engineering.software", "engineering"] 
      * </p>
+     * <p>
+     * Aggregation: given a role "a", all existing subroles are aggregated: 
+     *          will return ["a", "a.b", "a.c", "a.b.b1", a.b.b2", "a.c.c1", etc] 
+     * </p>
      * 
-     * @param prefs Preferences for the role/group
-     * @return Returns absolute path names of the children roles/groups.
+     * @param the role path where we can extract out an array of super roles
+     * @return Returns absolute path names of the dependency roles.
      */
-    public String[] resolveChildren(Preferences prefs);
-        
+    Set<RolePrincipal> resolveRoles(String rolePath);
+
+    /**
+     * <p>
+     * Returns absolute path names of a given group, depending on the algorithm.
+     * Path names are decomposed based on the algorithm. There are two kinds of algorithms available:
+     * </p>
+     * <p>
+     * Generalization: given a group "engineering.software.developer", 
+     *          will return ["engineering.software.developer", "engineering.software", "engineering"] 
+     * </p>
+     * <p>
+     * Aggregation: given a group "a", all existing subgroups are aggregated: 
+     *          will return ["a", "a.b", "a.c", "a.b.b1", a.b.b2", "a.c.c1", etc] 
+     * </p>
+     * 
+     * @param the group path where we can extract out an array of super groups
+     * @return Returns absolute path names of the dependency groups.
+     */    
+    Set<GroupPrincipal> resolveGroups(String groupPath);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PasswordCredential.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PasswordCredential.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PasswordCredential.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PasswordCredential.java Wed Aug  6 20:52:05 2008
@@ -27,7 +27,7 @@
  * @author <a href="mailto:ate@apache.org">Ate Douma</a>
  * @version $Id$
  */
-public interface PasswordCredential
+public interface PasswordCredential extends Credential
 {
     String PASSWORD_CREDENTIAL_DAYS_VALID_REQUEST_ATTR_KEY = PasswordCredential.class.getName() + ".check";
 

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java Wed Aug  6 20:52:05 2008
@@ -22,6 +22,8 @@
 import java.util.Collection;
 import javax.security.auth.Subject;
 
+import org.apache.jetspeed.security.om.InternalPermission;
+
 /**
  * <p>
  * Describe the interface for managing {@link Permission}and permission
@@ -67,7 +69,7 @@
      * @param principals A collection of principal.
      * @return The permissions.
      */
-    Permissions getPermissions(Collection principals);
+    Permissions getPermissions(Collection<Principal> principals);
 
     /**
      * <p>
@@ -148,7 +150,7 @@
      * 
      * @return A Java Security collection of <code>InternalPrincipal</code>
      */
-    Collection getPermissions();    
+    Collection<InternalPermission> getInternalPermissions();    
     
     /**
      * Retrieve a list of all Permissions in the system for a given resource
@@ -169,7 +171,7 @@
      * @return
      * @throws SecurityException
      */
-    int updatePermission(Permission permission, Collection principals)
+    int updatePermission(Permission permission, Collection<Principal> principals)
     throws SecurityException;
     
     /**
@@ -178,5 +180,5 @@
      * @param permission 
      * @return A collection of Java Security Permission objects
      */
-    public Collection getPrincipals(Permission permission);
+    public Collection<Principal> getPrincipals(Permission permission);
 }
\ No newline at end of file

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RemotePrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RemotePrincipal.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RemotePrincipal.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RemotePrincipal.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,22 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security;
+
+public interface RemotePrincipal extends BasePrincipal
+{
+    final String PRINCIPAL_TYPE = "sso";
+}

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Role.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Role.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Role.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/Role.java Wed Aug  6 20:52:05 2008
@@ -17,10 +17,11 @@
 package org.apache.jetspeed.security;
 
 import java.security.Principal;
-import java.util.prefs.Preferences;
+
+import org.apache.jetspeed.security.attributes.SecurityAttributes;
 
 /**
- * <p>A role made of a {@link RolePrincipal} and the role {@link Preferences}.</p>
+ * <p>A role made of a {@link RolePrincipal} and the role security attributes</p>
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
  */
 public interface Role
@@ -38,16 +39,16 @@
     void setPrincipal(Principal rolePrincipal);
 
     /**
-     * <p>Getter for the role {@link Preferences} node, providing access to the
-     * role preferences properties.</p>
-     * @return The {@link Preferences}.
+     * <p>Getter providing access to the
+     * group security attributes.</p>
+     * @return The security attributes for a group
      */
-    Preferences getPreferences();
+    SecurityAttributes getAttributes();
 
     /**
-     * <p>Setter for the role {@link Preferences} node, providing access to the
-     * role preferences properties.</p>
-     * @param preferences The {@link Preferences}.
+     * <p>Setter providing access to the
+     * group security attributes.</p>
+     * @param attributes The security attributes for a group
      */
-    void setPreferences(Preferences preferences);
+    void setAttributes(SecurityAttributes attributes);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RoleManager.java Wed Aug  6 20:52:05 2008
@@ -157,9 +157,9 @@
      * Get all roles available from all role handlers
      * 
      * @param filter The filter used to retrieve matching roles.
-     * @return all roles available as {@link Principal} 
+     * @return all roles available as Role 
      */
-    Iterator getRoles(String filter) throws SecurityException;
+    Collection<Role> getRoles(String filter) throws SecurityException;
     
     /**
      * Enable or disable a role.

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RolePrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RolePrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RolePrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/RolePrincipal.java Wed Aug  6 20:52:05 2008
@@ -23,5 +23,5 @@
  */
 public interface RolePrincipal extends BasePrincipal
 {
-
+    final String PRINCIPAL_TYPE = "role"; 
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java Wed Aug  6 20:52:05 2008
@@ -86,6 +86,8 @@
     /** <p>The dn is invalid.</p> */
     public static final KeyedMessage INVALID_DN = new KeyedMessage("The dn cannot be null or empty.");
     
+    public static final KeyedMessage UNKNOWN_PRINCIPAL_TYPE = new KeyedMessage("Unknown Principal Type provided: {0}");
+    
     /**
      * <p>Default Constructor.</p>
      */

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/User.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/User.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/User.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/User.java Wed Aug  6 20:52:05 2008
@@ -16,10 +16,13 @@
  */
 package org.apache.jetspeed.security;
 
+import java.util.Map;
 import java.util.prefs.Preferences;
 
 import javax.security.auth.Subject;
 
+import org.apache.jetspeed.security.attributes.SecurityAttributes;
+
 /**
  * <p>A user made of a {@link Subject} and the user {@link Preferences}.</p>
  * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
@@ -53,24 +56,28 @@
     void setSubject(Subject subject);
 
     /**
-     * <p>Getter for the user {@link Preferences} node, providing access to the
-     * user preferences properties.</p>
-     * @return The {@link Preferences}.
+     * <p>Getter providing access to the
+     * user security attributes.</p>
+     * @return The security attributes for a user
      */
-    Preferences getPreferences();
+    SecurityAttributes getAttributes();
 
     /**
-     * <p>Setter for the user {@link Preferences} node, providing access to the
-     * user preferences properties.</p>
-     *  
-     * @param preferences The {@link Preferences}.
+     * <p>Setter providing access to the
+     * user security attributes.</p>
+     * @param attributes The security attributes for a user
      */
-    void setPreferences(Preferences preferences);
+    void setAttributes(SecurityAttributes attributes);
     
     /**
-     * Get the user attributes for a given user
-     * @return a preference set of user attributes for a given user
+     * Get the Portlet API User Attributes for a given user
+     * @return a READ ONLY set of user attributes for a given user
      */
-    Preferences getUserAttributes();
+    Map<String, String> getUserAttributes();
     
+    /**
+     * Get the best user principal for this user
+     * @return a user principal
+     */
+    UserPrincipal getUserPrincipal();
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserManager.java Wed Aug  6 20:52:05 2008
@@ -18,7 +18,7 @@
 
 import java.sql.Date;
 import java.util.Collection;
-import java.util.Iterator;
+import java.util.List;
 
 /**
  * <p>
@@ -100,8 +100,7 @@
     
     /**
      * <p>
-     * Remove a user. If there is a {@link java.util.prefs.Preferences}node for
-     * profile properties associated to this user, it will be removed as well.
+     * Remove a user. If there user attributes associated with this user, they will be removed as well.
      * </p>
      * <p>
      * {@link java.security.Permission}for this user will be removed as well.
@@ -141,9 +140,9 @@
      * TODO Complete filter implementation.
      * 
      * @param filter The filter used to retrieve matching users.
-     * @return The Iterator of {@link User}.
+     * @return a collection of {@link User}.
      */
-    Iterator getUsers(String filter) throws SecurityException;
+    Collection<User> getUsers(String filter) throws SecurityException;
 
     /**
      * <p>
@@ -153,9 +152,9 @@
      * TODO Complete filter implementation.
      * 
      * @param filter The filter used to retrieve matching users.
-     * @return The Iterator of {@link User}.
+     * @return A list of user name strings
      */
-    Iterator getUserNames(String filter) throws SecurityException;
+    List<String> getUserNames(String filter) throws SecurityException;
 
     /**
      * <p>
@@ -167,7 +166,7 @@
      * @return A Collection of {@link User}.
      * @throws Throws a security exception if the role does not exist.
      */
-    Collection getUsersInRole(String roleFullPathName) throws SecurityException;
+    Collection<User> getUsersInRole(String roleFullPathName) throws SecurityException;
     
     /**
      * <p>A collection of {@link User} for a specific group.</p>
@@ -176,7 +175,7 @@
      * @return A collection of {@link User}.
      * @throws Throws security exception if the group does not exist.
      */
-    Collection getUsersInGroup(String groupFullPathName) throws SecurityException;
+    Collection<User> getUsersInGroup(String groupFullPathName) throws SecurityException;
     
     /**
      * <p>
@@ -231,4 +230,20 @@
      * @throws Throws a security exception.
      */
     void setPasswordExpiration(String userName, Date expirationDate) throws SecurityException;
+    
+    /**
+     * Updates a user and all attributes and associations
+     * @param user
+     * @throws SecurityException
+     */
+    void updateUser(User user) throws SecurityException;
+    
+    /**
+     * Given any attribute name and value, lookup a set of users that match the name value pairs
+     * @param attributeName
+     * @param attributeValue
+     * @return a collection of users
+     * @throws SecurityException
+     */
+    Collection<User> lookupUsers(String attributeName, String attributeValue) throws SecurityException;
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserPrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/UserPrincipal.java Wed Aug  6 20:52:05 2008
@@ -23,5 +23,5 @@
  */
 public interface UserPrincipal extends BasePrincipal
 {
-
+    final String PRINCIPAL_TYPE = "user"; 
 }

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttribute.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttribute.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttribute.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttribute.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,34 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package org.apache.jetspeed.security.attributes;
+
+
+/**
+ * <p>Security Principals can have one or more attributes, including User Info and general 'preferences'.</p>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface SecurityAttribute
+{
+    String getName();
+    String getType();
+    String getValue();
+    long getPrincipalId();
+    String getPrincipalType();
+    long getAttributeId();
+    void setValue(String value);    
+}

Propchange: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttribute.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributes.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributes.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributes.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,65 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.attributes;
+
+import java.security.Principal;
+import java.util.Map;
+
+public interface SecurityAttributes
+{
+    /** constant used by createUserInformation to store user information attributes */
+    final static String USER_INFORMATION = "user_info";
+    /** constant representing all other security attributes besides user_info, but not limited to */
+    final static String SECURITY_ATTRIBUTE = "attribute";
+
+    /**
+     * Retrieve the security attributes map 
+     * @return the map for a given principal
+     */
+    Map<String, SecurityAttribute> getAttributes();
+ 
+    /**
+     * Retrieve the security attributes map for a given kind of attribute (see constants above)
+     * 
+     * @param type the type of attirbute such as USER_INFORMATION or SECURITY_ATTRIBUTE
+     * @return the map for a given principal
+     */
+    public Map<String, SecurityAttribute> getAttributes(String type);
+    
+    /**
+     * Get the security principal for this set of attributes 
+     * @return
+     */
+    Principal getPrincipal();
+    
+    /**
+     * Create a general security attribute
+     * @param name the name of the security attribute
+     * @param value the string value of the security attribute
+     * @return a newly created security attribute object
+     */
+    SecurityAttribute createAttribute(String name, String value);
+
+    /**
+     * Create a Portlet API User Information type attribute
+     * 
+     * @param name the name of the security attribute, usually a valid Portlet API User information name, see spec
+     * @param value the string value of the security attribute
+     * @return a newly created security attribute object
+     */    
+    SecurityAttribute createUserInformation(String name, String value);
+}

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributesProvider.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributesProvider.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/attributes/SecurityAttributesProvider.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,68 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.attributes;
+
+import java.security.Principal;
+import java.util.Collection;
+
+import org.apache.jetspeed.security.SecurityException;
+
+public interface SecurityAttributesProvider
+{
+    /**
+     * Retrieve all security attributes for a given security principal and return them in a map of SecurityAttribute
+     * 
+     * @param principal A valid Jetspeed principal such as a RolePrincipal, UserPrincipal, or GroupPrincipal
+     * @return SecurityAttributes containing the map of attributes
+     * @throws SecurityException
+     */
+    SecurityAttributes retrieveAttributes(Principal principal) throws SecurityException;
+      
+    /**
+     * Persist the given security attributes to the database. This method will determine which attributes have been modified, deleted or added and update appropriately.
+     *   
+     * @param attributes Contains a map of security attributes to be stored
+     * @throws SecurityException
+     */
+    void saveAttributes(SecurityAttributes attributes) throws SecurityException;
+    
+    /**
+     * Create an empty collection (map) of security attributes for a given Jetspeed principal
+     * 
+     * @param principal A valid Jetspeed principal such as a RolePrincipal, UserPrincipal, or GroupPrincipal
+     * @return a set of security attributes
+     * @throws SecurityException
+     */
+    SecurityAttributes createSecurityAttributes(Principal principal) throws SecurityException;
+    
+    /**
+     * Deletes attributes for a given principal. To delete individual security attributes, delete the specific attribute from the map and then call <code>saveAttributes</code> to commit the deletion.
+     *  
+     * @param principal A valid Jetspeed principal such as a RolePrincipal, UserPrincipal, or GroupPrincipal
+     * @throws SecurityException
+     */
+    void deleteAttributes(Principal principal) throws SecurityException;
+    
+    /**
+     * Given a name value pair of attributes, return a collection of found attributes that match the lookup
+     * @param name
+     * @param value
+     * @return collection of SecurityAttributes
+     * @throws SecurityException
+     */
+    Collection<SecurityAttributes> lookupAttributes(String name, String value) throws SecurityException;
+}

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalGroupPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalGroupPrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalGroupPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalGroupPrincipal.java Wed Aug  6 20:52:05 2008
@@ -24,27 +24,29 @@
  */
 public interface InternalGroupPrincipal extends InternalPrincipal
 {
+    final static String GROUP_TYPE = "group";
+        
     /**
      * <p>Getter for the user principals.</p>
      * @return The user principals.
      */
-    Collection getUserPrincipals();
+    Collection<InternalUserPrincipal> getUserPrincipals();
 
     /**
      * <p>Setter for the user principals.</p>
      * @param userPrincipals The user principals.
      */
-    void setUserPrincipals(Collection userPrincipals);
+    void setUserPrincipals(Collection<InternalUserPrincipal> userPrincipals);
 
     /**
      * <p>Getter for the role principals.</p>
      * @return The role principals.
      */
-    Collection getRolePrincipals();
+    Collection<InternalRolePrincipal> getRolePrincipals();
 
     /**
      * <p>Setter for the role principals.</p>
      * @param rolePrincipals The role principals.
      */
-    void setRolePrincipals(Collection rolePrincipals);
+    void setRolePrincipals(Collection<InternalRolePrincipal> rolePrincipals);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPermission.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPermission.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPermission.java Wed Aug  6 20:52:05 2008
@@ -92,13 +92,13 @@
      * <p>Getter for the permission principals.</p>
      * @return The permission principals.
      */
-    Collection getPrincipals();
+    Collection<InternalPrincipal> getPrincipals();
 
     /**
      * <p>Setter for the permission principals.</p>
      * @param principals The permission principals.
      */
-    void setPrincipals(Collection principals);
+    void setPrincipals(Collection<InternalPrincipal> principals);
 
     /**
      * <p>Getter for creation date.</p>

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipal.java Wed Aug  6 20:52:05 2008
@@ -46,7 +46,6 @@
  */
 public interface InternalPrincipal extends Serializable, Cloneable
 {
-
     /**
      * <p>
      * Getter for the principal id.
@@ -103,29 +102,35 @@
 
     /**
      * <p>
-     * Getter for the principal full path.
+     * Getter for the principal type, usually user | group |  role
      * </p>
+     * @return The principal type
+     */
+    String getType();
+
+    /**
      * <p>
-     * The full path allows to retrieve the principal preferences from the
-     * preferences services.
+     * Getter for the principal name such as a user name
      * </p>
-     * 
-     * @return The principal full path.
-     */
-    String getFullPath();
+     * @return The principal name
+     */    
+    String getName();
 
     /**
      * <p>
-     * Setter for the principal name.
+     * Setter for the principal type.
      * </p>
+     * @param name The principal type, usually role | group | user
+     */
+    void setType(String type);
+    
+    /**
      * <p>
-     * The full path allows to retrieve the principal preferences from the
-     * preferences services.
+     * Setter for the principal name.
      * </p>
-     * 
-     * @param fullPath The principal full path.
+     * @param name The principal name such as a user name
      */
-    void setFullPath(String fullPath);
+    void setName(String name);
 
     /**
      * <p>
@@ -134,7 +139,7 @@
      * 
      * @return The principal permissions.
      */
-    Collection getPermissions();
+    Collection<InternalPermission> getPermissions();
 
     /**
      * <p>
@@ -143,7 +148,7 @@
      * 
      * @param permissions The principal permissions.
      */
-    void setPermissions(Collection permissions);
+    void setPermissions(Collection<InternalPermission> permissions);
 
     /**
      * <p>
@@ -191,5 +196,5 @@
      * Setter for the enabled state</p>
      * @param enabled The enabled state
      */
-    void setEnabled(boolean enabled);    
+    void setEnabled(boolean enabled);
 }
\ No newline at end of file

Added: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipalPreference.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipalPreference.java?rev=683497&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipalPreference.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalPrincipalPreference.java Wed Aug  6 20:52:05 2008
@@ -0,0 +1,9 @@
+package org.apache.jetspeed.security.om;
+
+import java.io.Serializable;
+
+
+public interface InternalPrincipalPreference extends Serializable, Cloneable
+{
+
+}

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalRolePrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalRolePrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalRolePrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalRolePrincipal.java Wed Aug  6 20:52:05 2008
@@ -24,27 +24,29 @@
  */
 public interface InternalRolePrincipal extends InternalPrincipal
 {
+    final static String ROLE_TYPE = "role";
+    
     /**
      * <p>Getter for the user principals.</p>
      * @return The user principals.
      */
-    Collection getUserPrincipals();
+    Collection<InternalUserPrincipal> getUserPrincipals();
 
     /**
      * <p>Setter for the user principals.</p>
      * @param userPrincipals The user principals.
      */
-    void setUserPrincipals(Collection userPrincipals);
+    void setUserPrincipals(Collection<InternalUserPrincipal> userPrincipals);
 
     /**
      * <p>Getter for the group principals.</p>
      * @return The group principals.
      */
-    Collection getGroupPrincipals();
+    Collection<InternalGroupPrincipal> getGroupPrincipals();
 
     /**
      * <p>Setter for the group principals.</p>
      * @param groupPrincipals The group principals.
      */
-    void setGroupPrincipals(Collection groupPrincipals);
+    void setGroupPrincipals(Collection<InternalGroupPrincipal> groupPrincipals);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalUserPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalUserPrincipal.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalUserPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/om/InternalUserPrincipal.java Wed Aug  6 20:52:05 2008
@@ -24,39 +24,41 @@
  */
 public interface InternalUserPrincipal extends InternalPrincipal
 {
+    final static String USER_TYPE = "user";
+    
     /**
      * <p>Getter for the security credentials.</p>
      * @return The credentials.
      */
-    Collection getCredentials();
+    Collection<InternalCredential> getCredentials();
 
     /**
      * <p>Setter for the security credentials.</p>
      * @param credentials The credentials.
      */
-    void setCredentials(Collection credentials);
+    void setCredentials(Collection<InternalCredential> credentials);
 
     /**
      * <p>Getter for the role principals.</p>
      * @return The role principals.
      */
-    Collection getRolePrincipals();
+    Collection<InternalRolePrincipal> getRolePrincipals();
 
     /**
      * <p>Setter for the role principals.</p>
      * @param rolePrincipals The role principals.
      */
-    void setRolePrincipals(Collection rolePrincipals);
+    void setRolePrincipals(Collection<InternalRolePrincipal> rolePrincipals);
 
     /**
      * <p>Getter for the group principals.</p>
      * @return The group principals.
      */
-    Collection getGroupPrincipals();
+    Collection<InternalGroupPrincipal> getGroupPrincipals();
 
     /**
      * <p>Setter for the group principals.</p>
      * @param groupPrincipals The group principals.
      */
-    void setGroupPrincipals(Collection groupPrincipals);
+    void setGroupPrincipals(Collection<InternalGroupPrincipal> groupPrincipals);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/CredentialHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/CredentialHandler.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/CredentialHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/CredentialHandler.java Wed Aug  6 20:52:05 2008
@@ -19,6 +19,7 @@
 import java.sql.Date;
 import java.util.Set;
 
+import org.apache.jetspeed.security.Credential;
 import org.apache.jetspeed.security.SecurityException;
 
 /**
@@ -46,7 +47,7 @@
      * @param username The username.
      * @return The set of public credentials.
      */
-    Set getPublicCredentials(String username);
+    Set<Credential> getPublicCredentials(String username);
     
     /**
      * <p>
@@ -56,7 +57,7 @@
      * @param username The username.
      * @return The set of private credentials.
      */
-    Set getPrivateCredentials(String username);
+    Set<Credential> getPrivateCredentials(String username);
     
     /**
      * <p>

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/GroupSecurityHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/GroupSecurityHandler.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/GroupSecurityHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/GroupSecurityHandler.java Wed Aug  6 20:52:05 2008
@@ -44,20 +44,20 @@
      * Gets the group principal for the group full path name {principal}.{subprincipal}.
      * </p>
      * 
-     * @param groupFullPathName The group full path name.
+     * @param groupName The group full path name.
      * @return The <code>Principal</p>
      */
-    GroupPrincipal getGroupPrincipal(String groupFullPathName);
+    GroupPrincipal getGroupPrincipal(String groupName);
     
     /**
      * <p>
-     * Sets the group principal in the backing store.
+     * Stores the group principal in the backing store.
      * </p>
      * 
      * @param groupPrincipal The <code>GroupPrincipal</code>.
      * @throws SecurityException Throws a {@link SecurityException}.
      */
-    void setGroupPrincipal(GroupPrincipal groupPrincipal) throws SecurityException;
+    void storeGroupPrincipal(GroupPrincipal groupPrincipal) throws SecurityException;
     
     /**
      * <p>
@@ -77,6 +77,6 @@
      * @param filter The filter.
      * @return The list of <code>Principal</code>
      */
-    List getGroupPrincipals(String filter);
+    List<GroupPrincipal> getGroupPrincipals(String filter);
    
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/RoleSecurityHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/RoleSecurityHandler.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/RoleSecurityHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/RoleSecurityHandler.java Wed Aug  6 20:52:05 2008
@@ -45,10 +45,10 @@
      * Gets the role principal for the role full path name {principal}.{subprincipal}.
      * </p>
      * 
-     * @param roleFullPathName The role full path name.
+     * @param roleName The role full path name.
      * @return The <code>Principal</p>
      */
-    RolePrincipal getRolePrincipal(String roleFullPathName);
+    RolePrincipal getRolePrincipal(String roleName);
     
     /**
      * <p>
@@ -58,7 +58,7 @@
      * @param rolePrincipal The <code>RolePrincipal</code>.
      * @throws SecurityException Throws a {@link SecurityException}.
      */
-    void setRolePrincipal(RolePrincipal rolePrincipal) throws SecurityException;
+    void storeRolePrincipal(RolePrincipal rolePrincipal) throws SecurityException;
     
     /**
      * <p>
@@ -78,6 +78,6 @@
      * @param filter The filter.
      * @return The list of <code>Principal</code>
      */
-    List getRolePrincipals(String filter);
+    List<RolePrincipal> getRolePrincipals(String filter);
    
 }  

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityAccess.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityAccess.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityAccess.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityAccess.java Wed Aug  6 20:52:05 2008
@@ -16,8 +16,7 @@
  */
 package org.apache.jetspeed.security.spi;
 
-import java.util.Iterator;
-
+import java.util.Collection;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.om.InternalGroupPrincipal;
 import org.apache.jetspeed.security.om.InternalRolePrincipal;
@@ -75,18 +74,18 @@
      * @param filter The filter.
      * @return Collection of {@link InternalUserPrincipal}.
      */
-    Iterator getInternalUserPrincipals( String filter );
+    Collection<InternalUserPrincipal> getInternalUserPrincipals( String filter );
 
     /**
      * <p>
-     * Sets the given {@link InternalUserPrincipal}.
+     * Store the given {@link InternalUserPrincipal}.
      * </p>
      * 
      * @param internalUser The {@link InternalUserPrincipal}.
      * @param isMappingOnly Whether a principal's purpose is for security mappping only.
      * @throws SecurityException Throws a {@link SecurityException}.
      */
-    void setInternalUserPrincipal( InternalUserPrincipal internalUser, boolean isMappingOnly ) throws SecurityException;
+    void storeInternalUserPrincipal( InternalUserPrincipal internalUser, boolean isMappingOnly ) throws SecurityException;
 
     /**
      * <p>
@@ -110,14 +109,14 @@
 
     /**
      * <p>
-     * Sets the given {@link InternalRolePrincipal}.
+     * Stores the given {@link InternalRolePrincipal}.
      * </p>
      * 
      * @param internalRole The {@link InternalRolePrincipal}.
      * @param isMappingOnly Whether a principal's purpose is for security mappping only.
      * @throws SecurityException Throws a {@link SecurityException}.
      */
-    void setInternalRolePrincipal( InternalRolePrincipal internalRole, boolean isMappingOnly ) throws SecurityException;
+    void storeInternalRolePrincipal( InternalRolePrincipal internalRole, boolean isMappingOnly ) throws SecurityException;
 
     /**
      * <p>
@@ -141,14 +140,14 @@
 
     /**
      * <p>
-     * Sets the given {@link InternalGroupPrincipal}.
+     * Stores the given {@link InternalGroupPrincipal}.
      * </p>
      * 
      * @param internalGroup The {@link InternalGroupPrincipal}.
      * @param isMappingOnly Whether a principal's purpose is for security mappping only.
      * @throws SecurityException Throws a {@link SecurityException}.
      */
-    void setInternalGroupPrincipal( InternalGroupPrincipal internalGroup, boolean isMappingOnly )
+    void storeInternalGroupPrincipal( InternalGroupPrincipal internalGroup, boolean isMappingOnly )
             throws SecurityException;
 
     /**
@@ -169,7 +168,7 @@
      * @param filter The filter.
      * @return Collection of {@link InternalRolePrincipal}.
      */    
-    Iterator getInternalRolePrincipals(String filter);
+    Collection<InternalRolePrincipal> getInternalRolePrincipals(String filter);
     
     /**
      * <p>
@@ -179,6 +178,6 @@
      * @param filter The filter.
      * @return Collection of {@link InternalGroupPrincipal}.
      */    
-    Iterator getInternalGroupPrincipals(String filter);
+    Collection<InternalGroupPrincipal> getInternalGroupPrincipals(String filter);
 
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityMappingHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityMappingHandler.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityMappingHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/SecurityMappingHandler.java Wed Aug  6 20:52:05 2008
@@ -16,10 +16,13 @@
 */
 package org.apache.jetspeed.security.spi;
 
-import java.util.Set;
-
-import org.apache.jetspeed.security.HierarchyResolver;
-import org.apache.jetspeed.security.SecurityException;
+import java.util.Set;
+
+import org.apache.jetspeed.security.GroupPrincipal;
+import org.apache.jetspeed.security.HierarchyResolver;
+import org.apache.jetspeed.security.RolePrincipal;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.UserPrincipal;
 
 /**
  * <p>
@@ -37,40 +40,22 @@
     
     /**
      * <p>
-     * Gets the {@link HierarchyResolver} to be used for resolving role hierarchy.
+     * Gets the {@link HierarchyResolver} to be used for resolving all hierarchies.
      * </p>
      * 
      * @return The role {@link HierarchyResolver}.
      */
-    HierarchyResolver getRoleHierarchyResolver();
+    HierarchyResolver getHierarchyResolver();
     
     /**
      * <p>
-     * Sets the {@link HierarchyResolver} to be used for resolving role hierachy.
+     * Sets the {@link HierarchyResolver} to be used for resolving roles and groups
      * </p>
      * 
      * @param roleHierarchyResolver The role {@link HierarchyResolver}.
      */
-    void setRoleHierarchyResolver(HierarchyResolver roleHierarchyResolver);
-    
-    /**
-     * <p>
-     * Gets the {@link HierarchyResolver} to be used for resolving group hierarchy.
-     * </p>
-     * 
-     * @return The role {@link HierarchyResolver}.
-     */
-    HierarchyResolver getGroupHierarchyResolver();
-    
-    /**
-     * <p>
-     * Sets the {@link HierarchyResolver} used for resolving group hierarchy.
-     * </p>
-     * 
-     * @param groupHierarchyResolver The group {@link HierarchyResolver}.
-     */
-    void setGroupHierarchyResolver(HierarchyResolver groupHierarchyResolver);
-    
+    void setHierarchyResolver(HierarchyResolver hierarchyResolver);
+        
     /**
      * <p>
      * Gets the role principals for the given user according to the relevant hierarchy
@@ -80,7 +65,7 @@
      * @param username The user name.
      * @return A set of <code>Principal</p>
      */
-    Set getRolePrincipals(String username);
+    Set<RolePrincipal> getRolePrincipals(String username);
     
     /**
      * <p>
@@ -122,7 +107,7 @@
      * @param groupFullPathName The group full path name.
      * @return A set of <code>Principal</p>
      */
-    Set getRolePrincipalsInGroup(String groupFullPathName);
+    Set<RolePrincipal> getRolePrincipalsInGroup(String groupFullPathName);
     
     /**
      * <p>
@@ -157,7 +142,7 @@
      * @param username The user name.
      * @return A set of <code>GroupPrincipal</p>
      */
-    Set getGroupPrincipals(String username);
+    Set<GroupPrincipal> getGroupPrincipals(String username);
     
     /**
      * <p>
@@ -168,7 +153,7 @@
      * @param roleFullPathName The role full path name.
      * @return A set of <code>Principal</p>
      */
-    Set getGroupPrincipalsInRole(String roleFullPathName);
+    Set<GroupPrincipal> getGroupPrincipalsInRole(String roleFullPathName);
     
     /**
      * <p>
@@ -179,7 +164,7 @@
      * @param roleFullPathName The role full path name.
      * @return A set of <code>Principal</p>
      */   
-    Set getUserPrincipalsInRole(String roleFullPathName);
+    Set<UserPrincipal> getUserPrincipalsInRole(String roleFullPathName);
     
     /**
      * <p>
@@ -190,7 +175,7 @@
      * @param groupFullPathName The group full path name.
      * @return A set of <code>Principal</p>
      */   
-    Set getUserPrincipalsInGroup(String groupFullPathName);
+    Set<UserPrincipal> getUserPrincipalsInGroup(String groupFullPathName);
     
     /**
      * <p>

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/UserSecurityHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/UserSecurityHandler.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/UserSecurityHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/UserSecurityHandler.java Wed Aug  6 20:52:05 2008
@@ -16,11 +16,10 @@
  */
 package org.apache.jetspeed.security.spi;
 
-import java.security.Principal;
-import java.util.List;
-
-import org.apache.jetspeed.security.SecurityException;
-import org.apache.jetspeed.security.UserPrincipal;
+import java.util.List;
+
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.UserPrincipal;
 
 /**
  * <p>
@@ -56,7 +55,7 @@
      * @param username The user name.
      * @return The <code>Principal</p>
      */
-    Principal getUserPrincipal(String username);
+    UserPrincipal getUserPrincipal(String username);
     
     /**
      * <p>
@@ -66,7 +65,7 @@
      * @param filter The filter.
      * @return The list of <code>Principal</code>
      */
-    List getUserPrincipals(String filter);
+    List<UserPrincipal> getUserPrincipals(String filter);
     
     /**
      * <p>

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserAttributeSource.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserAttributeSource.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserAttributeSource.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserAttributeSource.java Wed Aug  6 20:52:05 2008
@@ -22,6 +22,7 @@
 
 import javax.security.auth.Subject;
 
+import org.apache.jetspeed.om.common.UserAttributeRef;
 import org.apache.jetspeed.request.RequestContext;
 
 /**
@@ -33,6 +34,6 @@
  */
 public interface UserAttributeSource 
 {	
-	Map getUserAttributeMap(Subject subject, Collection userAttributeRefs, RequestContext context) 
+	Map<String, String> getUserAttributeMap(Subject subject, Collection<UserAttributeRef> userAttributeRefs, RequestContext context) 
         throws UserAttributeRetrievalException;
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserInfoManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserInfoManager.java?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserInfoManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserInfoManager.java Wed Aug  6 20:52:05 2008
@@ -58,5 +58,5 @@
      * @param context The request context.
      * @return The {@link PortletRequest.USER_INFO} map.
      */
-    Map getUserInfoMap(ObjectID oid, RequestContext context);
+    Map<String, String> getUserInfoMap(ObjectID oid, RequestContext context);
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml?rev=683497&r1=683496&r2=683497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml Wed Aug  6 20:52:05 2008
@@ -159,23 +159,24 @@
 
     <table name="PORTLET_PREFERENCE_VALUE">
         <column name="PREF_ID" primaryKey="true" required="true" type="INTEGER"/>
-        <column name="INDEX" primaryKey="true" required="true" type="SMALLINT"/>
+        <column name="IDX" primaryKey="true" required="true" type="SMALLINT"/>
         <column name="ENTITY_OID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="USER_NAME" primaryKey="true" required="true" size="80" type="VARCHAR"/>
         <column name="ENTITY_ID" type="VARCHAR" size="80"/>
         <column name="READONLY" required="true" type="BOOLEANINT"/>
         <column name="NULL_VALUE" required="true" type="BOOLEANINT"/>
-        <column name="VALUE" size="4000" type="VARCHAR"/>
+        <column name="PREF_VALUE" size="4000" type="VARCHAR"/>
+
+        <index name="IX_PREFS_PREF_ID">
+            <index-column name="PREF_ID"/>
+        </index>        
         
         <foreign-key foreignTable="PORTLET_PREFERENCE" name="FK_PORTLET_PREFERENCE" onDelete="cascade">
             <reference foreign="ID" local="PREF_ID"/>
         </foreign-key>        
         <foreign-key foreignTable="PORTLET_ENTITY" name="FK_PORTLET_ENTITY" onDelete="cascade">
-            <reference foreign="PEID" local="ENTITY_ID"/>
+            <reference foreign="PEID" local="ENTITY_OID"/>
         </foreign-key>        
-        <index name="IX_PREFS_ENTITY_ID">
-            <index-column name="ENTITY_ID"/>
-        </index>        
     </table>
 
     <!--



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