[MRM-1714] using LDAP can be configurable with the ui.

prepare redback

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1412808 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-11-23 10:10:28 +00:00
parent 781c294599
commit 5c0d601c8f
5 changed files with 24 additions and 0 deletions

View File

@ -25,6 +25,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
/**
* AbstractUserManager
*
@ -139,4 +141,10 @@ public User createGuestUser()
user = addUser( user );
return user;
}
public void initialize()
{
// no op prevent sub classes to need implement this method
// sub classes can implement their own
}
}

View File

@ -198,4 +198,12 @@ void deleteUser( String username )
User updateUser( User user, boolean passwordChangeRequired )
throws UserNotFoundException;
/**
* consumer of user manager can use it to reload various configuration
* with the configurable implementation is possible to change dynamically the real implementation used.
* @since 2.1
*/
void initialize();
}

View File

@ -318,4 +318,9 @@ public void setUsersCache( Cache usersCache )
{
this.usersCache = usersCache;
}
public void initialize()
{
// no op configurable impl do the job
}
}

View File

@ -37,6 +37,7 @@
@Service( "userManager#configurable" )
public class ConfigurableUserManager
extends AbstractUserManager
implements UserManager
{
@Inject
@Named( value = "userConfiguration" )

View File

@ -24,6 +24,7 @@
import org.apache.archiva.redback.common.ldap.UserMapper;
import org.apache.archiva.redback.users.AbstractUserManager;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserManager;
import org.apache.archiva.redback.users.UserNotFoundException;
import org.apache.archiva.redback.common.ldap.MappingException;
import org.apache.archiva.redback.common.ldap.connection.LdapConnection;
@ -49,6 +50,7 @@
@Service( "userManager#ldap" )
public class LdapUserManager
extends AbstractUserManager
implements UserManager
{
@Inject
@Named( value = "ldapConnectionFactory#configurable" )