diff options
author | Olivier Lamy <olamy@apache.org> | 2012-11-23 16:32:46 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-11-23 16:32:46 +0000 |
commit | e6ddd34c22343feed66a4e859ed87a69f9c65604 (patch) | |
tree | d7511bd972d2cfb453474fdcbc4ba5cc245e7c0c /archiva-modules/archiva-web | |
parent | 835f13d0be0f208d9cfd87604276ade72228def4 (diff) | |
download | archiva-e6ddd34c22343feed66a4e859ed87a69f9c65604.tar.gz archiva-e6ddd34c22343feed66a4e859ed87a69f9c65604.zip |
[MRM-1714] using LDAP can be configurable with the ui
add a new userManager configured by archiva.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1412946 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
3 files changed, 21 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java index 7faae9e23..e8727f87b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java @@ -21,17 +21,20 @@ package org.apache.archiva.rest.services; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration; import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin; +import org.apache.archiva.redback.users.UserManager; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.ArchivaRuntimeConfigurationService; +import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import javax.inject.Inject; +import javax.inject.Named; /** * @author Olivier Lamy * @since 1.4-M4 */ -@Service ( "archivaRuntimeConfigurationService#rest" ) +@Service ("archivaRuntimeConfigurationService#rest") public class DefaultArchivaRuntimeConfigurationService extends AbstractRestService implements ArchivaRuntimeConfigurationService @@ -39,6 +42,10 @@ public class DefaultArchivaRuntimeConfigurationService @Inject private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin; + @Inject + @Named ( value = "userManager#archiva" ) + private UserManager userManager; + public ArchivaRuntimeConfiguration getArchivaRuntimeConfigurationAdmin() throws ArchivaRestServiceException { @@ -57,7 +64,18 @@ public class DefaultArchivaRuntimeConfigurationService { try { + // has user manager impl changed ? + boolean userManagerChanged = !StringUtils.equals( archivaRuntimeConfiguration.getUserManagerImpl(), + archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfigurationAdmin().getUserManagerImpl() ); archivaRuntimeConfigurationAdmin.updateArchivaRuntimeConfiguration( archivaRuntimeConfiguration ); + + if ( userManagerChanged ) + { + log.info( "user manager impl changed to {} reload it", + archivaRuntimeConfiguration.getUserManagerImpl() ); + userManager.initialize(); + } + return Boolean.TRUE; } catch ( RepositoryAdminException e ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml index ea18caee1..4df10a85b 100755 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml @@ -34,7 +34,7 @@ default-lazy-init="true"> <context:annotation-config/> - <context:component-scan base-package="org.apache.archiva.web.spring, org.apache.archiva.web.startup, org.apache.archiva.web.runtime, org.apache.archiva.web.api"/> + <context:component-scan base-package="org.apache.archiva.web.spring, org.apache.archiva.web.startup, org.apache.archiva.web.runtime, org.apache.archiva.web.api,, org.apache.archiva.web.security"/> <util:properties id="archivaRuntimeProperties" location="classpath:application.properties" /> diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml index 9a123e45e..ff6da7f43 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml @@ -136,7 +136,7 @@ </property> </bean> - + <alias name="userManager#archiva" alias="userManager#configurable"/> <!-- <component> <role>org.apache.archiva.webdav.util.MimeTypes</role> |