fix name as it is related to Redback and not to Archiva

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1424675 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-20 20:33:35 +00:00
parent 14b6f1c61a
commit c3e33b9670
7 changed files with 53 additions and 57 deletions

View File

@ -25,12 +25,12 @@ import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
* @author Olivier Lamy
* @since 1.4-M4
*/
public interface ArchivaRuntimeConfigurationAdmin
public interface RedbackRuntimeConfigurationAdmin
{
RedbackRuntimeConfiguration getArchivaRuntimeConfiguration()
RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
throws RepositoryAdminException;
void updateArchivaRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
throws RepositoryAdminException;
}

View File

@ -22,7 +22,7 @@ import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
@ -45,8 +45,8 @@ import java.util.List;
* @since 1.4-M4
*/
@Service( "userConfiguration#archiva" )
public class DefaultArchivaRuntimeConfigurationAdmin
implements ArchivaRuntimeConfigurationAdmin, UserConfiguration
public class DefaultRedbackRuntimeConfigurationAdmin
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
{
protected Logger log = LoggerFactory.getLogger( getClass() );
@ -64,7 +64,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
try
{
RedbackRuntimeConfiguration redbackRuntimeConfiguration = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfiguration();
// migrate or not data from redback
if ( !redbackRuntimeConfiguration.isMigratedFromRedbackConfiguration() )
{
@ -101,7 +101,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
updateArchivaRuntimeConfiguration( redbackRuntimeConfiguration );
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
}
@ -111,7 +111,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
log.info(
"redbackRuntimeConfiguration with empty userManagerImpls so force at least jdo implementation !" );
redbackRuntimeConfiguration.getUserManagerImpls().add( "jdo" );
updateArchivaRuntimeConfiguration( redbackRuntimeConfiguration );
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
}
}
@ -121,12 +121,12 @@ public class DefaultArchivaRuntimeConfigurationAdmin
}
}
public RedbackRuntimeConfiguration getArchivaRuntimeConfiguration()
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
{
return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() );
}
public void updateArchivaRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
throws RepositoryAdminException
{
org.apache.archiva.configuration.RedbackRuntimeConfiguration
@ -188,10 +188,10 @@ public class DefaultArchivaRuntimeConfigurationAdmin
if ( UserConfigurationKeys.USER_MANAGER_IMPL.equals( key ) )
{
// possible false for others than archiva user manager
return getArchivaRuntimeConfiguration().getUserManagerImpls().get( 0 );
return getRedbackRuntimeConfiguration().getUserManagerImpls().get( 0 );
}
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -207,7 +207,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -222,22 +222,22 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_HOSTNAME.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getHostName();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getHostName();
}
if ( UserConfigurationKeys.LDAP_CONTEX_FACTORY.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getContextFactory();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getContextFactory();
}
if ( UserConfigurationKeys.LDAP_PASSWORD.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getPassword();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getPassword();
}
if ( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
}
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -254,7 +254,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
conf.getConfigurationProperties().put( key, value );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -267,7 +267,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
public int getInt( String key )
{
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -279,7 +279,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
conf.getConfigurationProperties().put( key, Integer.toString( value ) );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -294,10 +294,10 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_PORT.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getPort();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getPort();
}
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -309,7 +309,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
conf.getConfigurationProperties().put( key, Integer.toString( value ) );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -322,7 +322,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
public boolean getBoolean( String key )
{
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -334,7 +334,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -349,10 +349,10 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_SSL.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().isSsl();
return getRedbackRuntimeConfiguration().getLdapConfiguration().isSsl();
}
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
{
@ -364,7 +364,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -379,12 +379,12 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
List<String> value = userConfiguration.getList( key );
RedbackRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
// TODO concat values
conf.getConfigurationProperties().put( key, "" );
try
{
updateArchivaRuntimeConfiguration( conf );
updateRedbackRuntimeConfiguration( conf );
}
catch ( RepositoryAdminException e )
{
@ -399,11 +399,11 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_BASEDN.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getBaseDn();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseDn();
}
if ( UserConfigurationKeys.LDAP_BINDDN.equals( key ) )
{
return getArchivaRuntimeConfiguration().getLdapConfiguration().getBindDn();
return getRedbackRuntimeConfiguration().getLdapConfiguration().getBindDn();
}
return userConfiguration.getConcatenatedList( key, defaultValue );
}

View File

