archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [28/40] archiva-redback-core git commit: Set JPA as default and only database backend
Date Sun, 21 May 2017 21:47:13 GMT
Set JPA as default and only database backend

Remove JDO dependencies and set the JPA implementations as only implementation
for database backend providers. Uses the same database as JDO before.


Project: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/commit/2add7925
Tree: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/tree/2add7925
Diff: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/diff/2add7925

Branch: refs/heads/master
Commit: 2add792524d77fc26a68c50dae0f64410aa8507c
Parents: 96b6771
Author: Martin Stockhammer <martin_s@apache.org>
Authored: Fri Dec 30 15:33:17 2016 +0100
Committer: Martin Stockhammer <martin_s@apache.org>
Committed: Fri Dec 30 15:33:17 2016 +0100

----------------------------------------------------------------------
 pom.xml                                         |  18 +-
 .../resources/META-INF/persistence-hsqldb.xml   |   5 +-
 .../src/main/resources/META-INF/persistence.xml |   8 +-
 .../archiva/redback/config-defaults.properties  |   2 +-
 redback-data-management/pom.xml                 |  10 +-
 .../management/JdoDataManagementTool.java       | 307 -------------------
 .../redback/management/DataManagementTest.java  |  22 +-
 .../src/test/resources/spring-context.xml       |  19 --
 .../integration/mail/MailGeneratorTest.java     |  40 +--
 .../src/test/resources/spring-context.xml       |  14 -
 .../redback-rest/redback-rest-services/pom.xml  |   4 +
 .../rest/services/DefaultLoginService.java      |   4 +-
 .../services/FakeCreateAdminServiceImpl.java    |   4 +-
 .../src/test/resources/security.properties      |   2 +-
 redback-keys/redback-keys-providers/pom.xml     |   3 +-
 .../redback-keys-cached/pom.xml                 |   6 +-
 .../redback/keys/cached/CachedKeyManager.java   |   2 +-
 .../src/test/resources/spring-context.xml       |  44 ++-
 redback-rbac/redback-rbac-providers/pom.xml     |   3 +-
 .../redback-rbac-cached/pom.xml                 |   4 -
 .../redback/rbac/cached/CachedRbacManager.java  |   2 +-
 .../src/test/resources/spring-context.xml       |  13 -
 .../redback/rbac/jpa/JpaRbacManager.java        |  22 +-
 .../redback/rbac/jpa/JpaRbacManagerTest.java    |   1 -
 .../redback-rbac-ldap/pom.xml                   |   4 -
 .../src/test/resources/spring-context.xml       |  14 -
 .../src/test/resources/spring-context.xml       |  13 -
 redback-rbac/redback-rbac-role-manager/pom.xml  |   9 -
 .../redback/role/JpoxRoleManagerTest.java       |  36 +--
 .../src/test/resources/jpox-spring-context.xml  |  31 +-
 .../src/test/resources/spring-context.xml       |  13 -
 .../src/test/resources/spring-context.xml       |  12 -
 redback-users/redback-users-providers/pom.xml   |   1 -
 .../redback-users-cached/pom.xml                |   4 -
 34 files changed, 113 insertions(+), 583 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 18cce4f..c2b68e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,11 +148,6 @@
       </dependency>
       <dependency>
         <groupId>org.apache.archiva.redback</groupId>
-        <artifactId>redback-common-jdo</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.archiva.redback</groupId>
         <artifactId>redback-common-ldap</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -183,7 +178,7 @@
       </dependency>
       <dependency>
         <groupId>org.apache.archiva.redback</groupId>
-        <artifactId>redback-keys-jdo</artifactId>
+        <artifactId>redback-keys-jpa</artifactId>
         <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -218,11 +213,6 @@
       </dependency>
       <dependency>
         <groupId>org.apache.archiva.redback</groupId>
-        <artifactId>redback-users-jdo</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.archiva.redback</groupId>
         <artifactId>redback-users-jpa</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -278,11 +268,6 @@
       </dependency>
       <dependency>
         <groupId>org.apache.archiva.redback</groupId>
-        <artifactId>redback-rbac-jdo</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.archiva.redback</groupId>
         <artifactId>redback-rbac-jpa</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -831,6 +816,7 @@
             <exclude>build-number.txt</exclude>
             <!-- IntelliJ IDEA files -->
             <exclude>.idea/**</exclude>
+            <exclude>**/*.iml</exclude>
             <!-- Eclipse files -->
             <exclude>.project</exclude>
             <exclude>.classpath</exclude>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence-hsqldb.xml
----------------------------------------------------------------------
diff --git a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence-hsqldb.xml b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence-hsqldb.xml
index 82da347..54255d9 100644
--- a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence-hsqldb.xml
+++ b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence-hsqldb.xml
@@ -32,10 +32,13 @@
       <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
       <property name="openjpa.ConnectionUserName" value="sa"/>
       <property name="openjpa.ConnectionPassword" value=""/>
-      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
       <property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)" />
       <property name="openjpa.jdbc.MappingDefaults"
                 value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE"/>
