adapt to last changes in spring-jdo2 component
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1417087 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7878eec5cb
commit
b890cd1b97
2
pom.xml
2
pom.xml
|
@ -392,7 +392,7 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.archiva.redback.components</groupId>
|
||||
<artifactId>spring-jdo2</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
|
|
|
@ -20,9 +20,9 @@ package org.apache.archiva.redback.keys.jdo;
|
|||
*/
|
||||
|
||||
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 class JdoKeyManager
|
|||
|
||||
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 class JdoKeyManager
|
|||
|
||||
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 class JdoKeyManager
|
|||
|
||||
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 class JdoKeyManager
|
|||
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 class JdoKeyManager
|
|||
try
|
||||
{
|
||||
AuthenticationKey authkey = findKey( key );
|
||||
PlexusJdoUtils.removeObject( getPersistenceManager(), authkey );
|
||||
RedbackJdoUtils.removeObject( getPersistenceManager(), authkey );
|
||||
}
|
||||
catch ( KeyNotFoundException e )
|
||||
{
|
||||
|
@ -143,7 +142,7 @@ public class JdoKeyManager
|
|||
@SuppressWarnings( "unchecked" )
|
||||
public List<AuthenticationKey> getAllKeys()
|
||||
{
|
||||
return PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoAuthenticationKey.class );
|
||||
return RedbackJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoAuthenticationKey.class );
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
@ -20,9 +20,9 @@ package org.apache.archiva.redback.users.jdo;
|
|||
*/
|
||||
|
||||
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 class JdoUserManager
|
|||
@SuppressWarnings ("unchecked")
|
||||
private List<User> getAllObjectsDetached( String ordering )
|
||||
{
|
||||
return PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoUser.class, ordering, (String) null );
|
||||
return RedbackJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoUser.class, ordering, (String) null );
|
||||
}
|
||||
|
||||
public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending )
|
||||
|
@ -276,7 +276,7 @@ public class JdoUserManager
|
|||
|
||||
fireUserManagerUserRemoved( user );
|
||||
|
||||
PlexusJdoUtils.removeObject( getPersistenceManager(), user );
|
||||
RedbackJdoUtils.removeObject( getPersistenceManager(), user );
|
||||
}
|
||||
catch ( UserNotFoundException e )
|
||||
{
|
||||
|
@ -303,8 +303,8 @@ public class JdoUserManager
|
|||
|
||||
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 class JdoUserManager
|
|||
|
||||
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 class JdoUserManager
|
|||
|
||||
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 @@ public class JdoUserManager
|
|||
{
|
||||
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 @@ public class JdoUserManager
|
|||
throw new UserManagerException( "Unable to remove null object" );
|
||||
}
|
||||
|
||||
PlexusJdoUtils.removeObject( getPersistenceManager(), o );
|
||||
RedbackJdoUtils.removeObject( getPersistenceManager(), o );
|
||||
return o;
|
||||
}
|
||||
|
||||
|
@ -444,9 +444,9 @@ public class JdoUserManager
|
|||
{
|
||||
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 @@ public class JdoUserManager
|
|||
|
||||
private void rollback( Transaction tx )
|
||||
{
|
||||
PlexusJdoUtils.rollbackIfActive( tx );
|
||||
RedbackJdoUtils.rollbackIfActive( tx );
|
||||
}
|
||||
|
||||
private boolean hasTriggeredInit = false;
|
||||
|
|
Loading…
Reference in New Issue