]> source.dussan.org Git - archiva.git/blob
7801ded471d5de61adfa88087c58dceaef06d858
[archiva.git] /
1 package org.apache.archiva.admin.repository.runtime;
2 /*
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
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
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
18  * under the License.
19  */
20
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.RedbackRuntimeConfiguration;
26 import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
27 import org.apache.archiva.configuration.ArchivaConfiguration;
28 import org.apache.archiva.configuration.Configuration;
29 import org.apache.archiva.configuration.ConfigurationEvent;
30 import org.apache.archiva.configuration.ConfigurationListener;
31 import org.apache.archiva.configuration.IndeterminateConfigurationException;
32 import org.apache.archiva.redback.components.cache.Cache;
33 import org.apache.archiva.redback.components.registry.RegistryException;
34 import org.apache.archiva.redback.configuration.UserConfiguration;
35 import org.apache.archiva.redback.configuration.UserConfigurationException;
36 import org.apache.archiva.redback.configuration.UserConfigurationKeys;
37 import org.apache.commons.lang.StringUtils;
38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory;
40 import org.springframework.stereotype.Service;
41
42 import javax.annotation.PostConstruct;
43 import javax.inject.Inject;
44 import javax.inject.Named;
45 import java.util.Collection;
46 import java.util.HashMap;
47 import java.util.HashSet;
48 import java.util.List;
49 import java.util.Map;
50 import java.util.Set;
51
52 /**
53  * @author Olivier Lamy
54  * @since 1.4-M4
55  */
56 @Service( "userConfiguration#archiva" )
57 public class DefaultRedbackRuntimeConfigurationAdmin
58     implements RedbackRuntimeConfigurationAdmin, UserConfiguration
59 {
60
61     protected Logger log = LoggerFactory.getLogger( getClass() );
62
63     @Inject
64     private ArchivaConfiguration archivaConfiguration;
65
66     @Inject
67     @Named( value = "userConfiguration#redback" )
68     UserConfiguration userConfiguration;
69
70     @Inject
71     @Named( value = "cache#users" )
72     private Cache usersCache;
73
74     @PostConstruct
75     public void initialize()
76         throws UserConfigurationException
77     {
78         try
79         {
80             RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfiguration();
81             // migrate or not data from redback
82             if ( !redbackRuntimeConfiguration.isMigratedFromRedbackConfiguration() )
83             {
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 ) )
90                 {
91                     String[] impls = StringUtils.split( userManagerImpl, ',' );
92                     for ( String impl : impls )
93                     {
94                         redbackRuntimeConfiguration.getUserManagerImpls().add( impl );
95                     }
96                 }
97
98                 String rbacManagerImpls =
99                     userConfiguration.getConcatenatedList( UserConfigurationKeys.RBAC_MANAGER_IMPL, "jdo" );
100
101                 if ( StringUtils.isNotEmpty( rbacManagerImpls ) )
102                 {
103                     String[] impls = StringUtils.split( rbacManagerImpls, ',' );
104                     for ( String impl : impls )
105                     {
106                         redbackRuntimeConfiguration.getRbacManagerImpls().add( impl );
107                     }
108                 }
109
110                 // now ldap
111
112                 LdapConfiguration ldapConfiguration = redbackRuntimeConfiguration.getLdapConfiguration();
113                 if ( ldapConfiguration == null )
114                 {
115                     ldapConfiguration = new LdapConfiguration();
116                     redbackRuntimeConfiguration.setLdapConfiguration( ldapConfiguration );
117                 }
118
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 ) );
125
126                 ldapConfiguration.setBaseGroupsDn(
127                     userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
128                                                            ldapConfiguration.getBaseDn() ) );
129
130                 ldapConfiguration.setContextFactory(
131                     userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY, null ) );
132                 ldapConfiguration.setBindDn(
133                     userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BINDDN, null ) );
134                 ldapConfiguration.setPassword(
135                     userConfiguration.getString( UserConfigurationKeys.LDAP_PASSWORD, null ) );
136                 ldapConfiguration.setAuthenticationMethod(
137                     userConfiguration.getString( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD, null ) );
138
139                 ldapConfiguration.setWritable(
140                     userConfiguration.getBoolean( UserConfigurationKeys.LDAP_WRITABLE, false ) );
141
142                 ldapConfiguration.setUseRoleNameAsGroup(
143                     userConfiguration.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, false ) );
144
145                 ldapConfiguration.setBindAuthenticatorEnabled(
146                     userConfiguration.getBoolean( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED, false ) );
147
148                 redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
149
150                 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
151
152             }
153             // we must ensure userManagerImpls list is not empty if so put at least jdo one !
154             if ( redbackRuntimeConfiguration.getUserManagerImpls().isEmpty() )
155             {
156                 log.info(
157                     "redbackRuntimeConfiguration with empty userManagerImpls so force at least jdo implementation !" );
158                 redbackRuntimeConfiguration.getUserManagerImpls().add( "jdo" );
159                 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
160             }
161
162             // we ensure authorizerImpls is not empty if so put
163             if ( redbackRuntimeConfiguration.getRbacManagerImpls().isEmpty() )
164             {
165                 log.info(
166                     "redbackRuntimeConfiguration with empty rbacManagerImpls so force at least cached implementation !" );
167                 redbackRuntimeConfiguration.getRbacManagerImpls().add( "cached" );
168                 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
169             }
170
171             boolean save = false;
172
173             // NPE free
174             if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
175             {
176                 redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
177             }
178             // if -1 it means non initialized to take values from the spring bean
179             if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToIdleSeconds() < 0 )
180             {
181                 redbackRuntimeConfiguration.getUsersCacheConfiguration().setTimeToIdleSeconds(
182                     usersCache.getTimeToIdleSeconds() );
183                 save = true;
184
185             }
186             usersCache.setTimeToIdleSeconds(
187                 redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToIdleSeconds() );
188
189             if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToLiveSeconds() < 0 )
190             {
191                 redbackRuntimeConfiguration.getUsersCacheConfiguration().setTimeToLiveSeconds(
192                     usersCache.getTimeToLiveSeconds() );
193                 save = true;
194
195             }
196             usersCache.setTimeToLiveSeconds(
197                 redbackRuntimeConfiguration.getUsersCacheConfiguration().getTimeToLiveSeconds() );
198
199             if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsInMemory() < 0 )
200             {
201                 redbackRuntimeConfiguration.getUsersCacheConfiguration().setMaxElementsInMemory(
202                     usersCache.getMaxElementsInMemory() );
203                 save = true;
204             }
205             usersCache.setMaxElementsInMemory(
206                 redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsInMemory() );
207
208             if ( redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() < 0 )
209             {
210                 redbackRuntimeConfiguration.getUsersCacheConfiguration().setMaxElementsOnDisk(
211                     usersCache.getMaxElementsOnDisk() );
212                 save = true;
213             }
214             usersCache.setMaxElementsOnDisk(
215                 redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() );
216
217             if ( save )
218             {
219                 updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
220             }
221
222         }
223         catch ( RepositoryAdminException e )
224         {
225             throw new UserConfigurationException( e.getMessage(), e );
226         }
227     }
228
229     public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
230     {
231         return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() );
232     }
233
234     public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
235         throws RepositoryAdminException
236     {
237         org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration =
238             build( redbackRuntimeConfiguration );
239         Configuration configuration = archivaConfiguration.getConfiguration();
240         configuration.setRedbackRuntimeConfiguration( runtimeConfiguration );
241         try
242         {
243             archivaConfiguration.save( configuration );
244         }
245         catch ( RegistryException e )
246         {
247             throw new RepositoryAdminException( e.getMessage(), e );
248         }
249         catch ( IndeterminateConfigurationException e )
250         {
251             throw new RepositoryAdminException( e.getMessage(), e );
252         }
253     }
254
255     private RedbackRuntimeConfiguration build(
256         org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
257     {
258         RedbackRuntimeConfiguration redbackRuntimeConfiguration =
259             new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
260
261         if ( runtimeConfiguration.getLdapConfiguration() != null )
262         {
263             redbackRuntimeConfiguration.setLdapConfiguration(
264                 new BeanReplicator().replicateBean( runtimeConfiguration.getLdapConfiguration(),
265                                                     LdapConfiguration.class ) );
266         }
267
268         if ( runtimeConfiguration.getUsersCacheConfiguration() != null )
269         {
270             redbackRuntimeConfiguration.setUsersCacheConfiguration(
271                 new BeanReplicator().replicateBean( runtimeConfiguration.getUsersCacheConfiguration(),
272                                                     CacheConfiguration.class ) );
273         }
274
275         if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
276         {
277             // prevent NPE
278             redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
279         }
280
281         if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
282         {
283             redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
284         }
285
286         cleanupProperties( redbackRuntimeConfiguration );
287
288         return redbackRuntimeConfiguration;
289     }
290
291     /**
292      * cleaning from map properties used directly in archiva configuration fields
293      *
294      * @param redbackRuntimeConfiguration
295      */
296     private void cleanupProperties( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
297     {
298         Map<String, String> properties = redbackRuntimeConfiguration.getConfigurationProperties();
299         properties.remove( UserConfigurationKeys.LDAP_HOSTNAME );
300         properties.remove( UserConfigurationKeys.LDAP_PORT );
301         properties.remove( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED );
302         properties.remove( UserConfigurationKeys.LDAP_SSL );
303         properties.remove( UserConfigurationKeys.LDAP_BASEDN );
304         properties.remove( UserConfigurationKeys.LDAP_GROUPS_BASEDN );
305         properties.remove( UserConfigurationKeys.LDAP_CONTEX_FACTORY );
306         properties.remove( UserConfigurationKeys.LDAP_BINDDN );
307         properties.remove( UserConfigurationKeys.LDAP_PASSWORD );
308         properties.remove( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD );
309         properties.remove( UserConfigurationKeys.LDAP_WRITABLE );
310         properties.remove( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME );
311         // cleanup groups <-> role mapping
312         /**for ( Map.Entry<String, String> entry : new HashMap<String, String>( properties ).entrySet() )
313          {
314          if ( entry.getKey().startsWith( UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) )
315          {
316          properties.remove( entry.getKey() );
317          }
318          }*/
319     }
320
321     private org.apache.archiva.configuration.RedbackRuntimeConfiguration build(
322         RedbackRuntimeConfiguration archivaRuntimeConfiguration )
323     {
324         org.apache.archiva.configuration.RedbackRuntimeConfiguration redbackRuntimeConfiguration =
325             new BeanReplicator().replicateBean( archivaRuntimeConfiguration,
326                                                 org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
327
328         if ( archivaRuntimeConfiguration.getLdapConfiguration() == null )
329         {
330             archivaRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
331         }
332         redbackRuntimeConfiguration.setLdapConfiguration(
333             new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getLdapConfiguration(),
334                                                 org.apache.archiva.configuration.LdapConfiguration.class ) );
335
336         if ( archivaRuntimeConfiguration.getUsersCacheConfiguration() == null )
337         {
338             archivaRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
339         }
340
341         redbackRuntimeConfiguration.setUsersCacheConfiguration(
342             new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUsersCacheConfiguration(),
343                                                 org.apache.archiva.configuration.CacheConfiguration.class ) );
344
345         return redbackRuntimeConfiguration;
346     }
347
348     // wrapper for UserConfiguration to intercept values (and store it not yet migrated
349
350
351     public String getString( String key )
352     {
353         if ( UserConfigurationKeys.USER_MANAGER_IMPL.equals( key ) )
354         {
355             // possible false for others than archiva user manager
356             return getRedbackRuntimeConfiguration().getUserManagerImpls().get( 0 );
357         }
358
359         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
360
361         if ( conf.getConfigurationProperties().containsKey( key ) )
362         {
363             return conf.getConfigurationProperties().get( key );
364         }
365
366         String value = userConfiguration.getString( key );
367         if ( value == null )
368         {
369             return null;
370         }
371         conf.getConfigurationProperties().put( key, value );
372
373         try
374         {
375             updateRedbackRuntimeConfiguration( conf );
376         }
377         catch ( RepositoryAdminException e )
378         {
379             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
380             throw new RuntimeException( e.getMessage(), e );
381         }
382
383         return value;
384     }
385
386     public String getString( String key, String defaultValue )
387     {
388         if ( UserConfigurationKeys.LDAP_HOSTNAME.equals( key ) )
389         {
390             return getRedbackRuntimeConfiguration().getLdapConfiguration().getHostName();
391         }
392         if ( UserConfigurationKeys.LDAP_CONTEX_FACTORY.equals( key ) )
393         {
394             return getRedbackRuntimeConfiguration().getLdapConfiguration().getContextFactory();
395         }
396         if ( UserConfigurationKeys.LDAP_PASSWORD.equals( key ) )
397         {
398             return getRedbackRuntimeConfiguration().getLdapConfiguration().getPassword();
399         }
400         if ( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD.equals( key ) )
401         {
402             return getRedbackRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
403         }
404
405         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
406
407         if ( conf.getConfigurationProperties().containsKey( key ) )
408         {
409             return conf.getConfigurationProperties().get( key );
410         }
411
412         String value = userConfiguration.getString( key, defaultValue );
413
414         if ( value == null )
415         {
416             return null;
417         }
418
419         conf.getConfigurationProperties().put( key, value );
420         try
421         {
422             updateRedbackRuntimeConfiguration( conf );
423         }
424         catch ( RepositoryAdminException e )
425         {
426             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
427             throw new RuntimeException( e.getMessage(), e );
428         }
429
430         return value;
431     }
432
433     public int getInt( String key )
434     {
435         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
436
437         if ( conf.getConfigurationProperties().containsKey( key ) )
438         {
439             return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
440         }
441
442         int value = userConfiguration.getInt( key );
443
444         conf.getConfigurationProperties().put( key, Integer.toString( value ) );
445         try
446         {
447             updateRedbackRuntimeConfiguration( conf );
448         }
449         catch ( RepositoryAdminException e )
450         {
451             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
452             throw new RuntimeException( e.getMessage(), e );
453         }
454
455         return value;
456     }
457
458     public int getInt( String key, int defaultValue )
459     {
460         if ( UserConfigurationKeys.LDAP_PORT.equals( key ) )
461         {
462             return getRedbackRuntimeConfiguration().getLdapConfiguration().getPort();
463         }
464
465         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
466
467         if ( conf.getConfigurationProperties().containsKey( key ) )
468         {
469             return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
470         }
471
472         int value = userConfiguration.getInt( key, defaultValue );
473
474         conf.getConfigurationProperties().put( key, Integer.toString( value ) );
475         try
476         {
477             updateRedbackRuntimeConfiguration( conf );
478         }
479         catch ( RepositoryAdminException e )
480         {
481             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
482             throw new RuntimeException( e.getMessage(), e );
483         }
484
485         return value;
486     }
487
488     public boolean getBoolean( String key )
489     {
490         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
491
492         if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
493         {
494             return conf.getLdapConfiguration().isWritable();
495         }
496
497         if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) )
498         {
499             return conf.getLdapConfiguration().isUseRoleNameAsGroup();
500         }
501
502         if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
503         {
504             return conf.getLdapConfiguration().isBindAuthenticatorEnabled();
505         }
506
507         if ( conf.getConfigurationProperties().containsKey( key ) )
508         {
509             return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
510         }
511
512         boolean value = userConfiguration.getBoolean( key );
513
514         conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
515         try
516         {
517             updateRedbackRuntimeConfiguration( conf );
518         }
519         catch ( RepositoryAdminException e )
520         {
521             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
522             throw new RuntimeException( e.getMessage(), e );
523         }
524
525         return value;
526     }
527
528     public boolean getBoolean( String key, boolean defaultValue )
529     {
530         if ( UserConfigurationKeys.LDAP_SSL.equals( key ) )
531         {
532             return getRedbackRuntimeConfiguration().getLdapConfiguration().isSsl();
533         }
534
535         if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
536         {
537             return getRedbackRuntimeConfiguration().getLdapConfiguration().isWritable();
538         }
539
540         if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) )
541         {
542             return getRedbackRuntimeConfiguration().getLdapConfiguration().isUseRoleNameAsGroup();
543         }
544
545         if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
546         {
547             return getRedbackRuntimeConfiguration().getLdapConfiguration().isBindAuthenticatorEnabled();
548         }
549
550         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
551
552         if ( conf.getConfigurationProperties().containsKey( key ) )
553         {
554             return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
555         }
556
557         boolean value = userConfiguration.getBoolean( key, defaultValue );
558
559         conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
560         try
561         {
562             updateRedbackRuntimeConfiguration( conf );
563         }
564         catch ( RepositoryAdminException e )
565         {
566             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
567             throw new RuntimeException( e.getMessage(), e );
568         }
569
570         return value;
571     }
572
573     public List<String> getList( String key )
574     {
575         List<String> value = userConfiguration.getList( key );
576
577         RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
578         // TODO concat values
579         conf.getConfigurationProperties().put( key, "" );
580         try
581         {
582             updateRedbackRuntimeConfiguration( conf );
583         }
584         catch ( RepositoryAdminException e )
585         {
586             log.error( "fail to save RedbackRuntimeConfiguration: {}", e.getMessage(), e );
587             throw new RuntimeException( e.getMessage(), e );
588         }
589
590         return value;
591     }
592
593     public String getConcatenatedList( String key, String defaultValue )
594     {
595         if ( UserConfigurationKeys.LDAP_BASEDN.equals( key ) )
596         {
597             return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseDn();
598         }
599         if ( UserConfigurationKeys.LDAP_BINDDN.equals( key ) )
600         {
601             return getRedbackRuntimeConfiguration().getLdapConfiguration().getBindDn();
602         }
603         if ( UserConfigurationKeys.LDAP_GROUPS_BASEDN.equals( key ) )
604         {
605             return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseGroupsDn();
606         }
607         return userConfiguration.getConcatenatedList( key, defaultValue );
608     }
609
610     public Collection<String> getKeys()
611     {
612         Collection<String> keys = userConfiguration.getKeys();
613
614         Set<String> keysSet = new HashSet<String>( keys );
615
616         keysSet.addAll( getRedbackRuntimeConfiguration().getConfigurationProperties().keySet() );
617
618         return keysSet;
619     }
620
621
622 }