+      <property name="openjpa.jdbc.DBDictionary" value="(disableSchemaFactoryColumnTypeErrors=true,BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_YN)"/>
+
     </properties>
   </persistence-unit>
 </persistence>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
index 602cd97..8ea770a 100644
--- a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
+++ b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
@@ -20,7 +20,7 @@
 <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
     <persistence-unit name="redback-jpa">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <non-jta-data-source>java:comp/env/jdbc/redbackjpa</non-jta-data-source>
+        <non-jta-data-source>java:comp/env/jdbc/users</non-jta-data-source>
         <class>org.apache.archiva.redback.users.jpa.model.JpaUser</class>
         <class>org.apache.archiva.redback.rbac.jpa.model.JpaOperation</class>
         <class>org.apache.archiva.redback.rbac.jpa.model.JpaResource</class>
@@ -31,10 +31,10 @@
         <properties>
           <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
           <property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)" />
-            <property name="openjpa.jdbc.MappingDefaults"
+          <property name="openjpa.jdbc.MappingDefaults"
                       value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
-            <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE"/>
-           <property name="openjpa.jdbc.DBDictionary" value="(disableSchemaFactoryColumnTypeErrors=true,BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_YN)"/>
+          <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE"/>
+          <property name="openjpa.jdbc.DBDictionary" value="(disableSchemaFactoryColumnTypeErrors=true,BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_YN)"/>
         </properties>
     </persistence-unit>
 </persistence>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-configuration/src/main/resources/org/apache/archiva/redback/config-defaults.properties
----------------------------------------------------------------------
diff --git a/redback-configuration/src/main/resources/org/apache/archiva/redback/config-defaults.properties b/redback-configuration/src/main/resources/org/apache/archiva/redback/config-defaults.properties
index 402aaf9..78ff047 100644
--- a/redback-configuration/src/main/resources/org/apache/archiva/redback/config-defaults.properties
+++ b/redback-configuration/src/main/resources/org/apache/archiva/redback/config-defaults.properties
@@ -130,7 +130,7 @@ ldap.bind.authenticator.enabled=false
 #ldap.config.authentication.method=
 
 # config parameter for the ConfigurableUserManager
