diff --git a/pom.xml b/pom.xml index 6baf62f6..8be45147 100644 --- a/pom.xml +++ b/pom.xml @@ -392,7 +392,7 @@ org.apache.archiva.redback.components spring-jdo2 - 2.0 + 2.1-SNAPSHOT xerces diff --git a/redback-keys/redback-keys-providers/redback-keys-jdo/src/main/java/org/apache/archiva/redback/keys/jdo/JdoKeyManager.java b/redback-keys/redback-keys-providers/redback-keys-jdo/src/main/java/org/apache/archiva/redback/keys/jdo/JdoKeyManager.java index dab078b0..1537f576 100644 --- a/redback-keys/redback-keys-providers/redback-keys-jdo/src/main/java/org/apache/archiva/redback/keys/jdo/JdoKeyManager.java +++ b/redback-keys/redback-keys-providers/redback-keys-jdo/src/main/java/org/apache/archiva/redback/keys/jdo/JdoKeyManager.java @@ -20,9 +20,9 @@ */ import org.apache.archiva.redback.components.jdo.JdoFactory; -import org.apache.archiva.redback.components.jdo.PlexusJdoUtils; -import org.apache.archiva.redback.components.jdo.PlexusObjectNotFoundException; -import org.apache.archiva.redback.components.jdo.PlexusStoreException; +import org.apache.archiva.redback.components.jdo.RedbackJdoUtils; +import org.apache.archiva.redback.components.jdo.RedbackObjectNotFoundException; +import org.apache.archiva.redback.components.jdo.RedbackStoreException; import org.apache.archiva.redback.keys.AuthenticationKey; import org.apache.archiva.redback.keys.AbstractKeyManager; import org.apache.archiva.redback.keys.KeyManagerException; @@ -78,13 +78,13 @@ public AuthenticationKey createKey( String principal, String purpose, int expira public AuthenticationKey addKey( AuthenticationKey key ) { - return (AuthenticationKey) PlexusJdoUtils.addObject( getPersistenceManager(), key ); + return (AuthenticationKey) RedbackJdoUtils.addObject( getPersistenceManager(), key ); } public void eraseDatabase() { - PlexusJdoUtils.removeAll( getPersistenceManager(), JdoAuthenticationKey.class ); - PlexusJdoUtils.removeAll( getPersistenceManager(), RedbackKeyManagementJdoModelloMetadata.class ); + RedbackJdoUtils.removeAll( getPersistenceManager(), JdoAuthenticationKey.class ); + RedbackJdoUtils.removeAll( getPersistenceManager(), RedbackKeyManagementJdoModelloMetadata.class ); } public AuthenticationKey findKey( String key ) @@ -97,9 +97,8 @@ public AuthenticationKey findKey( String key ) try { - JdoAuthenticationKey authkey = (JdoAuthenticationKey) PlexusJdoUtils.getObjectById( getPersistenceManager(), - JdoAuthenticationKey.class, - key ); + JdoAuthenticationKey authkey = (JdoAuthenticationKey) RedbackJdoUtils.getObjectById( + getPersistenceManager(), JdoAuthenticationKey.class, key ); if ( authkey == null ) { @@ -109,11 +108,11 @@ public AuthenticationKey findKey( String key ) return authkey; } - catch ( PlexusObjectNotFoundException e ) + catch ( RedbackObjectNotFoundException e ) { throw new KeyNotFoundException( e.getMessage() ); } - catch ( PlexusStoreException e ) + catch ( RedbackStoreException e ) { throw new KeyManagerException( "Unable to get " + JdoAuthenticationKey.class.getName() + "', key '" + key + "' from jdo store." ); @@ -123,7 +122,7 @@ public AuthenticationKey findKey( String key ) public void deleteKey( AuthenticationKey authkey ) throws KeyManagerException { - PlexusJdoUtils.removeObject( getPersistenceManager(), authkey ); + RedbackJdoUtils.removeObject( getPersistenceManager(), authkey ); } public void deleteKey( String key ) @@ -132,7 +131,7 @@ public void deleteKey( String key ) try { AuthenticationKey authkey = findKey( key ); - PlexusJdoUtils.removeObject( getPersistenceManager(), authkey ); + RedbackJdoUtils.removeObject( getPersistenceManager(), authkey ); } catch ( KeyNotFoundException e ) { @@ -143,7 +142,7 @@ public void deleteKey( String key ) @SuppressWarnings( "unchecked" ) public List getAllKeys() { - return PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoAuthenticationKey.class ); + return RedbackJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoAuthenticationKey.class ); } @PostConstruct diff --git a/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java b/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java index 526c356f..03724e06 100644 --- a/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java +++ b/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java @@ -20,9 +20,9 @@ */ import org.apache.archiva.redback.components.jdo.JdoFactory; -import org.apache.archiva.redback.components.jdo.PlexusJdoUtils; -import org.apache.archiva.redback.components.jdo.PlexusObjectNotFoundException; -import org.apache.archiva.redback.components.jdo.PlexusStoreException; +import org.apache.archiva.redback.components.jdo.RedbackJdoUtils; +import org.apache.archiva.redback.components.jdo.RedbackObjectNotFoundException; +import org.apache.archiva.redback.components.jdo.RedbackStoreException; import org.apache.archiva.redback.policy.UserSecurityPolicy; import org.apache.archiva.redback.users.AbstractUserManager; import org.apache.archiva.redback.users.PermanentUserException; @@ -107,7 +107,7 @@ public List getUsers( boolean orderAscending ) @SuppressWarnings ("unchecked") private List getAllObjectsDetached( String ordering ) { - return PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoUser.class, ordering, (String) null ); + return RedbackJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoUser.class, ordering, (String) null ); } public List findUsersByUsernameKey( String usernameKey, boolean orderAscending ) @@ -276,7 +276,7 @@ public void deleteUser( String username ) fireUserManagerUserRemoved( user ); - PlexusJdoUtils.removeObject( getPersistenceManager(), user ); + RedbackJdoUtils.removeObject( getPersistenceManager(), user ); } catch ( UserNotFoundException e ) { @@ -303,8 +303,8 @@ public void addUserUnchecked( User user ) public void eraseDatabase() { - PlexusJdoUtils.removeAll( getPersistenceManager(), JdoUser.class ); - PlexusJdoUtils.removeAll( getPersistenceManager(), UsersManagementModelloMetadata.class ); + RedbackJdoUtils.removeAll( getPersistenceManager(), JdoUser.class ); + RedbackJdoUtils.removeAll( getPersistenceManager(), UsersManagementModelloMetadata.class ); } public User findUser( Object principal ) @@ -317,14 +317,14 @@ public User findUser( Object principal ) try { - return (User) PlexusJdoUtils.getObjectById( getPersistenceManager(), JdoUser.class, principal.toString(), - null ); + return (User) RedbackJdoUtils.getObjectById( getPersistenceManager(), JdoUser.class, principal.toString(), + null ); } - catch ( PlexusObjectNotFoundException e ) + catch ( RedbackObjectNotFoundException e ) { throw new UserNotFoundException( "Unable to find user: " + e.getMessage(), e ); } - catch ( PlexusStoreException e ) + catch ( RedbackStoreException e ) { throw new UserNotFoundException( "Unable to find user: " + e.getMessage(), e ); } @@ -407,7 +407,7 @@ public PersistenceManager getPersistenceManager() private Object addObject( Object object ) { - return PlexusJdoUtils.addObject( getPersistenceManager(), object ); + return RedbackJdoUtils.addObject( getPersistenceManager(), object ); } private Object getObjectById( String id, String fetchGroup ) @@ -415,13 +415,13 @@ private Object getObjectById( String id, String fetchGroup ) { try { - return PlexusJdoUtils.getObjectById( getPersistenceManager(), JdoUser.class, id, fetchGroup ); + return RedbackJdoUtils.getObjectById( getPersistenceManager(), JdoUser.class, id, fetchGroup ); } - catch ( PlexusObjectNotFoundException e ) + catch ( RedbackObjectNotFoundException e ) { throw new UserNotFoundException( e.getMessage() ); } - catch ( PlexusStoreException e ) + catch ( RedbackStoreException e ) { throw new UserManagerException( "Unable to get object '" + JdoUser.class.getName() + "', id '" + id + "', fetch-group '" + fetchGroup + "' from jdo store.", e ); @@ -435,7 +435,7 @@ private Object removeObject( Object o ) throw new UserManagerException( "Unable to remove null object" ); } - PlexusJdoUtils.removeObject( getPersistenceManager(), o ); + RedbackJdoUtils.removeObject( getPersistenceManager(), o ); return o; } @@ -444,9 +444,9 @@ private Object updateObject( Object object ) { try { - return PlexusJdoUtils.updateObject( getPersistenceManager(), object ); + return RedbackJdoUtils.updateObject( getPersistenceManager(), object ); } - catch ( PlexusStoreException e ) + catch ( RedbackStoreException e ) { throw new UserManagerException( "Unable to update the '" + object.getClass().getName() + "' object in the jdo database.", e ); @@ -455,7 +455,7 @@ private Object updateObject( Object object ) private void rollback( Transaction tx ) { - PlexusJdoUtils.rollbackIfActive( tx ); + RedbackJdoUtils.rollbackIfActive( tx ); } private boolean hasTriggeredInit = false;