add baseGroupDn in archiva configuration

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1444880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-02-11 17:13:06 +00:00
parent fc846059c1
commit 22b57d7be9
4 changed files with 37 additions and 3 deletions

View File

@ -1571,6 +1571,12 @@
<version>1.4.0+</version>
<type>String</type>
</field>
<field>
<name>baseGroupsDn</name>
<description>The LDAP base dn for groups (if empty baseDn is used).</description>
<version>1.4.0+</version>
<type>String</type>
</field>
<field>
<name>contextFactory</name>
<description>contextFactory to use.</description>

View File

@ -65,6 +65,11 @@ public class LdapConfiguration
*/
private String bindDn;
/**
* The LDAP base dn for groups (if empty baseDn is used).
*/
private String baseGroupsDn;
/**
* The LDAP password.
*/
@ -216,4 +221,14 @@ public class LdapConfiguration
}
}
}
public String getBaseGroupsDn()
{
return baseGroupsDn;
}
public void setBaseGroupsDn( String baseGroupsDn )
{
this.baseGroupsDn = baseGroupsDn;
}
}

View File

@ -49,7 +49,7 @@ import java.util.Set;
* @author Olivier Lamy
* @since 1.4-M4
*/
@Service( "userConfiguration#archiva" )
@Service("userConfiguration#archiva")
public class DefaultRedbackRuntimeConfigurationAdmin
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
{
@ -60,11 +60,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
private ArchivaConfiguration archivaConfiguration;
@Inject
@Named( value = "userConfiguration#redback" )
@Named(value = "userConfiguration#redback")
UserConfiguration userConfiguration;
@Inject
@Named( value = "cache#users" )
@Named(value = "cache#users")
private Cache usersCache;
@PostConstruct
@ -118,6 +118,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
ldapConfiguration.setSsl( userConfiguration.getBoolean( UserConfigurationKeys.LDAP_SSL, false ) );
ldapConfiguration.setBaseDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BASEDN, null ) );
ldapConfiguration.setBaseGroupsDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
ldapConfiguration.getBaseDn() ) );
ldapConfiguration.setContextFactory(
userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY, null ) );
ldapConfiguration.setBindDn(
@ -520,6 +525,10 @@ public class DefaultRedbackRuntimeConfigurationAdmin
{
return getRedbackRuntimeConfiguration().getLdapConfiguration().getBindDn();
}
if ( UserConfigurationKeys.LDAP_GROUPS_BASEDN.equals( key ) )
{
return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseGroupsDn();
}
return userConfiguration.getConcatenatedList( key, defaultValue );
}

View File

@ -35,6 +35,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
import javax.inject.Named;
import javax.ws.rs.core.Response;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
@ -63,6 +64,9 @@ public class DefaultSystemStatusService
private RepositoryScanner scanner;
// display spring scheduled
//@Inject @Named (value="springScheduler");
@Inject
public DefaultSystemStatusService( ApplicationContext applicationContext, RepositoryScanner scanner )