-user.manager.impl=jdo
+user.manager.impl=jpa
 
 
 

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-data-management/pom.xml
----------------------------------------------------------------------
diff --git a/redback-data-management/pom.xml b/redback-data-management/pom.xml
index c232c3a..a882f78 100644
--- a/redback-data-management/pom.xml
+++ b/redback-data-management/pom.xml
@@ -35,15 +35,15 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-rbac-jdo</artifactId>
+      <artifactId>redback-users-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-keys-jdo</artifactId>
+      <artifactId>redback-rbac-model</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-users-jdo</artifactId>
+      <artifactId>redback-keys-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
@@ -88,6 +88,10 @@
       <artifactId>jul-to-slf4j</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+    </dependency>
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java
----------------------------------------------------------------------
diff --git a/redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java b/redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java
deleted file mode 100644
index 7b625b7..0000000
--- a/redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java
+++ /dev/null
@@ -1,307 +0,0 @@
-package org.apache.archiva.redback.management;
-
-/*
- * 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.
- */
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.archiva.redback.keys.AuthenticationKey;
-import org.apache.archiva.redback.keys.KeyManager;
-import org.apache.archiva.redback.keys.jdo.AuthenticationKeyDatabase;
-import org.apache.archiva.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxReader;
-import org.apache.archiva.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxWriter;
-import org.apache.archiva.redback.rbac.Operation;
-import org.apache.archiva.redback.rbac.Permission;
-import org.apache.archiva.redback.rbac.RbacManagerException;
-import org.apache.archiva.redback.rbac.Role;
-import org.apache.archiva.redback.rbac.jdo.RbacDatabase;
-import org.apache.archiva.redback.rbac.jdo.io.stax.RbacJdoModelStaxReader;
-import org.apache.archiva.redback.rbac.jdo.io.stax.RbacJdoModelStaxWriter;
-import org.apache.archiva.redback.users.UserManager;
-import org.apache.archiva.redback.keys.KeyManagerException;
-import org.apache.archiva.redback.rbac.RBACManager;
-import org.apache.archiva.redback.rbac.Resource;
-import org.apache.archiva.redback.rbac.UserAssignment;
-import org.apache.archiva.redback.users.User;
-import org.apache.archiva.redback.users.UserManagerException;
-import org.apache.archiva.redback.users.jdo.UserDatabase;
-import org.apache.archiva.redback.users.jdo.io.stax.UsersManagementStaxReader;
-import org.apache.archiva.redback.users.jdo.io.stax.UsersManagementStaxWriter;
-import org.apache.commons.io.IOUtils;
-import org.springframework.stereotype.Service;
-
-/**
- * JDO implementation of the data management tool.
- *
- * TODO do we really need JDO specifics here? Could optimize by going straight to JDOFactory
- * TODO check whether this current method logs everything unnecessarily.
- */
-@Service("dataManagementTool#jdo")
-public class JdoDataManagementTool
-    implements DataManagementTool
-{
-    private static final String USERS_XML_NAME = "users.xml";
-
-    private static final String KEYS_XML_NAME = "keys.xml";
-
-    private static final String RBAC_XML_NAME = "rbac.xml";
-
-    public void backupRBACDatabase( RBACManager manager, File backupDirectory )
-        throws RbacManagerException, IOException, XMLStreamException
-    {
-        RbacDatabase database = new RbacDatabase();
-        database.setRoles( manager.getAllRoles() );
-        database.setUserAssignments( manager.getAllUserAssignments() );
-        database.setPermissions( manager.getAllPermissions() );
-        database.setOperations( manager.getAllOperations() );
-        database.setResources( manager.getAllResources() );
-
-        RbacJdoModelStaxWriter writer = new RbacJdoModelStaxWriter();
-        Writer fileWriter = createWriter( backupDirectory, RBAC_XML_NAME, database.getModelEncoding() );
-        try
-        {
-            writer.write( fileWriter, database );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileWriter );
-        }
-    }
-
-    public void backupUserDatabase( UserManager manager, File backupDirectory )
-        throws IOException, XMLStreamException, UserManagerException
-    {
-        UserDatabase database = new UserDatabase();
-        database.setUsers( manager.getUsers() );
-
-        UsersManagementStaxWriter writer = new UsersManagementStaxWriter();
-        Writer fileWriter = createWriter( backupDirectory, USERS_XML_NAME, database.getModelEncoding() );
-        try
-        {
-            writer.write( fileWriter, database );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileWriter );
-        }
-    }
-
-    public void backupKeyDatabase( KeyManager manager, File backupDirectory )
-        throws IOException, XMLStreamException
-    {
-        try
-        {
-            manager.removeExpiredKeys();
-        }
-        catch ( KeyManagerException e )
-        {
-            throw new IOException( "Error removing expired keys" );
-        }
-
-        AuthenticationKeyDatabase database = new AuthenticationKeyDatabase();
-        database.setKeys( manager.getAllKeys() );
-
-        RedbackKeyManagementJdoStaxWriter writer = new RedbackKeyManagementJdoStaxWriter();
-        Writer fileWriter = createWriter( backupDirectory, KEYS_XML_NAME, database.getModelEncoding() );
-        try
-        {
-            writer.write( fileWriter, database );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileWriter );
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public void restoreRBACDatabase( RBACManager manager, File backupDirectory )
-        throws IOException, XMLStreamException, RbacManagerException
-    {
-        RbacJdoModelStaxReader reader = new RbacJdoModelStaxReader();
-
-        FileReader fileReader = new FileReader( new File( backupDirectory, RBAC_XML_NAME ) );
-
-        RbacDatabase database;
-        try
-        {
-            database = reader.read( fileReader );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileReader );
-        }
-
-        Map<String, Permission> permissionMap = new HashMap<String, Permission>();
-        Map<String, Resource> resources = new HashMap<String, Resource>();
-        Map<String, Operation> operations = new HashMap<String, Operation>();
-        for ( Role role : (List<Role>) database.getRoles() )
-        {
-            // TODO: this could be generally useful and put into saveRole itself as long as the performance penalty isn't too harsh.
-            //   Currently it always saves everything where it could pull pack the existing permissions, etc if they exist
-            List<Permission> permissions = new ArrayList<Permission>();
-            for ( Permission permission : role.getPermissions() )
-            {
-                if ( permissionMap.containsKey( permission.getName() ) )
-                {
-                    permission = permissionMap.get( permission.getName() );
-                }
-                else if ( manager.permissionExists( permission ) )
-                {
-                    permission = manager.getPermission( permission.getName() );
-                    permissionMap.put( permission.getName(), permission );
-                }
-                else
-                {
-                    Operation operation = permission.getOperation();
-                    if ( operations.containsKey( operation.getName() ) )
-                    {
-                        operation = operations.get( operation.getName() );
-                    }
-                    else if ( manager.operationExists( operation ) )
-                    {
-                        operation = manager.getOperation( operation.getName() );
-                        operations.put( operation.getName(), operation );
-                    }
-                    else
-                    {
-                        operation = manager.saveOperation( operation );
-                        operations.put( operation.getName(), operation );
-                    }
-                    permission.setOperation( operation );
-
-                    Resource resource = permission.getResource();
-                    if ( resources.containsKey( resource.getIdentifier() ) )
-                    {
-                        resource = resources.get( resource.getIdentifier() );
-                    }
-                    else if ( manager.resourceExists( resource ) )
-                    {
-                        resource = manager.getResource( resource.getIdentifier() );
-                        resources.put( resource.getIdentifier(), resource );
-                    }
-                    else
-                    {
-                        resource = manager.saveResource( resource );
-                        resources.put( resource.getIdentifier(), resource );
-                    }
-                    permission.setResource( resource );
-
-                    permission = manager.savePermission( permission );
-                    permissionMap.put( permission.getName(), permission );
-                }
-                permissions.add( permission );
-            }
-            role.setPermissions( permissions );
-
-            manager.saveRole( role );
-        }
-
-        for ( UserAssignment userAssignment : (List<UserAssignment>) database.getUserAssignments() )
-        {
-            manager.saveUserAssignment( userAssignment );
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public void restoreUsersDatabase( UserManager manager, File backupDirectory )
-        throws IOException, XMLStreamException, UserManagerException
-    {
-        UsersManagementStaxReader reader = new UsersManagementStaxReader();
-
-        FileReader fileReader = new FileReader( new File( backupDirectory, USERS_XML_NAME ) );
-
-        UserDatabase database;
-        try
-        {
-            database = reader.read( fileReader );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileReader );
-        }
-
-        for ( User user : (List<User>) database.getUsers() )
-        {
-            manager.addUserUnchecked( user );
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public void restoreKeysDatabase( KeyManager manager, File backupDirectory )
-        throws IOException, XMLStreamException
-    {
-        RedbackKeyManagementJdoStaxReader reader = new RedbackKeyManagementJdoStaxReader();
-
-        FileReader fileReader = new FileReader( new File( backupDirectory, KEYS_XML_NAME ) );
-
-        AuthenticationKeyDatabase database;
-        try
-        {
-            database = reader.read( fileReader );
-        }
-        finally
-        {
-            IOUtils.closeQuietly( fileReader );
-        }
-
-        for ( AuthenticationKey key : (List<AuthenticationKey>) database.getKeys() )
-        {
-            manager.addKey( key );
-        }
-    }
-
-    public void eraseRBACDatabase( RBACManager manager )
-    {
-        manager.eraseDatabase();
-    }
-
-    public void eraseUsersDatabase( UserManager manager )
-    {
-        manager.eraseDatabase();
-    }
-
-    public void eraseKeysDatabase( KeyManager manager )
-    {
-        manager.eraseDatabase();
-    }
-
-    private Writer createWriter( File directory, String file, String encoding )
-        throws FileNotFoundException
-    {
-        File f = new File( directory, file );
-        File parentFile = f.getParentFile();
-        parentFile.mkdirs();
-
-        FileOutputStream out = new FileOutputStream( f );
-        return new OutputStreamWriter( out, Charset.forName( encoding ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
----------------------------------------------------------------------
diff --git a/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java b/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
index 461337a..3a78182 100644
--- a/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
+++ b/redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
@@ -20,24 +20,24 @@ package org.apache.archiva.redback.management;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.redback.common.jdo.UserConfigurableJdoFactory;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.apache.archiva.redback.rbac.Permission;
 import org.apache.archiva.redback.rbac.RBACManager;
+import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.rbac.UserAssignment;
+import org.apache.archiva.redback.tests.utils.RBACDefaults;
+import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserManagerException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.SystemUtils;
-import org.apache.archiva.redback.keys.KeyManagerException;
-import org.apache.archiva.redback.rbac.RbacManagerException;
-import org.apache.archiva.redback.tests.utils.RBACDefaults;
-import org.apache.archiva.redback.users.User;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
@@ -57,6 +57,8 @@ import java.util.List;
 import java.util.Locale;
 
 
+// @TODO: Investigate how to implement export with JPA
+@Ignore("Currently no JPA implementation")
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" })
 public class DataManagementTest
@@ -68,20 +70,16 @@ public class DataManagementTest
     private File targetDirectory;
 
     @Inject
-    @Named(value = "jdoFactory#users")
-    UserConfigurableJdoFactory jdoFactory;
-
-    @Inject
-    @Named(value = "userManager#jdo")
+    @Named(value = "userManager#jpa")
     UserManager userManager;
 
     @Inject
-    @Named(value = "keyManager#jdo")
+    @Named(value = "keyManager#jpa")
     KeyManager keyManager;
 
 
     @Inject
-    @Named(value = "rbacManager#jdo")
+    @Named(value = "rbacManager#jpa")
     RBACManager rbacManager;
 
     @Before

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-data-management/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-data-management/src/test/resources/spring-context.xml b/redback-data-management/src/test/resources/spring-context.xml
index 54b5521..6bf30d5 100644
--- a/redback-data-management/src/test/resources/spring-context.xml
+++ b/redback-data-management/src/test/resources/spring-context.xml
@@ -28,25 +28,6 @@
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.common.jdo.UserConfigurableJdoFactory">
-    <constructor-arg>
-      <ref bean="userConfiguration#default"/>
-    </constructor-arg>
-    <!--
-    <property name="config" ref="userConfiguration#default"/>
-    -->
-    <!--
-    <property name="driverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
-    <property name="url" value="jdbc:derby:memory:users-test" />
-    -->
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="" />
-
-
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-  </bean>
-
   <alias name="userConfiguration#redback" alias="userConfiguration#default"/>
 
   <!--

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-common-integrations/src/test/java/org/apache/archiva/redback/integration/mail/MailGeneratorTest.java
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-common-integrations/src/test/java/org/apache/archiva/redback/integration/mail/MailGeneratorTest.java b/redback-integrations/redback-common-integrations/src/test/java/org/apache/archiva/redback/integration/mail/MailGeneratorTest.java
index 5396e00..c4f63b5 100644
--- a/redback-integrations/redback-common-integrations/src/test/java/org/apache/archiva/redback/integration/mail/MailGeneratorTest.java
+++ b/redback-integrations/redback-common-integrations/src/test/java/org/apache/archiva/redback/integration/mail/MailGeneratorTest.java
@@ -21,12 +21,10 @@ package org.apache.archiva.redback.integration.mail;
 
 import junit.framework.TestCase;
 import net.sf.ehcache.CacheManager;
-import org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManager;
-import org.apache.archiva.redback.policy.UserSecurityPolicy;
 import org.apache.archiva.redback.keys.KeyManagerException;
-import org.jpox.SchemaTool;
+import org.apache.archiva.redback.policy.UserSecurityPolicy;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,11 +35,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-import java.net.URL;
-import java.util.Map.Entry;
-import java.util.Properties;
 
 /**
  * Test the Mailer class.
@@ -67,9 +60,7 @@ public class MailGeneratorTest
     @Named(value = "keyManager#memory")
     private KeyManager keyManager;
 
-    @Inject
-    @Named(value = "jdoFactory#users")
-    DefaultConfigurableJdoFactory jdoFactory;
+
 
     private Logger log = LoggerFactory.getLogger( getClass() );
 
@@ -80,33 +71,6 @@ public class MailGeneratorTest
         CacheManager.getInstance().clearAll();
         super.setUp();
 
-        jdoFactory.setPassword( "" );
-
-        jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); //$NON-NLS-1$ //$NON-NLS-2$
-
-        jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); //$NON-NLS-1$ //$NON-NLS-2$
-
-        jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); //$NON-NLS-1$ //$NON-NLS-2$
-        
-        Properties properties = jdoFactory.getProperties();
-
-        for ( Entry<Object, Object> entry : properties.entrySet() )
-        {
-            System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
-        }
-
-        SchemaTool.createSchemaTables( new URL[] { getClass()
-            .getResource( "/org/apache/archiva/redback/keys/jdo/package.jdo" ) }, new URL[] {}, null, false, null ); //$NON-NLS-1$
-
-        log.info( "jdoFactory driverName {} " , jdoFactory.getDriverName() );
-
-        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
-
-        assertNotNull( pmf );
-
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        pm.close();        
         
     }
 

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml b/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
index 099a82d..2f1810b 100644
--- a/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
+++ b/redback-integrations/redback-common-integrations/src/test/resources/spring-context.xml
@@ -28,20 +28,6 @@
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
-
   <bean name="userConfiguration#custom-url" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="configs">
       <list>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-rest/redback-rest-services/pom.xml
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/pom.xml b/redback-integrations/redback-rest/redback-rest-services/pom.xml
index d5a6d0b..7fbe9f1 100644
--- a/redback-integrations/redback-rest/redback-rest-services/pom.xml
+++ b/redback-integrations/redback-rest/redback-rest-services/pom.xml
@@ -74,6 +74,10 @@
       <artifactId>redback-keys-memory</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.archiva.redback</groupId>
+      <artifactId>redback-keys-jpa</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.fasterxml.jackson.jaxrs</groupId>
       <artifactId>jackson-jaxrs-json-provider</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
index ee3cc47..860e931 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
+++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
@@ -26,7 +26,7 @@ import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationData
 import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManager;
-import org.apache.archiva.redback.keys.jdo.JdoAuthenticationKey;
+import org.apache.archiva.redback.keys.jpa.model.JpaAuthenticationKey;
 import org.apache.archiva.redback.keys.memory.MemoryAuthenticationKey;
 import org.apache.archiva.redback.keys.memory.MemoryKeyManager;
 import org.apache.archiva.redback.policy.AccountLockedException;
@@ -96,7 +96,7 @@ public class DefaultLoginService
         }
         else
         {
-            key = new JdoAuthenticationKey();
+            key = new JpaAuthenticationKey();
         }
 
         key.setKey( providedKey );

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/FakeCreateAdminServiceImpl.java
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/FakeCreateAdminServiceImpl.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/FakeCreateAdminServiceImpl.java
index a9c0596..5560ecf 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/FakeCreateAdminServiceImpl.java
+++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/FakeCreateAdminServiceImpl.java
@@ -36,11 +36,11 @@ public class FakeCreateAdminServiceImpl
     implements FakeCreateAdminService
 {
     @Inject
-    @Named( value = "rbacManager#jdo" )
+    @Named( value = "rbacManager#jpa" )
     private RBACManager rbacManager;
 
     @Inject
-    @Named( value = "userManager#jdo" )
+    @Named( value = "userManager#jpa" )
     private UserManager userManager;
 
     @Inject

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-integrations/redback-rest/redback-rest-services/src/test/resources/security.properties
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/security.properties b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/security.properties
index 9627c15..aae250b 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/security.properties
+++ b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/security.properties
@@ -16,4 +16,4 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-user.manager.impl=jdo
\ No newline at end of file
+user.manager.impl=jpa
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-keys/redback-keys-providers/pom.xml
----------------------------------------------------------------------
diff --git a/redback-keys/redback-keys-providers/pom.xml b/redback-keys/redback-keys-providers/pom.xml
index 4cc46ab..3cd8e19 100644
--- a/redback-keys/redback-keys-providers/pom.xml
+++ b/redback-keys/redback-keys-providers/pom.xml
@@ -28,9 +28,8 @@
   <name>Redback :: Key Management Providers</name>
   <packaging>pom</packaging>
   <modules>    
-    <module>redback-keys-jdo</module>
+    <module>redback-keys-jpa</module>
     <module>redback-keys-memory</module>
     <module>redback-keys-cached</module>
-      <module>redback-keys-jpa</module>
   </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-keys/redback-keys-providers/redback-keys-cached/pom.xml
----------------------------------------------------------------------
diff --git a/redback-keys/redback-keys-providers/redback-keys-cached/pom.xml b/redback-keys/redback-keys-providers/redback-keys-cached/pom.xml
index 56cb6ef..857f02e 100644
--- a/redback-keys/redback-keys-providers/redback-keys-cached/pom.xml
+++ b/redback-keys/redback-keys-providers/redback-keys-cached/pom.xml
@@ -45,12 +45,16 @@
       <artifactId>spring-cache-ehcache</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.archiva.redback</groupId>
+      <artifactId>redback-configuration</artifactId>
+    </dependency>
+    <dependency>
       <groupId>net.sf.ehcache</groupId>
       <artifactId>ehcache</artifactId>
     </dependency>    
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-keys-jdo</artifactId>
+      <artifactId>redback-keys-jpa</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/apache/archiva/redback/keys/cached/CachedKeyManager.java
----------------------------------------------------------------------
diff --git a/redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/apache/archiva/redback/keys/cached/CachedKeyManager.java b/redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/apache/archiva/redback/keys/cached/CachedKeyManager.java
index c5db8b6..0d32c9b 100644
--- a/redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/apache/archiva/redback/keys/cached/CachedKeyManager.java
+++ b/redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/apache/archiva/redback/keys/cached/CachedKeyManager.java
@@ -43,7 +43,7 @@ public class CachedKeyManager
     implements KeyManager
 {
     @Inject
-    @Named(value = "keyManager#jdo")
+    @Named(value = "keyManager#jpa")
     private KeyManager keyImpl;
 
     @Inject

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml b/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml
index add479b..05275cd 100644
--- a/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml
+++ b/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml
@@ -20,25 +20,11 @@
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>
@@ -60,4 +46,30 @@
     <property name="timeToLiveSeconds" value="14400"/>
   </bean>
 
+  <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+    <property name="jpaVendorAdapter" >
+      <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />
+    </property>
+    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-hsqldb.xml" />
+    <property name="jpaPropertyMap">
+      <map>
+        <entry key="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:redback_database" />
+        <entry key="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+        <entry key="openjpa.ConnectionUserName" value="sa" />
+        <entry key="openjpa.ConnectionPassword" value="" />
+        <entry key="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO, SQL=TRACE" />
+        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
+        <entry key="openjpa.jdbc.MappingDefaults"
+               value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
+      </map>
+    </property>
+
+  </bean>
+
+  <bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" >
+    <property name="entityManagerFactory" ref="entityManagerFactory" />
+  </bean>
+
+  <tx:annotation-driven />
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/pom.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/pom.xml b/redback-rbac/redback-rbac-providers/pom.xml
index a94d451..81afcad 100644
--- a/redback-rbac/redback-rbac-providers/pom.xml
+++ b/redback-rbac/redback-rbac-providers/pom.xml
@@ -28,10 +28,9 @@
   <name>Redback :: RBAC Providers</name>
   <packaging>pom</packaging>
   <modules>
-    <module>redback-rbac-jdo</module>
+    <module>redback-rbac-jpa</module>
     <module>redback-rbac-memory</module>
     <module>redback-rbac-cached</module>
     <module>redback-rbac-ldap</module>
-      <module>redback-rbac-jpa</module>
   </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml b/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
index bb25053..921bcb7 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
@@ -66,10 +66,6 @@
     </dependency>    
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-rbac-jdo</artifactId>      
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-rbac-jpa</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java
index b69b0e8..61c62ee 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java
@@ -54,7 +54,7 @@ public class CachedRbacManager
     private Logger log = LoggerFactory.getLogger( getClass() );
 
     @Inject
-    @Named( value = "rbacManager#jdo" )
+    @Named( value = "rbacManager#jpa" )
     private RBACManager rbacImpl;
 
     @Inject

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
index 71c14e2..cde6070 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
@@ -24,19 +24,6 @@
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="false">
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
 
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManager.java
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManager.java b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManager.java
index ea219e9..09d3bc7 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManager.java
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManager.java
@@ -31,6 +31,7 @@ import javax.persistence.*;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
@@ -75,6 +76,18 @@ public class JpaRbacManager extends AbstractRBACManager  {
 
     @Transactional
     @Override
+    public Map<String, List<Permission>> getAssignedPermissionMap(String principal) throws RbacManagerException {
+        return super.getAssignedPermissionMap(principal);
+    }
+
+    @Transactional
+    @Override
+    public Map<String, Role> getChildRoles(Role role) throws RbacManagerException {
+        return super.getChildRoles(role);
+    }
+
+    @Transactional
+    @Override
     public void addChildRole(Role role, Role childRole) throws RbacObjectInvalidException, RbacManagerException {
         super.addChildRole(role, childRole);
     }
@@ -105,7 +118,14 @@ public class JpaRbacManager extends AbstractRBACManager  {
         final EntityManager em = getEm();
         TypedQuery<JpaRole> q = em.createQuery("SELECT r FROM JpaRole  r WHERE r.name = :rolename", JpaRole.class);
         q.setParameter("rolename",roleName);
-        return q.getSingleResult();
+        Role role;
+        try {
+            role = q.getSingleResult();
+        } catch (NoResultException ex) {
+            log.warn("Role {0} not found", roleName);
+            throw new RbacObjectNotFoundException("Role not found "+roleName);
+        }
+        return role;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/test/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManagerTest.java
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/test/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManagerTest.java b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/test/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManagerTest.java
index cfc34f4..082d1ea 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/test/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManagerTest.java
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/test/java/org/apache/archiva/redback/rbac/jpa/JpaRbacManagerTest.java
@@ -19,7 +19,6 @@ package org.apache.archiva.redback.rbac.jpa;
  * under the License.
  */
 
-import org.apache.archiva.redback.common.jdo.test.StoreManagerDebug;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.tests.AbstractRbacManagerTestCase;

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/pom.xml b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/pom.xml
index 7f2afc3..fd100f5 100644
--- a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/pom.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/pom.xml
@@ -74,10 +74,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-rbac-jdo</artifactId>      
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-rbac-cached</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
index beae9e0..b92edd4 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml
@@ -63,20 +63,6 @@
 
   <alias name="ldapRoleMapper#test" alias="ldapRoleMapper#default"/>
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
-
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>
   </bean>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
index cec014e..781d2b3 100755
--- a/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-providers/redback-rbac-memory/src/test/resources/spring-context.xml
@@ -23,19 +23,6 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
 
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-role-manager/pom.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-role-manager/pom.xml b/redback-rbac/redback-rbac-role-manager/pom.xml
index 6930efa..9586536 100644
--- a/redback-rbac/redback-rbac-role-manager/pom.xml
+++ b/redback-rbac/redback-rbac-role-manager/pom.xml
@@ -63,20 +63,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <artifactId>redback-rbac-jdo</artifactId>
-      <groupId>org.apache.archiva.redback</groupId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-rbac-model</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-common-jdo</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-rbac-cached</artifactId>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-role-manager/src/test/java/org/apache/archiva/redback/role/JpoxRoleManagerTest.java
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-role-manager/src/test/java/org/apache/archiva/redback/role/JpoxRoleManagerTest.java b/redback-rbac/redback-rbac-role-manager/src/test/java/org/apache/archiva/redback/role/JpoxRoleManagerTest.java
index 53a84ca..3ebbe02 100644
--- a/redback-rbac/redback-rbac-role-manager/src/test/java/org/apache/archiva/redback/role/JpoxRoleManagerTest.java
+++ b/redback-rbac/redback-rbac-role-manager/src/test/java/org/apache/archiva/redback/role/JpoxRoleManagerTest.java
@@ -19,8 +19,7 @@ package org.apache.archiva.redback.role;
  * under the License.
  */
 
-import org.apache.archiva.redback.rbac.jdo.JdoRbacManager;
-import org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory;
+import org.apache.archiva.redback.rbac.RBACManager;
 import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
@@ -28,8 +27,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
 
 /**
  * RoleManagerTest:
@@ -41,38 +38,31 @@ import javax.jdo.PersistenceManagerFactory;
 public class JpoxRoleManagerTest
     extends AbstractRoleManagerTest
 {
-    @Inject
-    @Named( value = "jdoFactory#users" )
-    DefaultConfigurableJdoFactory jdoFactory;
-
-    @Inject
-    @Named( value = "rbacManager#jdo" )
-    JdoRbacManager rbacManagerJdo;
 
     @Inject @Named(value = "roleManager#jpox")
     DefaultRoleManager roleManagerInjected;
 
+    @Inject
+    @Named(value = "rbacManager#jpa")
+    RBACManager rbacManager;
+
+
+
     /**
      * Creates a new RbacStore which contains no data.
      */
     @Before
     public void setUp()
-        throws Exception
+            throws Exception
     {
 
         super.setUp();
-
-        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
-
-        assertNotNull( pmf );
-
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        pm.close();
-
-        setRbacManager( rbacManagerJdo );
-
+        // rbacManager.setEntityManager(emf.createEntityManager());
+        super.setRbacManager(rbacManager);
+        assertNotNull(rbacManager);
         setRoleManager( roleManagerInjected );
+
     }
 
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-role-manager/src/test/resources/jpox-spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-role-manager/src/test/resources/jpox-spring-context.xml b/redback-rbac/redback-rbac-role-manager/src/test/resources/jpox-spring-context.xml
index c674a02..72609b4 100644
--- a/redback-rbac/redback-rbac-role-manager/src/test/resources/jpox-spring-context.xml
+++ b/redback-rbac/redback-rbac-role-manager/src/test/resources/jpox-spring-context.xml
@@ -26,13 +26,13 @@
 
 
   <bean name="roleModelProcessor" class="org.apache.archiva.redback.role.processor.DefaultRoleModelProcessor">
-    <property name="rbacManager" ref="rbacManager#jdo"/>
+    <property name="rbacManager" ref="rbacManager#jpa"/>
   </bean>
 
   <alias name="roleModelProcessor" alias="roleModelProcessor#jpox"/>
 
   <bean name="roleTemplateProcessor" class="org.apache.archiva.redback.role.template.DefaultRoleTemplateProcessor">
-    <property name="rbacManager" ref="rbacManager#jdo"/>
+    <property name="rbacManager" ref="rbacManager#jpa"/>
   </bean>
 
   <alias name="roleTemplateProcessor" alias="roleTemplateProcessor#jpox"/>
@@ -41,35 +41,10 @@
     <property name="modelValidator" ref="roleModelValidator"/>
     <property name="modelProcessor" ref="roleModelProcessor#jpox"/>
     <property name="templateProcessor" ref="roleTemplateProcessor#jpox"/>
-    <property name="rbacManager" ref="rbacManager#jdo"/>
+    <property name="rbacManager" ref="rbacManager#jpa"/>
   </bean>
   <alias name="roleManager" alias="roleManager#jpox"/>
 
-
-  <bean name="rbacManager#jdo" class="org.apache.archiva.redback.rbac.jdo.JdoRbacManager">
-    <property name="jdo" ref="jdoTool"/>
-    <property name="enableCache" value="false"/>
-  </bean>
-
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-jpox-role-manager-test" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.transactionIsolation">READ_UNCOMMITTED</prop>
-        <prop key="org.jpox.poid.transactionIsolation">READ_UNCOMMITTED</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-        <prop key="org.jpox.autoCreateSchema">true</prop>
-        <prop key="javax.jdo.option.RetainValues">true</prop>
-        <prop key="javax.jdo.option.RestoreValues">true</prop>
-      </props>
-    </property>
-  </bean>
-
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>
   </bean>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
index 9ba16d9..7f86650 100755
--- a/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
+++ b/redback-rbac/redback-rbac-role-manager/src/test/resources/spring-context.xml
@@ -25,19 +25,6 @@
        default-lazy-init="false">
 
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-        <prop key="org.jpox.autoCreateTables">true</prop>
-      </props>
-    </property>
-  </bean>
 
   <bean name="userConfiguration#default" class="org.apache.archiva.redback.configuration.DefaultUserConfiguration">
     <property name="registry" ref="test-conf"/>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-system/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/redback-system/src/test/resources/spring-context.xml b/redback-system/src/test/resources/spring-context.xml
index 2b4f86e..348c365 100644
--- a/redback-system/src/test/resources/spring-context.xml
+++ b/redback-system/src/test/resources/spring-context.xml
@@ -23,18 +23,6 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
 
-  <bean name="jdoFactory#users" class="org.apache.archiva.redback.components.jdo.DefaultConfigurableJdoFactory">
-    <property name="driverName" value="org.hsqldb.jdbcDriver"/>
-    <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
-    <property name="userName" value="sa"/>
-    <property name="password" value=""/>
-    <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
-    <property name="otherProperties">
-      <props>
-        <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
-      </props>
-    </property>
-  </bean>
 
   <bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
     <property name="jpaVendorAdapter" >

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-users/redback-users-providers/pom.xml
----------------------------------------------------------------------
diff --git a/redback-users/redback-users-providers/pom.xml b/redback-users/redback-users-providers/pom.xml
index 1172f62..6bc7fff 100644
--- a/redback-users/redback-users-providers/pom.xml
+++ b/redback-users/redback-users-providers/pom.xml
@@ -36,7 +36,6 @@
   <modules>
     <module>redback-users-cached</module>
     <module>redback-users-memory</module>
-    <module>redback-users-jdo</module>
     <module>redback-users-ldap</module>
     <module>redback-users-configurable</module>
     <module>redback-users-jpa</module>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/2add7925/redback-users/redback-users-providers/redback-users-cached/pom.xml
----------------------------------------------------------------------
diff --git a/redback-users/redback-users-providers/redback-users-cached/pom.xml b/redback-users/redback-users-providers/redback-users-cached/pom.xml
index b64fe22..52d2886 100644
--- a/redback-users/redback-users-providers/redback-users-cached/pom.xml
+++ b/redback-users/redback-users-providers/redback-users-cached/pom.xml
@@ -58,10 +58,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
-      <artifactId>redback-users-jdo</artifactId>      
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-users-jpa</artifactId>
     </dependency>
     <dependency>


Mime
View raw message