1 package org.apache.archiva.admin.repository.runtime;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import net.sf.beanlib.provider.replicator.BeanReplicator;
22 import org.apache.archiva.admin.model.RepositoryAdminException;
23 import org.apache.archiva.admin.model.beans.CacheConfiguration;
24 import org.apache.archiva.admin.model.beans.LdapConfiguration;
25 import org.apache.archiva.admin.model.beans.LdapGroupMapping;
26 import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
27 import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
28 import org.apache.archiva.configuration.ArchivaConfiguration;
29 import org.apache.archiva.configuration.Configuration;
30 import org.apache.archiva.configuration.IndeterminateConfigurationException;
31 import org.apache.archiva.redback.components.cache.Cache;
32 import org.apache.archiva.redback.components.registry.RegistryException;
33 import org.apache.archiva.redback.configuration.UserConfiguration;
34 import org.apache.archiva.redback.configuration.UserConfigurationException;
35 import org.apache.archiva.redback.configuration.UserConfigurationKeys;
36 import org.apache.commons.lang.StringUtils;
37 import org.slf4j.Logger;
38 import org.slf4j.LoggerFactory;
39 import org.springframework.stereotype.Service;
41 import javax.annotation.PostConstruct;
42 import javax.inject.Inject;
43 import javax.inject.Named;
44 import java.util.ArrayList;
45 import java.util.Collection;
46 import java.util.HashMap;
47 import java.util.HashSet;
48 import java.util.List;
53 * @author Olivier Lamy
56 @Service( "redbackRuntimeConfigurationAdmin#default" )
57 public class DefaultRedbackRuntimeConfigurationAdmin
58 implements RedbackRuntimeConfigurationAdmin, UserConfiguration
61 protected Logger log = LoggerFactory.getLogger( getClass() );
64 private ArchivaConfiguration archivaConfiguration;
67 @Named( value = "userConfiguration#redback" )
68 private UserConfiguration userConfiguration;
71 @Named( value = "cache#users" )
72 private Cache usersCache;
75 public void initialize()
76 throws UserConfigurationException
80 RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfiguration();
81 // migrate or not data from redback
82 if ( !redbackRuntimeConfiguration.isMigratedFromRedbackConfiguration() )
84 // not migrated so build a new fresh one
85 redbackRuntimeConfiguration = new RedbackRuntimeConfiguration();
86 // so migrate if available
87 String userManagerImpl =
88 userConfiguration.getConcatenatedList( UserConfigurationKeys.USER_MANAGER_IMPL, "jdo" );
89 if ( StringUtils.isNotEmpty( userManagerImpl ) )
91 String[] impls = StringUtils.split( userManagerImpl, ',' );
92 for ( String impl : impls )
94 redbackRuntimeConfiguration.getUserManagerImpls().add( impl );
98 String rbacManagerImpls =
99 userConfiguration.getConcatenatedList( UserConfigurationKeys.RBAC_MANAGER_IMPL, "jdo" );
101 if ( StringUtils.isNotEmpty( rbacManagerImpls ) )
103 String[] impls = StringUtils.split( rbacManagerImpls, ',' );
104 for ( String impl : impls )
106 redbackRuntimeConfiguration.getRbacManagerImpls().add( impl );
112 LdapConfiguration ldapConfiguration = redbackRuntimeConfiguration.getLdapConfiguration();
113 if ( ldapConfiguration == null )
115 ldapConfiguration = new LdapConfiguration();
116 redbackRuntimeConfiguration.setLdapConfiguration( ldapConfiguration );
119 ldapConfiguration.setHostName(
120 userConfiguration.getString( UserConfigurationKeys.LDAP_HOSTNAME, null ) );
121 ldapConfiguration.setPort( userConfiguration.getInt( UserConfigurationKeys.LDAP_PORT, -1 ) );
122 ldapConfiguration.setSsl( userConfiguration.getBoolean( UserConfigurationKeys.LDAP_SSL, false ) );
123 ldapConfiguration.setBaseDn(
124 userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BASEDN, null ) );
126 ldapConfiguration.setBaseGroupsDn(
127 userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
128 ldapConfiguration.getBaseDn() ) );
130 ldapConfiguration.setContextFactory(
131 userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY,
132 isSunContextFactoryAvailable()
133 ? "com.sun.jndi.ldap.LdapCtxFactory"
135 ldapConfiguration.setBindDn(
136 userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BINDDN, null ) );
137 ldapConfiguration.setPassword(
138 userConfiguration.getString( UserConfigurationKeys.LDAP_PASSWORD, null ) );
139 ldapConfiguration.setAuthenticationMethod(
140 userConfiguration.getString( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD, null ) );
142 ldapConfiguration.setWritable(
143 userConfiguration.getBoolean( UserConfigurationKeys.LDAP_WRITABLE, false ) );
145 ldapConfiguration.setUseRoleNameAsGroup(
146 userConfiguration.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, false ) );
148 boolean ldapBindAuthenticatorEnabled =
149 userConfiguration.getBoolean( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED, false );
150 ldapConfiguration.setBindAuthenticatorEnabled( ldapBindAuthenticatorEnabled );
152 // LDAP groups mapping reading !!
153 // UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY
154 // userConfiguration.getKeys()
156 Collection<String> keys = userConfiguration.getKeys();
158 List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>();
160 for ( String key : keys )
162 if ( key.startsWith( UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) )
165 StringUtils.substringAfter( key, UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY );
166 String val = userConfiguration.getConcatenatedList( key, "" );
167 if ( !StringUtils.isEmpty( val ) )
169 String[] roles = StringUtils.split( val, ',' );
170 ldapGroupMappings.add( new LdapGroupMapping( group, roles ) );
175 redbackRuntimeConfiguration.setLdapGroupMappings( ldapGroupMappings );
177 redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
179 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
182 // we must ensure userManagerImpls list is not empty if so put at least jdo one !
183 if ( redbackRuntimeConfiguration.getUserManagerImpls().isEmpty() )
186 "redbackRuntimeConfiguration with empty userManagerImpls so force at least jdo implementation !" );
187 redbackRuntimeConfiguration.getUserManagerImpls().add( "jdo" );
188 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
191 // we ensure authorizerImpls is not empty if so put
192 if ( redbackRuntimeConfiguration.getRbacManagerImpls().isEmpty() )
195 "redbackRuntimeConfiguration with empty rbacManagerImpls so force at least cached implementation !" );
196 redbackRuntimeConfiguration.getRbacManagerImpls().add( "cached" );
197 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
200 boolean save = false;
203 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
205 redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
207 // if -1 it means non initialized to take values from the spring bean
208 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToIdleSeconds() < 0 )
210 redbackRuntimeConfiguration.getUsersCacheConfiguration().setTimeToIdleSeconds(
211 usersCache.getTimeToIdleSeconds() );
215 usersCache.setTimeToIdleSeconds(
216 redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToIdleSeconds() );
218 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToLiveSeconds() < 0 )
220 redbackRuntimeConfiguration.getUsersCacheConfiguration().setTimeToLiveSeconds(
221 usersCache.getTimeToLiveSeconds() );
225 usersCache.setTimeToLiveSeconds(
226 redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToLiveSeconds() );
228 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsInMemory() < 0 )
230 redbackRuntimeConfiguration.getUsersCacheConfiguration().setMaxElementsInMemory(
231 usersCache.getMaxElementsInMemory() );
234 usersCache.setMaxElementsInMemory(
235 redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsInMemory() );
237 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() < 0 )
239 redbackRuntimeConfiguration.getUsersCacheConfiguration().setMaxElementsOnDisk(
240 usersCache.getMaxElementsOnDisk() );
243 usersCache.setMaxElementsOnDisk(
244 redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() );
248 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
252 catch ( RepositoryAdminException e )
254 throw new UserConfigurationException( e.getMessage(), e );
258 private boolean isSunContextFactoryAvailable()
262 return Thread.currentThread().getContextClassLoader().loadClass( "com.sun.jndi.ldap.LdapCtxFactory" )
265 catch ( ClassNotFoundException e )
271 public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
273 return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() );
276 public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
277 throws RepositoryAdminException
279 org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration =
280 build( redbackRuntimeConfiguration );
281 Configuration configuration = archivaConfiguration.getConfiguration();
282 configuration.setRedbackRuntimeConfiguration( runtimeConfiguration );
285 archivaConfiguration.save( configuration );
287 catch ( RegistryException e )
289 throw new RepositoryAdminException( e.getMessage(), e );
291 catch ( IndeterminateConfigurationException e )
293 throw new RepositoryAdminException( e.getMessage(), e );
297 private RedbackRuntimeConfiguration build(
298 org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
300 RedbackRuntimeConfiguration redbackRuntimeConfiguration =
301 new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
303 if ( runtimeConfiguration.getLdapConfiguration() != null )
305 redbackRuntimeConfiguration.setLdapConfiguration(
306 new BeanReplicator().replicateBean( runtimeConfiguration.getLdapConfiguration(),
307 LdapConfiguration.class ) );
310 if ( runtimeConfiguration.getUsersCacheConfiguration() != null )
312 redbackRuntimeConfiguration.setUsersCacheConfiguration(
313 new BeanReplicator().replicateBean( runtimeConfiguration.getUsersCacheConfiguration(),
314 CacheConfiguration.class ) );
317 if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
320 redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
323 if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
325 redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
328 List<org.apache.archiva.configuration.LdapGroupMapping> mappings = runtimeConfiguration.getLdapGroupMappings();
330 if ( mappings != null && mappings.size() > 0 )
332 List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>( mappings.size() );
334 for ( org.apache.archiva.configuration.LdapGroupMapping mapping : mappings )
336 ldapGroupMappings.add( new LdapGroupMapping( mapping.getGroup(), mapping.getRoleNames() ) );
339 redbackRuntimeConfiguration.setLdapGroupMappings( ldapGroupMappings );
342 cleanupProperties( redbackRuntimeConfiguration );
344 return redbackRuntimeConfiguration;
348 * cleaning from map properties used directly in archiva configuration fields
350 * @param redbackRuntimeConfiguration
352 private void cleanupProperties( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
354 Map<String, String> properties = redbackRuntimeConfiguration.getConfigurationProperties();
355 properties.remove( UserConfigurationKeys.LDAP_HOSTNAME );
356 properties.remove( UserConfigurationKeys.LDAP_PORT );
357 properties.remove( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED );
358 properties.remove( UserConfigurationKeys.LDAP_SSL );
359 properties.remove( UserConfigurationKeys.LDAP_BASEDN );
360 properties.remove( UserConfigurationKeys.LDAP_GROUPS_BASEDN );
361 properties.remove( UserConfigurationKeys.LDAP_CONTEX_FACTORY );
362 properties.remove( UserConfigurationKeys.LDAP_BINDDN );
363 properties.remove( UserConfigurationKeys.LDAP_PASSWORD );
364 properties.remove( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD );
365 properties.remove( UserConfigurationKeys.LDAP_WRITABLE );
366 properties.remove( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME );
367 // cleanup groups <-> role mapping
368 /**for ( Map.Entry<String, String> entry : new HashMap<String, String>( properties ).entrySet() )
370 if ( entry.getKey().startsWith( UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) )
372 properties.remove( entry.getKey() );
377 private org.apache.archiva.configuration.RedbackRuntimeConfiguration build(
378 RedbackRuntimeConfiguration archivaRuntimeConfiguration )
380 org.apache.archiva.configuration.RedbackRuntimeConfiguration redbackRuntimeConfiguration =
381 new BeanReplicator().replicateBean( archivaRuntimeConfiguration,
382 org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
384 if ( archivaRuntimeConfiguration.getLdapConfiguration() == null )
386 archivaRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
388 redbackRuntimeConfiguration.setLdapConfiguration(
389 new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getLdapConfiguration(),
390 org.apache.archiva.configuration.LdapConfiguration.class ) );
392 if ( archivaRuntimeConfiguration.getUsersCacheConfiguration() == null )
394 archivaRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
397 redbackRuntimeConfiguration.setUsersCacheConfiguration(
398 new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUsersCacheConfiguration(),
399 org.apache.archiva.configuration.CacheConfiguration.class ) );
401 List<LdapGroupMapping> ldapGroupMappings = archivaRuntimeConfiguration.getLdapGroupMappings();
403 if ( ldapGroupMappings != null && ldapGroupMappings.size() > 0 )
406 List<org.apache.archiva.configuration.LdapGroupMapping> mappings =
407 new ArrayList<org.apache.archiva.configuration.LdapGroupMapping>( ldapGroupMappings.size() );
409 for ( LdapGroupMapping ldapGroupMapping : ldapGroupMappings )
412 org.apache.archiva.configuration.LdapGroupMapping mapping =
413 new org.apache.archiva.configuration.LdapGroupMapping();
414 mapping.setGroup( ldapGroupMapping.getGroup() );
415 mapping.setRoleNames( new ArrayList<String>( ldapGroupMapping.getRoleNames() ) );
416 mappings.add( mapping );
419 redbackRuntimeConfiguration.setLdapGroupMappings( mappings );
421 return redbackRuntimeConfiguration;
424 // wrapper for UserConfiguration to intercept values (and store it not yet migrated)
427 public String getString( String key )
429 if ( UserConfigurationKeys.USER_MANAGER_IMPL.equals( key ) )
431 // possible false for others than archiva user manager
432 return getRedbackRuntimeConfiguration().getUserManagerImpls().get( 0 );
435 if ( StringUtils.startsWith( key, UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) )
437 RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfiguration();
438 int index = redbackRuntimeConfiguration.getLdapGroupMappings().indexOf( new LdapGroupMapping(
439 StringUtils.substringAfter( key, UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) ) );
442 return StringUtils.join( redbackRuntimeConfiguration.getLdapGroupMappings().get( index ).getRoleNames(),
447 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
449 if ( conf.getConfigurationProperties().containsKey( key ) )
451 return conf.getConfigurationProperties().get( key );
454 String value = userConfiguration.getString( key );
459 conf.getConfigurationProperties().put( key, value );
463 updateRedbackRuntimeConfiguration( conf );
465 catch ( RepositoryAdminException e )
467 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
468 throw new RuntimeException( e.getMessage(), e );
474 public String getString( String key, String defaultValue )
476 if ( UserConfigurationKeys.LDAP_HOSTNAME.equals( key ) )
478 return getRedbackRuntimeConfiguration().getLdapConfiguration().getHostName();
480 if ( UserConfigurationKeys.LDAP_CONTEX_FACTORY.equals( key ) )
482 return getRedbackRuntimeConfiguration().getLdapConfiguration().getContextFactory();
484 if ( UserConfigurationKeys.LDAP_PASSWORD.equals( key ) )
486 return getRedbackRuntimeConfiguration().getLdapConfiguration().getPassword();
488 if ( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD.equals( key ) )
490 return getRedbackRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
493 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
495 if ( conf.getConfigurationProperties().containsKey( key ) )
497 return conf.getConfigurationProperties().get( key );
500 String value = userConfiguration.getString( key, defaultValue );
507 conf.getConfigurationProperties().put( key, value );
510 updateRedbackRuntimeConfiguration( conf );
512 catch ( RepositoryAdminException e )
514 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
515 throw new RuntimeException( e.getMessage(), e );
521 public int getInt( String key )
523 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
525 if ( conf.getConfigurationProperties().containsKey( key ) )
527 return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
530 int value = userConfiguration.getInt( key );
532 conf.getConfigurationProperties().put( key, Integer.toString( value ) );
535 updateRedbackRuntimeConfiguration( conf );
537 catch ( RepositoryAdminException e )
539 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
540 throw new RuntimeException( e.getMessage(), e );
546 public int getInt( String key, int defaultValue )
548 if ( UserConfigurationKeys.LDAP_PORT.equals( key ) )
550 return getRedbackRuntimeConfiguration().getLdapConfiguration().getPort();
553 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
555 if ( conf.getConfigurationProperties().containsKey( key ) )
557 return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
560 int value = userConfiguration.getInt( key, defaultValue );
562 conf.getConfigurationProperties().put( key, Integer.toString( value ) );
565 updateRedbackRuntimeConfiguration( conf );
567 catch ( RepositoryAdminException e )
569 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
570 throw new RuntimeException( e.getMessage(), e );
576 public boolean getBoolean( String key )
578 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
580 if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
582 return conf.getLdapConfiguration().isWritable();
585 if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) )
587 return conf.getLdapConfiguration().isUseRoleNameAsGroup();
590 if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
592 return conf.getLdapConfiguration().isBindAuthenticatorEnabled();
595 if ( conf.getConfigurationProperties().containsKey( key ) )
597 return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
600 boolean value = userConfiguration.getBoolean( key );
602 conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
605 updateRedbackRuntimeConfiguration( conf );
607 catch ( RepositoryAdminException e )
609 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
610 throw new RuntimeException( e.getMessage(), e );
616 public boolean getBoolean( String key, boolean defaultValue )
618 if ( UserConfigurationKeys.LDAP_SSL.equals( key ) )
620 return getRedbackRuntimeConfiguration().getLdapConfiguration().isSsl();
623 if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
625 return getRedbackRuntimeConfiguration().getLdapConfiguration().isWritable();
628 if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) )
630 return getRedbackRuntimeConfiguration().getLdapConfiguration().isUseRoleNameAsGroup();
633 if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
635 return getRedbackRuntimeConfiguration().getLdapConfiguration().isBindAuthenticatorEnabled();
638 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
640 if ( conf.getConfigurationProperties().containsKey( key ) )
642 return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
645 boolean value = userConfiguration.getBoolean( key, defaultValue );
647 conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
650 updateRedbackRuntimeConfiguration( conf );
652 catch ( RepositoryAdminException e )
654 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
655 throw new RuntimeException( e.getMessage(), e );
661 public List<String> getList( String key )
663 List<String> value = userConfiguration.getList( key );
665 RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
666 // TODO concat values
667 conf.getConfigurationProperties().put( key, "" );
670 updateRedbackRuntimeConfiguration( conf );
672 catch ( RepositoryAdminException e )
674 log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
675 throw new RuntimeException( e.getMessage(), e );
681 public String getConcatenatedList( String key, String defaultValue )
683 if ( UserConfigurationKeys.LDAP_BASEDN.equals( key ) )
685 return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseDn();
687 if ( UserConfigurationKeys.LDAP_BINDDN.equals( key ) )
689 return getRedbackRuntimeConfiguration().getLdapConfiguration().getBindDn();
691 if ( UserConfigurationKeys.LDAP_GROUPS_BASEDN.equals( key ) )
693 return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseGroupsDn();
695 return userConfiguration.getConcatenatedList( key, defaultValue );
698 public Collection<String> getKeys()
700 Collection<String> keys = userConfiguration.getKeys();
702 Set<String> keysSet = new HashSet<String>( keys );
704 keysSet.addAll( getRedbackRuntimeConfiguration().getConfigurationProperties().keySet() );