portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r742669 [2/2] - in /portals/jetspeed-2/portal/branches/JPA_BRANCH: components/jetspeed-capability/src/test/resources/ components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/ components/jetspeed-page-manager/src/test/resourc...
Date Mon, 09 Feb 2009 18:37:07 GMT
Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/JetspeedPersistentSSOSiteManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/JetspeedPersistentSSOSiteManager.java?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/JetspeedPersistentSSOSiteManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/JetspeedPersistentSSOSiteManager.java Mon Feb  9 18:37:05 2009
@@ -0,0 +1,290 @@
+/* 
+ * 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.sso.spi.jpa;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Comparator;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.security.spi.jpa.SecurityManager;
+import org.apache.jetspeed.sso.SSOException;
+import org.apache.jetspeed.sso.SSOSite;
+import org.apache.jetspeed.sso.SSOUser;
+import org.apache.jetspeed.sso.jpa.SSOSiteImpl;
+import org.apache.jetspeed.sso.spi.SSOSiteManagerSPI;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id: JetspeedPersistentSSOSiteManager.java 736069 2009-01-20 19:10:43Z rwatler $
+ */
+@Repository
+public class JetspeedPersistentSSOSiteManager implements SSOSiteManagerSPI
+{
+    /* Logging */
+    private static final Log log = LogFactory.getLog(JetspeedPersistentSSOSiteManager.class);
+
+    /* Security manager component used to manage shared security context */
+    private final SecurityManager securityManager;
+    
+    /**
+     * Create SSO site manager component that shares the security context
+     * and JPA persistence unit with the security component.
+     * 
+     * @param securityManager shared security context
+     */
+    public JetspeedPersistentSSOSiteManager(SecurityManager securityManager)
+    {
+        this.securityManager = securityManager;
+    }
+    
+    /**
+     * Get shared security context entity manager.
+     * 
+     * @return entity manager.
+     */
+    public EntityManager getEntityManager()
+    {
+        return securityManager.getEntityManager();
+    }    
+
+    @Transactional (readOnly=true)
+    public boolean exists(String siteUrl)
+    {
+		return getByUrl(siteUrl) != null;
+	}
+
+    @Transactional (readOnly=true)
+    public SSOSite getById(int id)
+    {
+        // query for sso site with id
+        EntityManager entityManager = getEntityManager();
+        Query siteQuery = entityManager.createNamedQuery("SSO_SITE");
+        siteQuery.setParameter("id", id);
+        try
+        {
+            return (SSOSite)siteQuery.getSingleResult();
+        }
+        catch (NoResultException nre)
+        {            
+        }
+        return null;
+    }
+    
+    @Transactional (readOnly=true)
+	public SSOSite getByName(String siteName)
+	{
+        // query for sso site with name
+        EntityManager entityManager = getEntityManager();
+        Query siteQuery = entityManager.createNamedQuery("SSO_SITE_NAME");
+        siteQuery.setParameter("name", siteName);
+        try
+        {
+            return (SSOSite)siteQuery.getSingleResult();
+        }
+        catch (NoResultException nre)
+        {            
+        }
+        return null;
+	}
+
+    @Transactional (readOnly=true)
+	public SSOSite getByUrl(String siteUrl)
+    {
+        // query for sso site with url
+        EntityManager entityManager = getEntityManager();
+        Query siteQuery = entityManager.createNamedQuery("SSO_SITE_URL");
+        siteQuery.setParameter("url", siteUrl);
+        try
+        {
+            return (SSOSite)siteQuery.getSingleResult();
+        }
+        catch (NoResultException nre)
+        {            
+        }
+        return null;
+    }
+
+    @Transactional (readOnly=true)
+    public SSOSite getSite(SSOUser ssoUser)
+    {        
+        Collection<SSOSite> sitesForUser = getSites(Arrays.asList(new SSOUser[]{ssoUser}));
+        return ((sitesForUser.size() == 1) ? sitesForUser.iterator().next() : null);
+    }
+
+    @Transactional (readOnly=true)
+    @SuppressWarnings("unchecked")
+    public Collection<SSOSite> getSites(String filter)
+    {
+        // query for sso sites like name or url
+        EntityManager entityManager = getEntityManager();
+        Query sitesQuery = entityManager.createNamedQuery("SSO_SITE_LIKE_URL_NAME");
+        filter = filter.replaceAll("%", "\\%");
+        filter = "%"+filter+"%";
+        sitesQuery.setParameter("url", filter);
+        sitesQuery.setParameter("name", filter);
+        return sitesQuery.getResultList();
+    }
+    
+    @Transactional (readOnly=true)
+    @SuppressWarnings("unchecked")
+    public Collection<SSOSite> getSites(Collection<SSOUser> users)
+    {
+        // get security domains from users
+        if (users.isEmpty())
+        {
+            return Collections.EMPTY_LIST;
+        }
+        List<Long> securityDomainIds = new ArrayList<Long>();
+        for (SSOUser user : users)
+        {
+            Long securityDomainId = user.getDomainId();
+            if ((securityDomainId != null) && !securityDomainIds.contains(securityDomainId))
+            {
+                securityDomainIds.add(securityDomainId);
+            }
+        }
+        if (securityDomainIds.isEmpty())
+        {
+            return Collections.EMPTY_LIST;
+        }
+        // query for sso sites by user security domains
+        List<SSOSite> sites = new ArrayList<SSOSite>();
+        for (Long securityDomainId : securityDomainIds)
+        {
+            EntityManager entityManager = getEntityManager();
+            Query sitesQuery = entityManager.createNamedQuery("SSO_SITE_DOMAIN");
+            sitesQuery.setParameter("domainId", securityDomainId);
+            for (SSOSite site : (List<SSOSite>)sitesQuery.getResultList())
+            {
+                if (!sites.contains(site))
+                {
+                    sites.add(site);
+                }
+            }
+        }
+        // sort sso sites by name
+        Collections.sort(sites, new Comparator<SSOSite>()
+        {
+            public int compare(SSOSite site0, SSOSite site1)
+            {
+                if (site0.getName() == null)
+                {
+                    if (site1.getName() == null)
+                    {
+                        return 0;
+                    }
+                    else
+                    {
+                        return Integer.MIN_VALUE;
+                    }                    
+                }
+                else if (site1.getName() == null)
+                {
+                    return Integer.MAX_VALUE;
+                }                
+                return site0.getName().compareTo(site1.getName());
+            }
+        });
+        return sites;
+    }
+
+    public SSOSite newSite()
+    {
+        return new SSOSiteImpl();
+    }
+    
+    @Transactional (readOnly=false, rollbackFor=SSOException.class)
+    public SSOSite add(SSOSite ssoSite) throws SSOException
+    {
+        try
+        {
+            // persist, (potentially detached), site
+            EntityManager entityManager = getEntityManager();
+            if (!((SSOSiteImpl)ssoSite).isNew())
+            {
+                ssoSite = entityManager.merge(ssoSite);
+            }
+            entityManager.persist(ssoSite);
+            // explicitly flush entity manager after update
+            entityManager.flush();            
+            return ssoSite;
+        }
+        catch (Exception e)
+        {
+            String msg = "Unable to add SSO Site: " + ssoSite.getName();
+            log.error(msg, e);
+            throw new SSOException(msg, e);
+        }                
+    }
+    
+    @Transactional (readOnly=false, rollbackFor=SSOException.class)
+    public void remove(SSOSite site) throws SSOException
+    {
+        try
+        {
+            // remove, (potentially detached), site
+            EntityManager entityManager = getEntityManager();
+            if (!((SSOSiteImpl)site).isNew())
+            {
+                site = entityManager.merge(site);
+            }
+            entityManager.persist(site);
+            // explicitly flush entity manager after remove
+            entityManager.flush();            
+        }
+        catch (Exception e)
+        {
+            String msg = "Unable to remove SSO Site: " + site.getName();
+            log.error(msg, e);
+            throw new SSOException(msg, e);
+        }        
+    }
+
+    @Transactional (readOnly=false, rollbackFor=SSOException.class)
+    public void update(SSOSite site) throws SSOException
+    {
+        try
+        {
+            // persist, (potentially detached), site
+            EntityManager entityManager = getEntityManager();
+            if (!((SSOSiteImpl)site).isNew())
+            {
+                site = entityManager.merge(site);
+            }
+            entityManager.persist(site);
+            // explicitly flush entity manager after update
+            entityManager.flush();            
+        }
+        catch (Exception e)
+        {
+            String msg = "Unable to remove SSO Site: " + site.getName();
+            log.error(msg, e);
+            throw new SSOException(msg, e);
+        }        
+    }    
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/SSOUserManagerSPIImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/SSOUserManagerSPIImpl.java?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/SSOUserManagerSPIImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/spi/jpa/SSOUserManagerSPIImpl.java Mon Feb  9 18:37:05 2009
@@ -0,0 +1,180 @@
+/* 
+ * 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.sso.spi.jpa;
+
+import java.util.Collection;
+
+import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.JetspeedPrincipalType;
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.spi.JetspeedDomainPrincipalAccessManager;
+import org.apache.jetspeed.security.spi.JetspeedPrincipalAccessManager;
+import org.apache.jetspeed.security.spi.JetspeedPrincipalStorageManager;
+import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialAccessManager;
+import org.apache.jetspeed.security.spi.UserPasswordCredentialStorageManager;
+import org.apache.jetspeed.sso.SSOUser;
+import org.apache.jetspeed.sso.jpa.SSOUserImpl;
+import org.apache.jetspeed.sso.spi.SSOUserManagerSPI;
+import org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id: SSOUserManagerSPIImpl.java 736069 2009-01-20 19:10:43Z rwatler $
+ */
+@Repository
+public class SSOUserManagerSPIImpl extends AbstractSSOUserManagerSPIImpl implements SSOUserManagerSPI
+{
+    private static final long serialVersionUID = 8515336406606927772L;
+
+    public SSOUserManagerSPIImpl(JetspeedPrincipalType principalType, JetspeedPrincipalAccessManager jpam, JetspeedPrincipalStorageManager jpsm, UserPasswordCredentialStorageManager credentialStorageManager,
+                                 UserPasswordCredentialAccessManager credentialAccessManager, JetspeedDomainPrincipalAccessManager domainPrincipalAccess, SecurityDomainAccessManager domainAccess)
+    {
+        super(principalType, jpam, jpsm, credentialStorageManager, credentialAccessManager, domainPrincipalAccess, domainAccess);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.SSOUserManagerSPI#newUser(java.lang.String, java.lang.Long)
+     */
+    public SSOUser newUser(String name, Long domainId)
+    {
+        SSOUserImpl user = new SSOUserImpl();
+        user.setDomainId(domainId);
+        user.setName(name);
+        return user;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#addUser(java.lang.String, java.lang.Long, org.apache.jetspeed.security.JetspeedPrincipal)
+     */
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public SSOUser addUser(String userName, Long domainId, JetspeedPrincipal ownerPrincipal) throws SecurityException
+    {
+        return super.addUser(userName, domainId, ownerPrincipal);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#removeUser(java.lang.String, java.lang.Long)
+     */
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void removeUser(String userName, Long domainId) throws SecurityException
+    {
+        super.removeUser(userName, domainId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#userExists(java.lang.String, java.lang.Long)
+     */
+    @Transactional (readOnly=true)
+    public boolean userExists(String userName, Long domainId)
+    {
+        return super.userExists(userName, domainId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getUser(java.lang.String, java.lang.Long)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public SSOUser getUser(String userName, Long domainId) throws SecurityException
+    {
+        return super.getUser(userName, domainId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getUsers(java.lang.String, java.lang.Long)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public Collection<SSOUser> getUsers(String nameFilter, Long domainId) throws SecurityException
+    {
+        return super.getUsers(nameFilter, domainId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getUsers(org.apache.jetspeed.security.JetspeedPrincipal)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public Collection<SSOUser> getUsers(JetspeedPrincipal principal) throws SecurityException
+    {
+        return super.getUsers(principal);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getUsers(org.apache.jetspeed.security.JetspeedPrincipal, java.lang.Long)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public Collection<SSOUser> getUsers(JetspeedPrincipal principal, Long domainId) throws SecurityException
+    {
+        return super.getUsers(principal, domainId);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getUserNames(java.lang.String, java.lang.Long)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public Collection<String> getUserNames(String nameFilter, Long domainId) throws SecurityException
+    {
+        return super.getUserNames(nameFilter, domainId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#updateUser(org.apache.jetspeed.sso.SSOUser)
+     */
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void updateUser(SSOUser user) throws SecurityException
+    {
+        super.updateUser(user);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getPasswordCredential(org.apache.jetspeed.sso.SSOUser)
+     */
+    @Transactional (readOnly=true, rollbackFor=SecurityException.class)
+    public PasswordCredential getPasswordCredential(SSOUser user) throws SecurityException
+    {
+        return super.getPasswordCredential(user);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#storePasswordCredential(org.apache.jetspeed.security.PasswordCredential)
+     */
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void storePasswordCredential(PasswordCredential credential) throws SecurityException
+    {
+        super.storePasswordCredential(credential);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#addSSOUserToPrincipal(org.apache.jetspeed.sso.SSOUser, org.apache.jetspeed.security.JetspeedPrincipal)
+     */
+    @Transactional (readOnly=false, rollbackFor=SecurityException.class)
+    public void addSSOUserToPrincipal(SSOUser user, JetspeedPrincipal principal) throws SecurityException
+    {
+        super.addSSOUserToPrincipal(user, principal);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.sso.spi.impl.AbstractSSOUserManagerSPIImpl#getPortalPrincipals(org.apache.jetspeed.sso.SSOUser, java.lang.Long)
+     */
+    @Transactional (readOnly=true)
+    public Collection<JetspeedPrincipal> getPortalPrincipals(SSOUser remoteUser, Long portalPrincipalDomain)    
+    {
+        return super.getPortalPrincipals(remoteUser, portalPrincipalDomain);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/resources/META-INF/persistence.xml?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/resources/META-INF/persistence.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/main/resources/META-INF/persistence.xml Mon Feb  9 18:37:05 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+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.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+
+    <persistence-unit name="jetspeed-security" transaction-type="JTA">
+
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+
+        <jta-data-source>jetspeed-xa</jta-data-source>
+        <non-jta-data-source>jetspeed</non-jta-data-source>
+
+        <class>org.apache.jetspeed.sso.jpa.SSOSiteImpl</class>
+        <class>org.apache.jetspeed.sso.jpa.SSOUserImpl</class>
+
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+
+    </persistence-unit>
+
+</persistence>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java?rev=742669&r1=742668&r2=742669&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/AbstractSecurityTestCase.java Mon Feb  9 18:37:05 2009
@@ -25,17 +25,14 @@
 import javax.security.auth.Subject;
 
 import org.apache.jetspeed.JetspeedActions;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.security.GroupManager;
-import org.apache.jetspeed.security.JetspeedPermission;
 import org.apache.jetspeed.security.PasswordCredential;
-import org.apache.jetspeed.security.PermissionManager;
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityDomain;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.security.SecurityException;
-import org.apache.jetspeed.security.impl.SecurityDomainImpl;
 import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
 import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 
@@ -46,7 +43,7 @@
  * @version $Id$
  *  
  */
-public abstract class AbstractSecurityTestCase extends DatasourceEnabledSpringTestCase
+public abstract class AbstractSecurityTestCase extends JPADatasourceEnabledSpringTestCase
 {
     /** The user manager. */
     protected UserManager ums;
@@ -57,9 +54,6 @@
     /** The role manager. */
     protected RoleManager rms;
 
-    /** The permission manager. */
-    protected PermissionManager pms;
-
     /** needed to seed default domain
      *  TODO: can be removed once the default seed has been adjusted to include the default and system domain
      *
@@ -80,22 +74,21 @@
         rms = (RoleManager) scm.getComponent("org.apache.jetspeed.security.RoleManager");
                 
         // Authorization.
-        pms = (PermissionManager) scm.getComponent("org.apache.jetspeed.security.PermissionManager");
         domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
         domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
         
         // TODO: remove when default seed contains the default domain        
         SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME); 
-        if (domain == null){
-            
-            SecurityDomainImpl newDomain = new SecurityDomainImpl();
+        if (domain == null)
+        {
+            SecurityDomain newDomain = domainStorageManager.newDomain();
             newDomain.setName(SecurityDomain.SYSTEM_NAME);
             domainStorageManager.addDomain(newDomain);
         } 
         domain = domainAccessManager.getDomainByName(SecurityDomain.DEFAULT_NAME); 
-        if (domain == null){
-            
-            SecurityDomainImpl newDomain = new SecurityDomainImpl();
+        if (domain == null)
+        {            
+            SecurityDomain newDomain = domainStorageManager.newDomain();
             newDomain.setName(SecurityDomain.DEFAULT_NAME);
             domainStorageManager.addDomain(newDomain);
         }
@@ -104,15 +97,11 @@
         new JetspeedActions(new String[] {"secure"}, new String[] {});
         
         destroyPrincipals();
-        destroyPermissions();
-
-        
     }
 
     protected void tearDown() throws Exception
     {
         destroyPrincipals();
-        destroyPermissions();
         super.tearDown();
     }
     
@@ -196,12 +185,4 @@
             }
         }
     }
-    
-    protected void destroyPermissions() throws Exception
-    {
-        for (JetspeedPermission p : pms.getPermissions())
-        {
-            pms.removePermission(p);
-        }
-    }
 }
\ No newline at end of file

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOComponent.java?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOComponent.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOComponent.java Mon Feb  9 18:37:05 2009
@@ -0,0 +1,78 @@
+/*
+ * 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.sso;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPASSOComponent
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPASSOComponent extends TestSSOComponent
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPASSOComponent.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-sso.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOManager.java?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOManager.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestOpenJPASSOManager.java Mon Feb  9 18:37:05 2009
@@ -0,0 +1,78 @@
+/*
+ * 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.sso;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.security.spi.jpa.SecurityManagerContext;
+
+/**
+ * TestOpenJPASSOManager
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $         
+ */
+public class TestOpenJPASSOManager extends TestSSOManager
+{
+    private SecurityManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPASSOManager.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.security.AbstractSecurityTestcase#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-sso.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (SecurityManagerContext)scm.createPrototypeComponent("securityManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("securityManagerContext", context);
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java?rev=742669&r1=742668&r2=742669&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOComponent.java Mon Feb  9 18:37:05 2009
@@ -94,13 +94,13 @@
         return new TestSuite(TestSSOComponent.class);
     }
 
-//    /**
-//     * <p>
-//     * Test user root.
-//     * </p>
-//     */
-//    public void testSSOGroup() throws Exception
-//    {
+    /**
+     * <p>
+     * Test user root.
+     * </p>
+     */
+    public void testSSOGroup() throws Exception
+    {
 //        System.out.println("*************************************\n" + "Start Unit Test for SSO Group Support"
 //                + "\n*************************************");
 //
@@ -226,10 +226,10 @@
 //            assertTrue("could not remove user and group. exception caught: " + sex, false);
 //        }
 //
-//    }
-//
-//    public void testSSO() throws Exception
-//    {
+    }
+
+    public void testSSO() throws Exception
+    {
 //        System.out.println("***************************\nStart Unit Test for SSO API\n***************************");
 //
 //        // Create a user
@@ -366,7 +366,7 @@
 //        	throw new Exception(ssoex.getMessage());
 //        }
 //
-//    }
+    }
 
     /**
      * <p>
@@ -384,8 +384,8 @@
     protected String[] getConfigurations()
     {
         String[] confs = super.getConfigurations();
-        List confList = new ArrayList(Arrays.asList(confs));
+        List<String> confList = new ArrayList<String>(Arrays.asList(confs));
         confList.add("sso.xml");
-        return (String[]) confList.toArray(new String[1]);
+        return confList.toArray(new String[confList.size()]);
     }
 }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java?rev=742669&r1=742668&r2=742669&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/java/org/apache/jetspeed/sso/TestSSOManager.java Mon Feb  9 18:37:05 2009
@@ -33,8 +33,7 @@
 import org.apache.jetspeed.security.PrincipalTypeManager;
 import org.apache.jetspeed.security.Role;
 import org.apache.jetspeed.security.User;
-import org.apache.jetspeed.security.impl.RoleImpl;
-import org.apache.jetspeed.sso.impl.SSOUserImpl;
+import org.apache.jetspeed.sso.spi.SSOUserManagerSPI;
 
 /**
  * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
@@ -53,7 +52,8 @@
     public static final String ANOTHER_TESTGROUP = "anotherTestGroup";
 
     /** The property manager. */
-    private static SSOManager ssoManager = null;
+    private SSOManager ssoManager = null;
+    private SSOUserManagerSPI ssoUserManager = null;
     
     private User testuser;
     private User anotherTestuser;
@@ -294,7 +294,8 @@
             
         });
         // add a Jetspeed role principal ==> should be ignored as well
-        s.getPrincipals().add(new RoleImpl("someRole"));
+        Role someRole = rms.newRole("someRole", false);
+        s.getPrincipals().add(someRole);
         
         users = ssoManager.getRemoteUsers(testSite,s);
         assertEquals(2,users.size());
@@ -398,18 +399,38 @@
         
     }
     
-    public void testCredentials() throws Exception {
+    public void testCredentials() throws Exception
+    {
         addTestUser();
         addTestSite();
-        
+
+        // add new user
         SSOUser someRemoteUser = ssoManager.addUser(testSite, testuser, "someRemoteUser", "someRemotePwd");
         PasswordCredential pwd = ssoManager.getCredentials(someRemoteUser);
-        assertEquals("someRemotePwd",pwd.getPassword());
-        
-        ssoManager.setPassword(someRemoteUser,"anotherPassword");
+        assertEquals("someRemotePwd", pwd.getPassword());
+
+        // force restart transaction to simulate next request;
+        // transient password change tracking should not let
+        // password change take effect in transaction
+        endConversationalTxn();
+        startConversationalTxn();
+
+        // test and set password
+        someRemoteUser = ssoManager.getRemoteUser(testSite, "someRemoteUser");
         pwd = ssoManager.getCredentials(someRemoteUser);
-        assertEquals("anotherPassword",pwd.getPassword());
+        assertEquals("someRemotePwd", pwd.getPassword());
+        ssoManager.setPassword(someRemoteUser, "anotherPassword");
+        
+        // force restart transaction to simulate next request;
+        // transient password change tracking should not let
+        // password change take effect in transaction
+        endConversationalTxn();
+        startConversationalTxn();
 
+        // verify committed set password
+        someRemoteUser = ssoManager.getRemoteUser(testSite, "someRemoteUser");
+        pwd = ssoManager.getCredentials(someRemoteUser);
+        assertEquals("anotherPassword", pwd.getPassword());
     }
     
     public void testFetchPortalPrincipals() throws Exception {
@@ -428,13 +449,9 @@
         Collection<JetspeedPrincipal> fetchedPrincipals = ssoManager.getPortalPrincipals(addedUser);
         assertEquals(4,fetchedPrincipals.size());
 
-        SSOUserImpl nonExistingUser = new SSOUserImpl();
-        nonExistingUser.setName("fake");
-        nonExistingUser.setDomainId(addedUser.getDomainId());
+        SSOUser nonExistingUser = ssoUserManager.newUser("fake", addedUser.getDomainId());
         fetchedPrincipals = ssoManager.getPortalPrincipals(nonExistingUser);
         assertEquals(0,fetchedPrincipals.size());
-        
-
     }
     
     public void addTestSite() throws Exception {
@@ -471,6 +488,7 @@
         try
         {
             ssoManager = (SSOManager) scm.getComponent("org.apache.jetspeed.sso.SSOManager");
+            ssoUserManager = (SSOUserManagerSPI) scm.getComponent("org.apache.jetspeed.sso.spi.impl.SSOUserManagerSPIImpl");
         }
         catch (Exception ex)
         {
@@ -478,9 +496,7 @@
             throw new Exception("Exception while setup SSO TEST");
         }
 
-
         clean();
-
     }
 
    
@@ -547,8 +563,8 @@
     protected String[] getConfigurations()
     {
         String[] confs = super.getConfigurations();
-        List confList = new ArrayList(Arrays.asList(confs));
+        List<String> confList = new ArrayList<String>(Arrays.asList(confs));
         confList.add("sso.xml");
-        return (String[]) confList.toArray(new String[1]);
+        return confList.toArray(new String[confList.size()]);
     }
 }

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jndi.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jndi.properties?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jndi.properties (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jndi.properties Mon Feb  9 18:37:05 2009
@@ -0,0 +1,25 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# JNDI Naming Configuration
+#
+# $Id: $
+#
+# ------------------------------------------------------------------------
+
+java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
+java.naming.factory.url.pkgs=org.apache.naming

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jpa-sso.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jpa-sso.xml?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jpa-sso.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/jpa-sso.xml Mon Feb  9 18:37:05 2009
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <!-- Jetspeed XA DataSource -->
+    <bean id="JetspeedXADS" class="org.springframework.jndi.JndiObjectFactoryBean">
+        <property name="resourceRef" value="false"/>
+        <property name="jndiName" value="java:comp/env/jdbc/jetspeed-xa"/>
+    </bean>
+
+    <!-- JPA Configuration -->
+    <bean id="persistenceUnitManager" class="org.apache.jetspeed.components.rdbms.jpa.MergingPersistenceUnitManager">
+        <property name="dataSources">
+            <map>
+                <entry key="jetspeed-xa" value-ref="JetspeedXADS"/>
+                <entry key="jetspeed" value-ref="JetspeedDS"/>
+            </map>
+        </property>
+        <property name="defaultDataSource" ref="JetspeedDS"/>
+        <property name="persistenceXmlLocations">
+            <list>
+                <value>classpath*:META-INF/persistence.xml</value>
+            </list>
+        </property>
+    </bean>
+    <bean id="abstractEntityManagerFactory" abstract="true" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
+    </bean>
+
+    <!-- Spring/Atomikos/JTA Transaction Manager -->
+    <bean id="atomikosUserTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce">
+        <constructor-arg>
+            <props>
+                <!-- standard atomikos standalone configuration -->
+                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
+                <!-- server/process name overrides for log file names -->
+                <prop key="com.atomikos.icatch.tm_unique_name">${com.atomikos.icatch.tm_unique_name}</prop>
+                <prop key="com.atomikos.icatch.log_base_dir">${com.atomikos.icatch.log_base_dir}</prop>
+                <prop key="com.atomikos.icatch.log_base_name">${com.atomikos.icatch.log_base_name}</prop>
+                <prop key="com.atomikos.icatch.output_dir">${com.atomikos.icatch.output_dir}</prop>
+                <prop key="com.atomikos.icatch.console_file_name">${com.atomikos.icatch.console_file_name}</prop>
+            </props>
+        </constructor-arg>
+    </bean>
+    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" depends-on="atomikosUserTransactionService">
+        <property name="forceShutdown" value="true"/>
+    </bean>
+    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
+        <property name="transactionManager" ref="atomikosTransactionManager"/>
+        <property name="userTransactionName" value="java:comp/UserTransaction"/>
+    </bean>
+    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+    <!-- Spring Transaction Annotations -->
+    <tx:annotation-driven transaction-manager="jtaTransactionManager"/>
+
+    <!-- JPA/OpenJPA Security/SSO Components -->
+    <bean id="org.apache.jetspeed.sso.spi.SSOSiteManager" class="org.apache.jetspeed.sso.spi.jpa.JetspeedPersistentSSOSiteManager">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.CredentialPasswordEncoder" class="org.apache.jetspeed.security.spi.impl.MessageDigestCredentialPasswordEncoder">
+        <constructor-arg index="0"><value>SHA-1</value></constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.CredentialPasswordValidator" class="org.apache.jetspeed.security.spi.impl.DefaultCredentialPasswordValidator">
+    </bean>
+    <bean id="org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager" class="org.apache.jetspeed.security.spi.jpa.UserPasswordCredentialPolicyManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.CredentialPasswordEncoder"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.CredentialPasswordValidator"/>
+        <constructor-arg index="2">
+            <list>
+                <bean class="org.apache.jetspeed.security.spi.impl.ValidatePasswordOnLoadInterceptor"/>
+                <bean class="org.apache.jetspeed.security.spi.impl.EncodePasswordOnFirstLoadInterceptor"/>
+            </list>
+        </constructor-arg>
+    </bean>
+    <bean id="org.apache.jetspeed.security.spi.UserPasswordCredentialManager" class="org.apache.jetspeed.security.spi.jpa.UserPasswordCredentialManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.UserPasswordCredentialPolicyManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.user" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="user"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.UserImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.user.subsite"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.prefered.locale"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.given"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.family"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.role" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="role"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.RoleImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="role.display.name"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.group" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="group"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.security.jpa.GroupImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="group.display.name"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.JetspeedPrincipalType.sso_user" class="org.apache.jetspeed.security.impl.JetspeedPrincipalTypeImpl">
+        <constructor-arg index="0" value="sso_user"/>
+        <constructor-arg index="1" value="org.apache.jetspeed.sso.jpa.SSOUserImpl"/>
+        <constructor-arg index="2">
+            <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypesImpl">
+                <constructor-arg index="0"><value>true</value></constructor-arg>
+                <constructor-arg index="1"><value>false</value></constructor-arg>
+                <constructor-arg index="2">
+                    <list>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.user.subsite"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.prefered.locale"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="org.apache.jetspeed.sso.user.shared"/>
+                            <constructor-arg index="1" value="jetspeed"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.given"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                        <bean class="org.apache.jetspeed.security.impl.SecurityAttributeTypeImpl">
+                            <constructor-arg index="0" value="user.name.family"/>
+                            <constructor-arg index="1" value="info"/>
+                        </bean>
+                    </list>
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.UserManager" class="org.apache.jetspeed.security.jpa.UserManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="5" ref="org.apache.jetspeed.security.spi.UserPasswordCredentialManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.GroupManager" class="org.apache.jetspeed.security.jpa.GroupManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.RoleManager" class="org.apache.jetspeed.security.jpa.RoleManagerImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.role"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.JetspeedPrincipalType.user"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.JetspeedPrincipalType.group"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.sso.SSOUserManager" name="org.apache.jetspeed.sso.spi.impl.SSOUserManagerSPIImpl" class="org.apache.jetspeed.sso.spi.jpa.SSOUserManagerSPIImpl">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.JetspeedPrincipalType.sso_user"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="3" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="5" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <constructor-arg index="6" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>    
+    </bean>
+
+    <bean id="userIsMemberOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="userIsMemberOfGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsMemberOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsMemberOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="roleIsARoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsAPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="roleIsPartOfRoleAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsPartOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.RoleManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsAGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsAPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="groupIsPartOfGroupAssociationHandler" class="org.apache.jetspeed.security.spi.impl.IsPartOfPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+    <bean id="ssoUserIsOwnedByUserAssociationHandler" class="org.apache.jetspeed.sso.impl.IsOwnedByPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.sso.SSOUserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="ssoUserIsOwnedByGroupAssociationHandler" class="org.apache.jetspeed.sso.impl.IsOwnedByPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.sso.SSOUserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="ssoUserIsRelatedToUserAssociationHandler" class="org.apache.jetspeed.sso.impl.IsRemoteIdentityForPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.sso.SSOUserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.UserManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+    <bean id="ssoUserIsRelatedGroupAssociationHandler" class="org.apache.jetspeed.sso.impl.IsRemoteIdentityForPrincipalAssociationHandler">
+        <constructor-arg index="0" ref="org.apache.jetspeed.sso.SSOUserManager"/>
+        <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager"/>
+        <constructor-arg index="2" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+    <bean id="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider" class="org.apache.jetspeed.security.impl.JetspeedPrincipalManagerProviderImpl">
+        <constructor-arg index="0">
+            <set>
+                <ref bean="org.apache.jetspeed.security.UserManager"/>
+                <ref bean="org.apache.jetspeed.security.GroupManager"/>
+                <ref bean="org.apache.jetspeed.security.RoleManager"/>
+                <ref bean="org.apache.jetspeed.sso.SSOUserManager"/>
+            </set>
+        </constructor-arg>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetClass" value="org.apache.jetspeed.security.impl.TransientJetspeedPrincipal"/>
+        <property name="targetMethod" value="setJetspeedPrincipalManagerProvider"/>
+        <property name="arguments">
+            <list>
+                <ref bean="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"/>
+            </list>
+        </property>
+    </bean>
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetClass" value="org.apache.jetspeed.security.impl.BaseJetspeedPrincipalManager"/>
+        <property name="targetMethod" value="setJetspeedPrincipalManagerProvider"/>
+        <property name="arguments">
+            <list>
+                <ref bean="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"/>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="org.apache.jetspeed.sso.SSOManager" class="org.apache.jetspeed.sso.impl.SSOManagerImpl">
+        <property name="userManager" ref="org.apache.jetspeed.security.UserManager"/>
+        <property name="SSOUserManagerSPI" ref="org.apache.jetspeed.sso.SSOUserManager"/>
+        <property name="domainAccessManager" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <property name="domainStorageManager" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+        <property name="SSOSiteManagerSPI" ref="org.apache.jetspeed.sso.spi.SSOSiteManager"/>
+    </bean>
+    
+    <!-- JPA Security Manager Context -->
+    <bean id="securityManagerContext" class="org.apache.jetspeed.security.spi.jpa.SecurityManagerContext" scope="prototype" init-method="initialize" destroy-method="terminate">
+        <property name="securityManager" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager"/>
+    </bean>
+
+</beans>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/log4j.properties?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/log4j.properties (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/log4j.properties Mon Feb  9 18:37:05 2009
@@ -0,0 +1,78 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id: log4j.properties 731466 2009-01-05 06:04:13Z rwatler $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootCategory = ERROR, errorlogging
+
+#log4j.category.openjpa.Tool = INFO, infologging
+#log4j.category.openjpa.Runtime = INFO, infologging
+#log4j.category.openjpa.Remote = WARN, infologging
+#log4j.category.openjpa.DataCache = WARN, infologging
+#log4j.category.openjpa.MetaData = WARN, infologging
+#log4j.category.openjpa.Enhance = WARN, infologging
+#log4j.category.openjpa.Query = WARN, infologging
+#log4j.category.openjpa.jdbc.SQL = WARN, infologging
+#log4j.category.openjpa.jdbc.JDBC = WARN, infologging
+#log4j.category.openjpa.jdbc.Schema = WARN, infologging
+
+log4j.category.org.springframework = DEBUG, infologging
+log4j.additivity.org.springframework = false
+
+log4j.category.openjpa.Tool = TRACE, infologging
+log4j.additivity.openjpa.Tool = false
+log4j.category.openjpa.Runtime = TRACE, infologging
+log4j.additivity.openjpa.Runtime = false
+log4j.category.openjpa.Remote = TRACE, infologging
+log4j.additivity.openjpa.Remote = false
+log4j.category.openjpa.DataCache = TRACE, infologging
+log4j.additivity.openjpa.DataCache = false
+log4j.category.openjpa.MetaData = TRACE, infologging
+log4j.additivity.openjpa.MetaData = false
+log4j.category.openjpa.Enhance = TRACE, infologging
+log4j.additivity.openjpa.Enhance = false
+log4j.category.openjpa.Query = TRACE, infologging
+log4j.additivity.openjpa.Query = false
+log4j.category.openjpa.jdbc.SQL = TRACE, infologging
+log4j.additivity.openjpa.jdbc.SQL = false
+#log4j.category.openjpa.jdbc.JDBC = TRACE, infologging
+log4j.category.openjpa.jdbc.JDBC = DEBUG, infologging
+log4j.additivity.openjpa.jdbc.JDBC = false
+log4j.category.openjpa.jdbc.Schema = TRACE, infologging
+log4j.additivity.openjpa.jdbc.Schema = false
+
+log4j.category.org.apache.jetspeed = DEBUG, infologging
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.category.atomikos = DEBUG, infologging
+log4j.additivity.atomikos = false
+
+log4j.appender.errorlogging = org.apache.log4j.FileAppender
+log4j.appender.errorlogging.file = ${basedir}/target/surefire-reports/tests-error.log
+log4j.appender.errorlogging.layout = org.apache.log4j.PatternLayout
+log4j.appender.errorlogging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.errorlogging.append = false
+
+log4j.appender.infologging = org.apache.log4j.FileAppender
+log4j.appender.infologging.file = ${basedir}/target/surefire-reports/tests-info.log
+log4j.appender.infologging.layout = org.apache.log4j.PatternLayout
+log4j.appender.infologging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.infologging.append = false

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml?rev=742669&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml Mon Feb  9 18:37:05 2009
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <import resource="jpa-sso.xml"/>
+
+    <!-- OpenJPA/Atomikos Configuration -->
+    <bean id="jpaSecurityProperties" class="org.apache.jetspeed.components.rdbms.jpa.OpenJPAConfigurationProperties">
+        <property name="jpaProperties">
+            <props>
+		        <prop key="openjpa.ConnectionFactoryMode">managed</prop>
+		        <prop key="openjpa.TransactionMode">managed</prop>
+		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
+            </props>
+        </property>
+    </bean>
+    <bean id="securityEntityManagerFactory" parent="abstractEntityManagerFactory">
+        <property name="persistenceUnitName" value="jetspeed-security"/>
+        <property name="jpaProperties" ref="jpaSecurityProperties"/>
+        <property name="jpaDialect">
+            <bean class="org.springframework.orm.jpa.vendor.OpenJpaDialect"/>
+        </property>
+    </bean>
+
+    <!-- OpenJPA Security Components -->
+    <bean id="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" name="org.apache.jetspeed.security.spi.SecurityDomainStorageManager,org.apache.jetspeed.security.spi.SecurityDomainAccessManager" class="org.apache.jetspeed.security.spi.jpa.OpenJPAJetspeedSecurityPersistenceManager" init-method="initialize" destroy-method="terminate">
+    </bean>
+
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java?rev=742669&r1=742668&r2=742669&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalType.java Mon Feb  9 18:37:05 2009
@@ -32,8 +32,8 @@
     String ROLE = "role";
     /** build-in supported JetspeedPrincipalType "user" */
     String USER = "user";
-    /** build-in supported JetspeedPrincipalType "ssoUser" */
-    String SSO_USER = "ssoUser";
+    /** build-in supported JetspeedPrincipalType "sso_user" */
+    String SSO_USER = "sso_user";
     
     /**
      * The name to identify the type of a JetspeedPrincipal.

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityDomain.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityDomain.java?rev=742669&r1=742668&r2=742669&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityDomain.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityDomain.java Mon Feb  9 18:37:05 2009
@@ -40,6 +40,14 @@
      * @return name
      */
     String getName();
+
+    
+    /**
+     * Set unique string identifier for this domain.
+     * 
+     * @param name
+     */
+    void setName(String name);
     
     /**
      * Returns the id of the domain which is the owner of this domain. This feature is used
@@ -50,6 +58,13 @@
     Long getOwnerDomainId();
     
     /**
+     * Set id of the domain which is the owner of this domain.
+     * 
+     * @param domainId
+     */
+    void setOwnerDomainId(Long domainId);
+    
+    /**
      * Returns whether this domain constitutes a local (false) or remote (true) domain. Remote 
      * domains are accessed via the SSO component.
      * @return remote
@@ -57,8 +72,22 @@
     boolean isRemote();
     
     /**
+     * Set whether this domain constitutes a local or remote domain.
+     * 
+     * @param remote
+     */
+    void setRemote(boolean remote);
+    
+    /**
      * Returns whether this domain is enabled or not.
      * @return enabled
      */
     boolean isEnabled();
+
+    /**
+     * Set whether this domain is enabled or not.
+     * 
+     * @param enabled
+     */
+    void setEnabled(boolean enabled);
 }



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


Mime
View raw message