@ -21,7 +21,7 @@ package org.apache.archiva.rest.services;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.authentication.AuthenticationException;
import org.apache.archiva.redback.authentication.Authenticator;
import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
@ -58,7 +58,7 @@ public class DefaultArchivaRuntimeConfigurationService
implements ArchivaRuntimeConfigurationService
{
@Inject
private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
@Inject
@Named(value = "userManager#configurable")
@ -76,7 +76,7 @@ public class DefaultArchivaRuntimeConfigurationService
{
try
{
return archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration();
return redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
}
catch ( RepositoryAdminException e )
{
@ -91,13 +91,13 @@ public class DefaultArchivaRuntimeConfigurationService
{
// has user manager impl changed ?
boolean userManagerChanged = redbackRuntimeConfiguration.getUserManagerImpls().size()
!= archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getUserManagerImpls().size();
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls().size();
userManagerChanged =
userManagerChanged || ( redbackRuntimeConfiguration.getUserManagerImpls().toString().hashCode()
!= archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getUserManagerImpls().toString().hashCode() );
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls().toString().hashCode() );
archivaRuntimeConfigurationAdmin.updateArchivaRuntimeConfiguration( redbackRuntimeConfiguration );
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
if ( userManagerChanged )
{

View File

@ -20,7 +20,7 @@ package org.apache.archiva.web.runtime.ldap;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory;
import org.apache.archiva.redback.common.ldap.connection.LdapConnectionConfiguration;
import org.springframework.stereotype.Service;
@ -41,7 +41,7 @@ public class ArchivaLdapConnectionFactory
{
@Inject
private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
private LdapConnectionConfiguration ldapConnectionConfiguration;
@ -51,7 +51,7 @@ public class ArchivaLdapConnectionFactory
try
{
LdapConfiguration ldapConfiguration =
archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getLdapConfiguration();
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getLdapConfiguration();
ldapConnectionConfiguration = new LdapConnectionConfiguration();
ldapConnectionConfiguration.setHostname( ldapConfiguration.getHostName() );
ldapConnectionConfiguration.setPort( ldapConfiguration.getPort() );

View File

@ -19,7 +19,7 @@ package org.apache.archiva.web.security;
*/
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.components.cache.Cache;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserManager;
@ -48,7 +48,7 @@ public class ArchivaConfigurableUsersManager
{
@Inject
private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
@Inject
private ApplicationContext applicationContext;
@ -67,7 +67,7 @@ public class ArchivaConfigurableUsersManager
try
{
List<String> userManagerImpls =
archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getUserManagerImpls();
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
log.info( "use userManagerImpls: '{}'", userManagerImpls );
userManagerPerId = new LinkedHashMap<String, UserManager>( userManagerImpls.size() );
@ -90,7 +90,7 @@ public class ArchivaConfigurableUsersManager
{
try
{
return archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().isUseUsersCache();
return redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().isUseUsersCache();
}
catch ( RepositoryAdminException e )
{

View File

@ -19,7 +19,7 @@ package org.apache.archiva.web.security;
*/
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
import org.apache.archiva.redback.rbac.RBACManager;
import org.apache.archiva.redback.rbac.RbacManagerException;
@ -64,7 +64,7 @@ public class ArchivaLockedAdminEnvironmentCheck
private ApplicationContext applicationContext;
@Inject
private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
private List<UserManager> userManagers;
@ -73,7 +73,7 @@ public class ArchivaLockedAdminEnvironmentCheck
throws RepositoryAdminException
{
List<String> userManagerImpls =
archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getUserManagerImpls();
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
userManagers = new ArrayList<UserManager>( userManagerImpls.size() );

View File

@ -19,7 +19,7 @@ package org.apache.archiva.web.security;
*/
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.authentication.AbstractAuthenticator;
import org.apache.archiva.redback.authentication.AuthenticationConstants;
import org.apache.archiva.redback.authentication.AuthenticationDataSource;
@ -28,7 +28,6 @@ import org.apache.archiva.redback.authentication.AuthenticationFailureCause;
import org.apache.archiva.redback.authentication.AuthenticationResult;
import org.apache.archiva.redback.authentication.Authenticator;
import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
import org.apache.archiva.redback.authentication.users.UserManagerAuthenticator;
import org.apache.archiva.redback.policy.AccountLockedException;
import org.apache.archiva.redback.policy.MustChangePasswordException;
import org.apache.archiva.redback.policy.PasswordEncoder;
@ -44,11 +43,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Olivier Lamy
@ -68,7 +64,7 @@ public class ArchivaUserManagerAuthenticator
private ApplicationContext applicationContext;
@Inject
private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
private List<UserManager> userManagers;
@ -80,7 +76,7 @@ public class ArchivaUserManagerAuthenticator
try
{
List<String> userManagerImpls =
archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfiguration().getUserManagerImpls();
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
userManagers = new ArrayList<UserManager>( userManagerImpls.size() );