summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-11-05 21:39:00 +1100
committerOlivier Lamy <olamy@apache.org>2014-11-05 21:39:00 +1100
commit021bbaf5a142c5ebbc5b1f9c4d30cc1aa796506e (patch)
tree075919365be3ca52bf468b3a0f6203a05ba85c7c /archiva-modules/archiva-base
parentae9b10930639f230ebbc017d0a78d7e95b5a42ae (diff)
downloadarchiva-021bbaf5a142c5ebbc5b1f9c4d30cc1aa796506e.tar.gz
archiva-021bbaf5a142c5ebbc5b1f9c4d30cc1aa796506e.zip
[MRM-1807] Archiva wrapper fail to start
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/runtime/RedbackRuntimeConfigurationAdmin.java5
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java27
2 files changed, 22 insertions, 10 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/runtime/RedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/runtime/RedbackRuntimeConfigurationAdmin.java
index 3bb9a1199..8fae6a66a 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/runtime/RedbackRuntimeConfigurationAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/runtime/RedbackRuntimeConfigurationAdmin.java
@@ -27,6 +27,11 @@ import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
*/
public interface RedbackRuntimeConfigurationAdmin
{
+
+ static final String DEFAULT_RBAC_MANAGER_IMPL = "jdo";
+
+ static final String DEFAULT_USER_MANAGER_IMPL = "jdo";
+
RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
throws RepositoryAdminException;
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
index 2ff43b3d0..34ed1b606 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
@@ -52,7 +52,7 @@ import java.util.Set;
* @author Olivier Lamy
* @since 1.4-M4
*/
-@Service("redbackRuntimeConfigurationAdmin#default")
+@Service( "redbackRuntimeConfigurationAdmin#default" )
public class DefaultRedbackRuntimeConfigurationAdmin
extends AbstractRepositoryAdmin
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
@@ -68,9 +68,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
@Inject
public DefaultRedbackRuntimeConfigurationAdmin( ArchivaConfiguration archivaConfiguration,//
- @Named(value = "userConfiguration#redback") //
+ @Named( value = "userConfiguration#redback" ) //
UserConfiguration userConfiguration,
- @Named(value = "cache#users") Cache usersCache )
+ @Named( value = "cache#users" ) Cache usersCache )
{
this.archivaConfiguration = archivaConfiguration;
this.userConfiguration = userConfiguration;
@@ -92,7 +92,8 @@ public class DefaultRedbackRuntimeConfigurationAdmin
redbackRuntimeConfiguration = new RedbackRuntimeConfiguration();
// so migrate if available
String userManagerImpl =
- userConfiguration.getConcatenatedList( UserConfigurationKeys.USER_MANAGER_IMPL, "jdo" );
+ userConfiguration.getConcatenatedList( UserConfigurationKeys.USER_MANAGER_IMPL, //
+ DEFAULT_USER_MANAGER_IMPL );
if ( StringUtils.isNotEmpty( userManagerImpl ) )
{
String[] impls = StringUtils.split( userManagerImpl, ',' );
@@ -101,9 +102,14 @@ public class DefaultRedbackRuntimeConfigurationAdmin
redbackRuntimeConfiguration.getUserManagerImpls().add( impl );
}
}
+ else
+ {
+ redbackRuntimeConfiguration.getUserManagerImpls().add( DEFAULT_USER_MANAGER_IMPL );
+ }
String rbacManagerImpls =
- userConfiguration.getConcatenatedList( UserConfigurationKeys.RBAC_MANAGER_IMPL, "jdo" );
+ userConfiguration.getConcatenatedList( UserConfigurationKeys.RBAC_MANAGER_IMPL, //
+ DEFAULT_RBAC_MANAGER_IMPL );
if ( StringUtils.isNotEmpty( rbacManagerImpls ) )
{
@@ -113,6 +119,10 @@ public class DefaultRedbackRuntimeConfigurationAdmin
redbackRuntimeConfiguration.getRbacManagerImpls().add( impl );
}
}
+ else
+ {
+ redbackRuntimeConfiguration.getRbacManagerImpls().add( DEFAULT_RBAC_MANAGER_IMPL );
+ }
// now ldap
@@ -132,16 +142,13 @@ public class DefaultRedbackRuntimeConfigurationAdmin
ldapConfiguration.setBaseGroupsDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
- ldapConfiguration.getBaseDn() )
- );
+ ldapConfiguration.getBaseDn() ) );
ldapConfiguration.setContextFactory(
userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY,
isSunContextFactoryAvailable()
? "com.sun.jndi.ldap.LdapCtxFactory"
- : ""
- )
- );
+ : "" ) );
ldapConfiguration.setBindDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BINDDN, null ) );
ldapConfiguration.setPassword(