reload ldapusermapper in case of configuration change

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1428122 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-01-03 00:15:11 +00:00
parent 6934942173
commit 19f3903ae1
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import org.apache.archiva.admin.model.beans.LdapConfiguration;
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.LdapUserMapper;
import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
import org.apache.archiva.redback.common.ldap.connection.LdapConnectionConfiguration;
import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory;
@ -78,6 +79,9 @@ public class DefaultRedbackRuntimeConfigurationService
@Named(value = "cache#users")
private Cache usersCache;
@Inject
private LdapUserMapper ldapUserMapper;
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
throws ArchivaRestServiceException
@ -149,6 +153,9 @@ public class DefaultRedbackRuntimeConfigurationService
usersCache.setMaxElementsOnDisk(
redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() );
ldapUserMapper.initialize();
return Boolean.TRUE;
}
catch ( AuthenticationException e )