This project has retired. For details please refer to its Attic page.
Source code
001
002package org.apache.archiva.configuration.io.registry;
003
004import org.apache.archiva.redback.components.registry.Registry;
005
006// Util imports
007import java.util.*;
008
009// Model class imports
010import org.apache.archiva.configuration.Configuration;
011import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
012import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
013import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
014import org.apache.archiva.configuration.V1RepositoryConfiguration;
015import org.apache.archiva.configuration.LegacyArtifactPath;
016import org.apache.archiva.configuration.RepositoryGroupConfiguration;
017import org.apache.archiva.configuration.RepositoryCheckPath;
018import org.apache.archiva.configuration.AbstractRepositoryConnectorConfiguration;
019import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration;
020import org.apache.archiva.configuration.ProxyConnectorConfiguration;
021import org.apache.archiva.configuration.SyncConnectorConfiguration;
022import org.apache.archiva.configuration.NetworkProxyConfiguration;
023import org.apache.archiva.configuration.RepositoryScanningConfiguration;
024import org.apache.archiva.configuration.FileType;
025import org.apache.archiva.configuration.OrganisationInformation;
026import org.apache.archiva.configuration.WebappConfiguration;
027import org.apache.archiva.configuration.UserInterfaceOptions;
028import org.apache.archiva.configuration.NetworkConfiguration;
029import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
030import org.apache.archiva.configuration.RedbackRuntimeConfiguration;
031import org.apache.archiva.configuration.ArchivaDefaultConfiguration;
032import org.apache.archiva.configuration.LdapConfiguration;
033import org.apache.archiva.configuration.FileLockConfiguration;
034import org.apache.archiva.configuration.CacheConfiguration;
035import org.apache.archiva.configuration.LdapGroupMapping;
036
037
038
039
040/**
041 * Generate Redback Registry input mechanism for model 'Configuration'.
042 */
043public class ConfigurationRegistryReader
044{
045    public Configuration read( Registry registry )
046    {
047        return readConfiguration( "", registry );
048    }
049
050    private Configuration readConfiguration( String prefix, Registry registry )
051    {
052        Configuration value = new Configuration();
053
054    //String version = registry.getString( prefix + "version", value.getVersion() );
055
056    List<String> versionList = registry.getList( prefix + "version" );
057    String version = value.getVersion();
058    if (versionList != null && !versionList.isEmpty() )
059    {
060        StringBuilder sb = new StringBuilder(  );
061        for (int i = 0,size = versionList.size();i<size;i++)
062        {
063            sb.append( versionList.get( i ) );
064            if (i<size - 1)
065            {
066                sb.append( ',' );
067            }
068        }
069        version = sb.toString();
070    }
071
072        value.setVersion( version );
073        java.util.List repositories = new java.util.ArrayList/*<V1RepositoryConfiguration>*/();
074        List repositoriesSubsets = registry.getSubsetList( prefix + "repositories.repository" );
075        for ( Iterator i = repositoriesSubsets.iterator(); i.hasNext(); )
076        {
077            V1RepositoryConfiguration v = readV1RepositoryConfiguration( "", (Registry) i.next() );
078            repositories.add( v );
079        }
080        value.setRepositories( repositories );
081        java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
082        List repositoryGroupsSubsets = registry.getSubsetList( prefix + "repositoryGroups.repositoryGroup" );
083        for ( Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); )
084        {
085            RepositoryGroupConfiguration v = readRepositoryGroupConfiguration( "", (Registry) i.next() );
086            repositoryGroups.add( v );
087        }
088        value.setRepositoryGroups( repositoryGroups );
089        java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
090        List managedRepositoriesSubsets = registry.getSubsetList( prefix + "managedRepositories.managedRepository" );
091        for ( Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); )
092        {
093            ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration( "", (Registry) i.next() );
094            managedRepositories.add( v );
095        }
096        value.setManagedRepositories( managedRepositories );
097        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
098        List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" );
099        for ( Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); )
100        {
101            RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration( "", (Registry) i.next() );
102            remoteRepositories.add( v );
103        }
104        value.setRemoteRepositories( remoteRepositories );
105        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
106        List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
107        for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
108        {
109            ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
110            proxyConnectors.add( v );
111        }
112        value.setProxyConnectors( proxyConnectors );
113        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
114        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
115        for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
116        {
117            NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
118            networkProxies.add( v );
119        }
120        value.setNetworkProxies( networkProxies );
121        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
122        List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
123        for ( Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); )
124        {
125            LegacyArtifactPath v = readLegacyArtifactPath( "", (Registry) i.next() );
126            legacyArtifactPaths.add( v );
127        }
128        value.setLegacyArtifactPaths( legacyArtifactPaths );
129        RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration( prefix + "repositoryScanning.", registry );
130        value.setRepositoryScanning( repositoryScanning );
131        WebappConfiguration webapp = readWebappConfiguration( prefix + "webapp.", registry );
132        value.setWebapp( webapp );
133        OrganisationInformation organisationInfo = readOrganisationInformation( prefix + "organisationInfo.", registry );
134        value.setOrganisationInfo( organisationInfo );
135        NetworkConfiguration networkConfiguration = readNetworkConfiguration( prefix + "networkConfiguration.", registry );
136        value.setNetworkConfiguration( networkConfiguration );
137        RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration( prefix + "redbackRuntimeConfiguration.", registry );
138        value.setRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
139        ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration( prefix + "archivaRuntimeConfiguration.", registry );
140        value.setArchivaRuntimeConfiguration( archivaRuntimeConfiguration );
141        java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
142        List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList( prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration" );
143        for ( Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); )
144        {
145            ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration( "", (Registry) i.next() );
146            proxyConnectorRuleConfigurations.add( v );
147        }
148        value.setProxyConnectorRuleConfigurations( proxyConnectorRuleConfigurations );
149        ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration( prefix + "archivaDefaultConfiguration.", registry );
150        value.setArchivaDefaultConfiguration( archivaDefaultConfiguration );
151
152        return value;
153    }
154    
155    private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration( String prefix, Registry registry )
156    {
157        AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
158
159    //String id = registry.getString( prefix + "id", value.getId() );
160
161    List<String> idList = registry.getList( prefix + "id" );
162    String id = value.getId();
163    if (idList != null && !idList.isEmpty() )
164    {
165        StringBuilder sb = new StringBuilder(  );
166        for (int i = 0,size = idList.size();i<size;i++)
167        {
168            sb.append( idList.get( i ) );
169            if (i<size - 1)
170            {
171                sb.append( ',' );
172            }
173        }
174        id = sb.toString();
175    }
176
177        value.setId( id );
178    //String name = registry.getString( prefix + "name", value.getName() );
179
180    List<String> nameList = registry.getList( prefix + "name" );
181    String name = value.getName();
182    if (nameList != null && !nameList.isEmpty() )
183    {
184        StringBuilder sb = new StringBuilder(  );
185        for (int i = 0,size = nameList.size();i<size;i++)
186        {
187            sb.append( nameList.get( i ) );
188            if (i<size - 1)
189            {
190                sb.append( ',' );
191            }
192        }
193        name = sb.toString();
194    }
195
196        value.setName( name );
197    //String layout = registry.getString( prefix + "layout", value.getLayout() );
198
199    List<String> layoutList = registry.getList( prefix + "layout" );
200    String layout = value.getLayout();
201    if (layoutList != null && !layoutList.isEmpty() )
202    {
203        StringBuilder sb = new StringBuilder(  );
204        for (int i = 0,size = layoutList.size();i<size;i++)
205        {
206            sb.append( layoutList.get( i ) );
207            if (i<size - 1)
208            {
209                sb.append( ',' );
210            }
211        }
212        layout = sb.toString();
213    }
214
215        value.setLayout( layout );
216    //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
217
218    List<String> indexDirList = registry.getList( prefix + "indexDir" );
219    String indexDir = value.getIndexDir();
220    if (indexDirList != null && !indexDirList.isEmpty() )
221    {
222        StringBuilder sb = new StringBuilder(  );
223        for (int i = 0,size = indexDirList.size();i<size;i++)
224        {
225            sb.append( indexDirList.get( i ) );
226            if (i<size - 1)
227            {
228                sb.append( ',' );
229            }
230        }
231        indexDir = sb.toString();
232    }
233
234        value.setIndexDir( indexDir );
235    //String description = registry.getString( prefix + "description", value.getDescription() );
236
237    List<String> descriptionList = registry.getList( prefix + "description" );
238    String description = value.getDescription();
239    if (descriptionList != null && !descriptionList.isEmpty() )
240    {
241        StringBuilder sb = new StringBuilder(  );
242        for (int i = 0,size = descriptionList.size();i<size;i++)
243        {
244            sb.append( descriptionList.get( i ) );
245            if (i<size - 1)
246            {
247                sb.append( ',' );
248            }
249        }
250        description = sb.toString();
251    }
252
253        value.setDescription( description );
254
255        return value;
256    }
257    
258    private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration( String prefix, Registry registry )
259    {
260        RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
261
262    //String url = registry.getString( prefix + "url", value.getUrl() );
263
264    List<String> urlList = registry.getList( prefix + "url" );
265    String url = value.getUrl();
266    if (urlList != null && !urlList.isEmpty() )
267    {
268        StringBuilder sb = new StringBuilder(  );
269        for (int i = 0,size = urlList.size();i<size;i++)
270        {
271            sb.append( urlList.get( i ) );
272            if (i<size - 1)
273            {
274                sb.append( ',' );
275            }
276        }
277        url = sb.toString();
278    }
279
280        value.setUrl( url );
281    //String username = registry.getString( prefix + "username", value.getUsername() );
282
283    List<String> usernameList = registry.getList( prefix + "username" );
284    String username = value.getUsername();
285    if (usernameList != null && !usernameList.isEmpty() )
286    {
287        StringBuilder sb = new StringBuilder(  );
288        for (int i = 0,size = usernameList.size();i<size;i++)
289        {
290            sb.append( usernameList.get( i ) );
291            if (i<size - 1)
292            {
293                sb.append( ',' );
294            }
295        }
296        username = sb.toString();
297    }
298
299        value.setUsername( username );
300    //String password = registry.getString( prefix + "password", value.getPassword() );
301
302    List<String> passwordList = registry.getList( prefix + "password" );
303    String password = value.getPassword();
304    if (passwordList != null && !passwordList.isEmpty() )
305    {
306        StringBuilder sb = new StringBuilder(  );
307        for (int i = 0,size = passwordList.size();i<size;i++)
308        {
309            sb.append( passwordList.get( i ) );
310            if (i<size - 1)
311            {
312                sb.append( ',' );
313            }
314        }
315        password = sb.toString();
316    }
317
318        value.setPassword( password );
319    int timeout = registry.getInt( prefix + "timeout", value.getTimeout() );
320        value.setTimeout( timeout );
321    //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
322
323    List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
324    String refreshCronExpression = value.getRefreshCronExpression();
325    if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
326    {
327        StringBuilder sb = new StringBuilder(  );
328        for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
329        {
330            sb.append( refreshCronExpressionList.get( i ) );
331            if (i<size - 1)
332            {
333                sb.append( ',' );
334            }
335        }
336        refreshCronExpression = sb.toString();
337    }
338
339        value.setRefreshCronExpression( refreshCronExpression );
340        boolean downloadRemoteIndex = registry.getBoolean( prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex() );
341        value.setDownloadRemoteIndex( downloadRemoteIndex );
342    //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
343
344    List<String> remoteIndexUrlList = registry.getList( prefix + "remoteIndexUrl" );
345    String remoteIndexUrl = value.getRemoteIndexUrl();
346    if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty() )
347    {
348        StringBuilder sb = new StringBuilder(  );
349        for (int i = 0,size = remoteIndexUrlList.size();i<size;i++)
350        {
351            sb.append( remoteIndexUrlList.get( i ) );
352            if (i<size - 1)
353            {
354                sb.append( ',' );
355            }
356        }
357        remoteIndexUrl = sb.toString();
358    }
359
360        value.setRemoteIndexUrl( remoteIndexUrl );
361    //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
362
363    List<String> remoteDownloadNetworkProxyIdList = registry.getList( prefix + "remoteDownloadNetworkProxyId" );
364    String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
365    if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty() )
366    {
367        StringBuilder sb = new StringBuilder(  );
368        for (int i = 0,size = remoteDownloadNetworkProxyIdList.size();i<size;i++)
369        {
370            sb.append( remoteDownloadNetworkProxyIdList.get( i ) );
371            if (i<size - 1)
372            {
373                sb.append( ',' );
374            }
375        }
376        remoteDownloadNetworkProxyId = sb.toString();
377    }
378
379        value.setRemoteDownloadNetworkProxyId( remoteDownloadNetworkProxyId );
380    int remoteDownloadTimeout = registry.getInt( prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout() );
381        value.setRemoteDownloadTimeout( remoteDownloadTimeout );
382        boolean downloadRemoteIndexOnStartup = registry.getBoolean( prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup() );
383        value.setDownloadRemoteIndexOnStartup( downloadRemoteIndexOnStartup );
384        java.util.Map extraParameters = registry.getProperties( prefix + "extraParameters" );
385        value.setExtraParameters( extraParameters );
386        java.util.Map extraHeaders = registry.getProperties( prefix + "extraHeaders" );
387        value.setExtraHeaders( extraHeaders );
388    //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
389
390    List<String> checkPathList = registry.getList( prefix + "checkPath" );
391    String checkPath = value.getCheckPath();
392    if (checkPathList != null && !checkPathList.isEmpty() )
393    {
394        StringBuilder sb = new StringBuilder(  );
395        for (int i = 0,size = checkPathList.size();i<size;i++)
396        {
397            sb.append( checkPathList.get( i ) );
398            if (i<size - 1)
399            {
400                sb.append( ',' );
401            }
402        }
403        checkPath = sb.toString();
404    }
405
406        value.setCheckPath( checkPath );
407    //String id = registry.getString( prefix + "id", value.getId() );
408
409    List<String> idList = registry.getList( prefix + "id" );
410    String id = value.getId();
411    if (idList != null && !idList.isEmpty() )
412    {
413        StringBuilder sb = new StringBuilder(  );
414        for (int i = 0,size = idList.size();i<size;i++)
415        {
416            sb.append( idList.get( i ) );
417            if (i<size - 1)
418            {
419                sb.append( ',' );
420            }
421        }
422        id = sb.toString();
423    }
424
425        value.setId( id );
426    //String name = registry.getString( prefix + "name", value.getName() );
427
428    List<String> nameList = registry.getList( prefix + "name" );
429    String name = value.getName();
430    if (nameList != null && !nameList.isEmpty() )
431    {
432        StringBuilder sb = new StringBuilder(  );
433        for (int i = 0,size = nameList.size();i<size;i++)
434        {
435            sb.append( nameList.get( i ) );
436            if (i<size - 1)
437            {
438                sb.append( ',' );
439            }
440        }
441        name = sb.toString();
442    }
443
444        value.setName( name );
445    //String layout = registry.getString( prefix + "layout", value.getLayout() );
446
447    List<String> layoutList = registry.getList( prefix + "layout" );
448    String layout = value.getLayout();
449    if (layoutList != null && !layoutList.isEmpty() )
450    {
451        StringBuilder sb = new StringBuilder(  );
452        for (int i = 0,size = layoutList.size();i<size;i++)
453        {
454            sb.append( layoutList.get( i ) );
455            if (i<size - 1)
456            {
457                sb.append( ',' );
458            }
459        }
460        layout = sb.toString();
461    }
462
463        value.setLayout( layout );
464    //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
465
466    List<String> indexDirList = registry.getList( prefix + "indexDir" );
467    String indexDir = value.getIndexDir();
468    if (indexDirList != null && !indexDirList.isEmpty() )
469    {
470        StringBuilder sb = new StringBuilder(  );
471        for (int i = 0,size = indexDirList.size();i<size;i++)
472        {
473            sb.append( indexDirList.get( i ) );
474            if (i<size - 1)
475            {
476                sb.append( ',' );
477            }
478        }
479        indexDir = sb.toString();
480    }
481
482        value.setIndexDir( indexDir );
483    //String description = registry.getString( prefix + "description", value.getDescription() );
484
485    List<String> descriptionList = registry.getList( prefix + "description" );
486    String description = value.getDescription();
487    if (descriptionList != null && !descriptionList.isEmpty() )
488    {
489        StringBuilder sb = new StringBuilder(  );
490        for (int i = 0,size = descriptionList.size();i<size;i++)
491        {
492            sb.append( descriptionList.get( i ) );
493            if (i<size - 1)
494            {
495                sb.append( ',' );
496            }
497        }
498        description = sb.toString();
499    }
500
501        value.setDescription( description );
502
503        return value;
504    }
505    
506    private ManagedRepositoryConfiguration readManagedRepositoryConfiguration( String prefix, Registry registry )
507    {
508        ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
509
510    //String location = registry.getString( prefix + "location", value.getLocation() );
511
512    List<String> locationList = registry.getList( prefix + "location" );
513    String location = value.getLocation();
514    if (locationList != null && !locationList.isEmpty() )
515    {
516        StringBuilder sb = new StringBuilder(  );
517        for (int i = 0,size = locationList.size();i<size;i++)
518        {
519            sb.append( locationList.get( i ) );
520            if (i<size - 1)
521            {
522                sb.append( ',' );
523            }
524        }
525        location = sb.toString();
526    }
527
528        value.setLocation( location );
529        boolean releases = registry.getBoolean( prefix + "releases", value.isReleases() );
530        value.setReleases( releases );
531        boolean blockRedeployments = registry.getBoolean( prefix + "blockRedeployments", value.isBlockRedeployments() );
532        value.setBlockRedeployments( blockRedeployments );
533        boolean snapshots = registry.getBoolean( prefix + "snapshots", value.isSnapshots() );
534        value.setSnapshots( snapshots );
535        boolean scanned = registry.getBoolean( prefix + "scanned", value.isScanned() );
536        value.setScanned( scanned );
537    //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
538
539    List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
540    String refreshCronExpression = value.getRefreshCronExpression();
541    if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
542    {
543        StringBuilder sb = new StringBuilder(  );
544        for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
545        {
546            sb.append( refreshCronExpressionList.get( i ) );
547            if (i<size - 1)
548            {
549                sb.append( ',' );
550            }
551        }
552        refreshCronExpression = sb.toString();
553    }
554
555        value.setRefreshCronExpression( refreshCronExpression );
556    int retentionCount = registry.getInt( prefix + "retentionCount", value.getRetentionCount() );
557        value.setRetentionCount( retentionCount );
558    int daysOlder = registry.getInt( prefix + "daysOlder", value.getDaysOlder() );
559        value.setDaysOlder( daysOlder );
560        boolean deleteReleasedSnapshots = registry.getBoolean( prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots() );
561        value.setDeleteReleasedSnapshots( deleteReleasedSnapshots );
562        boolean skipPackedIndexCreation = registry.getBoolean( prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation() );
563        value.setSkipPackedIndexCreation( skipPackedIndexCreation );
564        boolean stageRepoNeeded = registry.getBoolean( prefix + "stageRepoNeeded", value.isStageRepoNeeded() );
565        value.setStageRepoNeeded( stageRepoNeeded );
566    //String id = registry.getString( prefix + "id", value.getId() );
567
568    List<String> idList = registry.getList( prefix + "id" );
569    String id = value.getId();
570    if (idList != null && !idList.isEmpty() )
571    {
572        StringBuilder sb = new StringBuilder(  );
573        for (int i = 0,size = idList.size();i<size;i++)
574        {
575            sb.append( idList.get( i ) );
576            if (i<size - 1)
577            {
578                sb.append( ',' );
579            }
580        }
581        id = sb.toString();
582    }
583
584        value.setId( id );
585    //String name = registry.getString( prefix + "name", value.getName() );
586
587    List<String> nameList = registry.getList( prefix + "name" );
588    String name = value.getName();
589    if (nameList != null && !nameList.isEmpty() )
590    {
591        StringBuilder sb = new StringBuilder(  );
592        for (int i = 0,size = nameList.size();i<size;i++)
593        {
594            sb.append( nameList.get( i ) );
595            if (i<size - 1)
596            {
597                sb.append( ',' );
598            }
599        }
600        name = sb.toString();
601    }
602
603        value.setName( name );
604    //String layout = registry.getString( prefix + "layout", value.getLayout() );
605
606    List<String> layoutList = registry.getList( prefix + "layout" );
607    String layout = value.getLayout();
608    if (layoutList != null && !layoutList.isEmpty() )
609    {
610        StringBuilder sb = new StringBuilder(  );
611        for (int i = 0,size = layoutList.size();i<size;i++)
612        {
613            sb.append( layoutList.get( i ) );
614            if (i<size - 1)
615            {
616                sb.append( ',' );
617            }
618        }
619        layout = sb.toString();
620    }
621
622        value.setLayout( layout );
623    //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
624
625    List<String> indexDirList = registry.getList( prefix + "indexDir" );
626    String indexDir = value.getIndexDir();
627    if (indexDirList != null && !indexDirList.isEmpty() )
628    {
629        StringBuilder sb = new StringBuilder(  );
630        for (int i = 0,size = indexDirList.size();i<size;i++)
631        {
632            sb.append( indexDirList.get( i ) );
633            if (i<size - 1)
634            {
635                sb.append( ',' );
636            }
637        }
638        indexDir = sb.toString();
639    }
640
641        value.setIndexDir( indexDir );
642    //String description = registry.getString( prefix + "description", value.getDescription() );
643
644    List<String> descriptionList = registry.getList( prefix + "description" );
645    String description = value.getDescription();
646    if (descriptionList != null && !descriptionList.isEmpty() )
647    {
648        StringBuilder sb = new StringBuilder(  );
649        for (int i = 0,size = descriptionList.size();i<size;i++)
650        {
651            sb.append( descriptionList.get( i ) );
652            if (i<size - 1)
653            {
654                sb.append( ',' );
655            }
656        }
657        description = sb.toString();
658    }
659
660        value.setDescription( description );
661
662        return value;
663    }
664    
665    private V1RepositoryConfiguration readV1RepositoryConfiguration( String prefix, Registry registry )
666    {
667        V1RepositoryConfiguration value = new V1RepositoryConfiguration();
668
669    //String url = registry.getString( prefix + "url", value.getUrl() );
670
671    List<String> urlList = registry.getList( prefix + "url" );
672    String url = value.getUrl();
673    if (urlList != null && !urlList.isEmpty() )
674    {
675        StringBuilder sb = new StringBuilder(  );
676        for (int i = 0,size = urlList.size();i<size;i++)
677        {
678            sb.append( urlList.get( i ) );
679            if (i<size - 1)
680            {
681                sb.append( ',' );
682            }
683        }
684        url = sb.toString();
685    }
686
687        value.setUrl( url );
688        boolean indexed = registry.getBoolean( prefix + "indexed", value.isIndexed() );
689        value.setIndexed( indexed );
690    //String location = registry.getString( prefix + "location", value.getLocation() );
691
692    List<String> locationList = registry.getList( prefix + "location" );
693    String location = value.getLocation();
694    if (locationList != null && !locationList.isEmpty() )
695    {
696        StringBuilder sb = new StringBuilder(  );
697        for (int i = 0,size = locationList.size();i<size;i++)
698        {
699            sb.append( locationList.get( i ) );
700            if (i<size - 1)
701            {
702                sb.append( ',' );
703            }
704        }
705        location = sb.toString();
706    }
707
708        value.setLocation( location );
709        boolean releases = registry.getBoolean( prefix + "releases", value.isReleases() );
710        value.setReleases( releases );
711        boolean blockRedeployments = registry.getBoolean( prefix + "blockRedeployments", value.isBlockRedeployments() );
712        value.setBlockRedeployments( blockRedeployments );
713        boolean snapshots = registry.getBoolean( prefix + "snapshots", value.isSnapshots() );
714        value.setSnapshots( snapshots );
715        boolean scanned = registry.getBoolean( prefix + "scanned", value.isScanned() );
716        value.setScanned( scanned );
717    //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
718
719    List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
720    String refreshCronExpression = value.getRefreshCronExpression();
721    if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
722    {
723        StringBuilder sb = new StringBuilder(  );
724        for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
725        {
726            sb.append( refreshCronExpressionList.get( i ) );
727            if (i<size - 1)
728            {
729                sb.append( ',' );
730            }
731        }
732        refreshCronExpression = sb.toString();
733    }
734
735        value.setRefreshCronExpression( refreshCronExpression );
736    int retentionCount = registry.getInt( prefix + "retentionCount", value.getRetentionCount() );
737        value.setRetentionCount( retentionCount );
738    int daysOlder = registry.getInt( prefix + "daysOlder", value.getDaysOlder() );
739        value.setDaysOlder( daysOlder );
740        boolean deleteReleasedSnapshots = registry.getBoolean( prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots() );
741        value.setDeleteReleasedSnapshots( deleteReleasedSnapshots );
742        boolean skipPackedIndexCreation = registry.getBoolean( prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation() );
743        value.setSkipPackedIndexCreation( skipPackedIndexCreation );
744        boolean stageRepoNeeded = registry.getBoolean( prefix + "stageRepoNeeded", value.isStageRepoNeeded() );
745        value.setStageRepoNeeded( stageRepoNeeded );
746    //String id = registry.getString( prefix + "id", value.getId() );
747
748    List<String> idList = registry.getList( prefix + "id" );
749    String id = value.getId();
750    if (idList != null && !idList.isEmpty() )
751    {
752        StringBuilder sb = new StringBuilder(  );
753        for (int i = 0,size = idList.size();i<size;i++)
754        {
755            sb.append( idList.get( i ) );
756            if (i<size - 1)
757            {
758                sb.append( ',' );
759            }
760        }
761        id = sb.toString();
762    }
763
764        value.setId( id );
765    //String name = registry.getString( prefix + "name", value.getName() );
766
767    List<String> nameList = registry.getList( prefix + "name" );
768    String name = value.getName();
769    if (nameList != null && !nameList.isEmpty() )
770    {
771        StringBuilder sb = new StringBuilder(  );
772        for (int i = 0,size = nameList.size();i<size;i++)
773        {
774            sb.append( nameList.get( i ) );
775            if (i<size - 1)
776            {
777                sb.append( ',' );
778            }
779        }
780        name = sb.toString();
781    }
782
783        value.setName( name );
784    //String layout = registry.getString( prefix + "layout", value.getLayout() );
785
786    List<String> layoutList = registry.getList( prefix + "layout" );
787    String layout = value.getLayout();
788    if (layoutList != null && !layoutList.isEmpty() )
789    {
790        StringBuilder sb = new StringBuilder(  );
791        for (int i = 0,size = layoutList.size();i<size;i++)
792        {
793            sb.append( layoutList.get( i ) );
794            if (i<size - 1)
795            {
796                sb.append( ',' );
797            }
798        }
799        layout = sb.toString();
800    }
801
802        value.setLayout( layout );
803    //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
804
805    List<String> indexDirList = registry.getList( prefix + "indexDir" );
806    String indexDir = value.getIndexDir();
807    if (indexDirList != null && !indexDirList.isEmpty() )
808    {
809        StringBuilder sb = new StringBuilder(  );
810        for (int i = 0,size = indexDirList.size();i<size;i++)
811        {
812            sb.append( indexDirList.get( i ) );
813            if (i<size - 1)
814            {
815                sb.append( ',' );
816            }
817        }
818        indexDir = sb.toString();
819    }
820
821        value.setIndexDir( indexDir );
822    //String description = registry.getString( prefix + "description", value.getDescription() );
823
824    List<String> descriptionList = registry.getList( prefix + "description" );
825    String description = value.getDescription();
826    if (descriptionList != null && !descriptionList.isEmpty() )
827    {
828        StringBuilder sb = new StringBuilder(  );
829        for (int i = 0,size = descriptionList.size();i<size;i++)
830        {
831            sb.append( descriptionList.get( i ) );
832            if (i<size - 1)
833            {
834                sb.append( ',' );
835            }
836        }
837        description = sb.toString();
838    }
839
840        value.setDescription( description );
841
842        return value;
843    }
844    
845    private LegacyArtifactPath readLegacyArtifactPath( String prefix, Registry registry )
846    {
847        LegacyArtifactPath value = new LegacyArtifactPath();
848
849    //String path = registry.getString( prefix + "path", value.getPath() );
850
851    List<String> pathList = registry.getList( prefix + "path" );
852    String path = value.getPath();
853    if (pathList != null && !pathList.isEmpty() )
854    {
855        StringBuilder sb = new StringBuilder(  );
856        for (int i = 0,size = pathList.size();i<size;i++)
857        {
858            sb.append( pathList.get( i ) );
859            if (i<size - 1)
860            {
861                sb.append( ',' );
862            }
863        }
864        path = sb.toString();
865    }
866
867        value.setPath( path );
868    //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
869
870    List<String> artifactList = registry.getList( prefix + "artifact" );
871    String artifact = value.getArtifact();
872    if (artifactList != null && !artifactList.isEmpty() )
873    {
874        StringBuilder sb = new StringBuilder(  );
875        for (int i = 0,size = artifactList.size();i<size;i++)
876        {
877            sb.append( artifactList.get( i ) );
878            if (i<size - 1)
879            {
880                sb.append( ',' );
881            }
882        }
883        artifact = sb.toString();
884    }
885
886        value.setArtifact( artifact );
887
888        return value;
889    }
890    
891    private RepositoryGroupConfiguration readRepositoryGroupConfiguration( String prefix, Registry registry )
892    {
893        RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
894
895    //String id = registry.getString( prefix + "id", value.getId() );
896
897    List<String> idList = registry.getList( prefix + "id" );
898    String id = value.getId();
899    if (idList != null && !idList.isEmpty() )
900    {
901        StringBuilder sb = new StringBuilder(  );
902        for (int i = 0,size = idList.size();i<size;i++)
903        {
904            sb.append( idList.get( i ) );
905            if (i<size - 1)
906            {
907                sb.append( ',' );
908            }
909        }
910        id = sb.toString();
911    }
912
913        value.setId( id );
914    //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
915
916    List<String> mergedIndexPathList = registry.getList( prefix + "mergedIndexPath" );
917    String mergedIndexPath = value.getMergedIndexPath();
918    if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty() )
919    {
920        StringBuilder sb = new StringBuilder(  );
921        for (int i = 0,size = mergedIndexPathList.size();i<size;i++)
922        {
923            sb.append( mergedIndexPathList.get( i ) );
924            if (i<size - 1)
925            {
926                sb.append( ',' );
927            }
928        }
929        mergedIndexPath = sb.toString();
930    }
931
932        value.setMergedIndexPath( mergedIndexPath );
933    int mergedIndexTtl = registry.getInt( prefix + "mergedIndexTtl", value.getMergedIndexTtl() );
934        value.setMergedIndexTtl( mergedIndexTtl );
935    //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
936
937    List<String> cronExpressionList = registry.getList( prefix + "cronExpression" );
938    String cronExpression = value.getCronExpression();
939    if (cronExpressionList != null && !cronExpressionList.isEmpty() )
940    {
941        StringBuilder sb = new StringBuilder(  );
942        for (int i = 0,size = cronExpressionList.size();i<size;i++)
943        {
944            sb.append( cronExpressionList.get( i ) );
945            if (i<size - 1)
946            {
947                sb.append( ',' );
948            }
949        }
950        cronExpression = sb.toString();
951    }
952
953        value.setCronExpression( cronExpression );
954        java.util.List repositories = new java.util.ArrayList/*<String>*/();
955        repositories.addAll( registry.getList( prefix + "repositories.repository" ) );
956        value.setRepositories( repositories );
957
958        return value;
959    }
960    
961    private RepositoryCheckPath readRepositoryCheckPath( String prefix, Registry registry )
962    {
963        RepositoryCheckPath value = new RepositoryCheckPath();
964
965    //String url = registry.getString( prefix + "url", value.getUrl() );
966
967    List<String> urlList = registry.getList( prefix + "url" );
968    String url = value.getUrl();
969    if (urlList != null && !urlList.isEmpty() )
970    {
971        StringBuilder sb = new StringBuilder(  );
972        for (int i = 0,size = urlList.size();i<size;i++)
973        {
974            sb.append( urlList.get( i ) );
975            if (i<size - 1)
976            {
977                sb.append( ',' );
978            }
979        }
980        url = sb.toString();
981    }
982
983        value.setUrl( url );
984    //String path = registry.getString( prefix + "path", value.getPath() );
985
986    List<String> pathList = registry.getList( prefix + "path" );
987    String path = value.getPath();
988    if (pathList != null && !pathList.isEmpty() )
989    {
990        StringBuilder sb = new StringBuilder(  );
991        for (int i = 0,size = pathList.size();i<size;i++)
992        {
993            sb.append( pathList.get( i ) );
994            if (i<size - 1)
995            {
996                sb.append( ',' );
997            }
998        }
999        path = sb.toString();
1000    }
1001
1002        value.setPath( path );
1003
1004        return value;
1005    }
1006    
1007    private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration( String prefix, Registry registry )
1008    {
1009        AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
1010
1011    //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1012
1013    List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
1014    String sourceRepoId = value.getSourceRepoId();
1015    if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
1016    {
1017        StringBuilder sb = new StringBuilder(  );
1018        for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
1019        {
1020            sb.append( sourceRepoIdList.get( i ) );
1021            if (i<size - 1)
1022            {
1023                sb.append( ',' );
1024            }
1025        }
1026        sourceRepoId = sb.toString();
1027    }
1028
1029        value.setSourceRepoId( sourceRepoId );
1030    //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1031
1032    List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
1033    String targetRepoId = value.getTargetRepoId();
1034    if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
1035    {
1036        StringBuilder sb = new StringBuilder(  );
1037        for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1038        {
1039            sb.append( targetRepoIdList.get( i ) );
1040            if (i<size - 1)
1041            {
1042                sb.append( ',' );
1043            }
1044        }
1045        targetRepoId = sb.toString();
1046    }
1047
1048        value.setTargetRepoId( targetRepoId );
1049    //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1050
1051    List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1052    String proxyId = value.getProxyId();
1053    if (proxyIdList != null && !proxyIdList.isEmpty() )
1054    {
1055        StringBuilder sb = new StringBuilder(  );
1056        for (int i = 0,size = proxyIdList.size();i<size;i++)
1057        {
1058            sb.append( proxyIdList.get( i ) );
1059            if (i<size - 1)
1060            {
1061                sb.append( ',' );
1062            }
1063        }
1064        proxyId = sb.toString();
1065    }
1066
1067        value.setProxyId( proxyId );
1068        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1069        blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1070        value.setBlackListPatterns( blackListPatterns );
1071        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1072        whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1073        value.setWhiteListPatterns( whiteListPatterns );
1074        java.util.Map policies = registry.getProperties( prefix + "policies" );
1075        value.setPolicies( policies );
1076        java.util.Map properties = registry.getProperties( prefix + "properties" );
1077        value.setProperties( properties );
1078        boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1079        value.setDisabled( disabled );
1080
1081        return value;
1082    }
1083    
1084    private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration( String prefix, Registry registry )
1085    {
1086        ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
1087
1088    //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
1089
1090    List<String> ruleTypeList = registry.getList( prefix + "ruleType" );
1091    String ruleType = value.getRuleType();
1092    if (ruleTypeList != null && !ruleTypeList.isEmpty() )
1093    {
1094        StringBuilder sb = new StringBuilder(  );
1095        for (int i = 0,size = ruleTypeList.size();i<size;i++)
1096        {
1097            sb.append( ruleTypeList.get( i ) );
1098            if (i<size - 1)
1099            {
1100                sb.append( ',' );
1101            }
1102        }
1103        ruleType = sb.toString();
1104    }
1105
1106        value.setRuleType( ruleType );
1107    //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
1108
1109    List<String> patternList = registry.getList( prefix + "pattern" );
1110    String pattern = value.getPattern();
1111    if (patternList != null && !patternList.isEmpty() )
1112    {
1113        StringBuilder sb = new StringBuilder(  );
1114        for (int i = 0,size = patternList.size();i<size;i++)
1115        {
1116            sb.append( patternList.get( i ) );
1117            if (i<size - 1)
1118            {
1119                sb.append( ',' );
1120            }
1121        }
1122        pattern = sb.toString();
1123    }
1124
1125        value.setPattern( pattern );
1126        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
1127        List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
1128        for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
1129        {
1130            ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
1131            proxyConnectors.add( v );
1132        }
1133        value.setProxyConnectors( proxyConnectors );
1134
1135        return value;
1136    }
1137    
1138    private ProxyConnectorConfiguration readProxyConnectorConfiguration( String prefix, Registry registry )
1139    {
1140        ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
1141
1142    int order = registry.getInt( prefix + "order", value.getOrder() );
1143        value.setOrder( order );
1144    //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1145
1146    List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
1147    String sourceRepoId = value.getSourceRepoId();
1148    if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
1149    {
1150        StringBuilder sb = new StringBuilder(  );
1151        for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
1152        {
1153            sb.append( sourceRepoIdList.get( i ) );
1154            if (i<size - 1)
1155            {
1156                sb.append( ',' );
1157            }
1158        }
1159        sourceRepoId = sb.toString();
1160    }
1161
1162        value.setSourceRepoId( sourceRepoId );
1163    //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1164
1165    List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
1166    String targetRepoId = value.getTargetRepoId();
1167    if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
1168    {
1169        StringBuilder sb = new StringBuilder(  );
1170        for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1171        {
1172            sb.append( targetRepoIdList.get( i ) );
1173            if (i<size - 1)
1174            {
1175                sb.append( ',' );
1176            }
1177        }
1178        targetRepoId = sb.toString();
1179    }
1180
1181        value.setTargetRepoId( targetRepoId );
1182    //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1183
1184    List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1185    String proxyId = value.getProxyId();
1186    if (proxyIdList != null && !proxyIdList.isEmpty() )
1187    {
1188        StringBuilder sb = new StringBuilder(  );
1189        for (int i = 0,size = proxyIdList.size();i<size;i++)
1190        {
1191            sb.append( proxyIdList.get( i ) );
1192            if (i<size - 1)
1193            {
1194                sb.append( ',' );
1195            }
1196        }
1197        proxyId = sb.toString();
1198    }
1199
1200        value.setProxyId( proxyId );
1201        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1202        blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1203        value.setBlackListPatterns( blackListPatterns );
1204        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1205        whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1206        value.setWhiteListPatterns( whiteListPatterns );
1207        java.util.Map policies = registry.getProperties( prefix + "policies" );
1208        value.setPolicies( policies );
1209        java.util.Map properties = registry.getProperties( prefix + "properties" );
1210        value.setProperties( properties );
1211        boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1212        value.setDisabled( disabled );
1213
1214        return value;
1215    }
1216    
1217    private SyncConnectorConfiguration readSyncConnectorConfiguration( String prefix, Registry registry )
1218    {
1219        SyncConnectorConfiguration value = new SyncConnectorConfiguration();
1220
1221    //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
1222
1223    List<String> cronExpressionList = registry.getList( prefix + "cronExpression" );
1224    String cronExpression = value.getCronExpression();
1225    if (cronExpressionList != null && !cronExpressionList.isEmpty() )
1226    {
1227        StringBuilder sb = new StringBuilder(  );
1228        for (int i = 0,size = cronExpressionList.size();i<size;i++)
1229        {
1230            sb.append( cronExpressionList.get( i ) );
1231            if (i<size - 1)
1232            {
1233                sb.append( ',' );
1234            }
1235        }
1236        cronExpression = sb.toString();
1237    }
1238
1239        value.setCronExpression( cronExpression );
1240    //String method = registry.getString( prefix + "method", value.getMethod() );
1241
1242    List<String> methodList = registry.getList( prefix + "method" );
1243    String method = value.getMethod();
1244    if (methodList != null && !methodList.isEmpty() )
1245    {
1246        StringBuilder sb = new StringBuilder(  );
1247        for (int i = 0,size = methodList.size();i<size;i++)
1248        {
1249            sb.append( methodList.get( i ) );
1250            if (i<size - 1)
1251            {
1252                sb.append( ',' );
1253            }
1254        }
1255        method = sb.toString();
1256    }
1257
1258        value.setMethod( method );
1259    //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1260
1261    List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
1262    String sourceRepoId = value.getSourceRepoId();
1263    if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
1264    {
1265        StringBuilder sb = new StringBuilder(  );
1266        for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
1267        {
1268            sb.append( sourceRepoIdList.get( i ) );
1269            if (i<size - 1)
1270            {
1271                sb.append( ',' );
1272            }
1273        }
1274        sourceRepoId = sb.toString();
1275    }
1276
1277        value.setSourceRepoId( sourceRepoId );
1278    //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1279
1280    List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
1281    String targetRepoId = value.getTargetRepoId();
1282    if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
1283    {
1284        StringBuilder sb = new StringBuilder(  );
1285        for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1286        {
1287            sb.append( targetRepoIdList.get( i ) );
1288            if (i<size - 1)
1289            {
1290                sb.append( ',' );
1291            }
1292        }
1293        targetRepoId = sb.toString();
1294    }
1295
1296        value.setTargetRepoId( targetRepoId );
1297    //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1298
1299    List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1300    String proxyId = value.getProxyId();
1301    if (proxyIdList != null && !proxyIdList.isEmpty() )
1302    {
1303        StringBuilder sb = new StringBuilder(  );
1304        for (int i = 0,size = proxyIdList.size();i<size;i++)
1305        {
1306            sb.append( proxyIdList.get( i ) );
1307            if (i<size - 1)
1308            {
1309                sb.append( ',' );
1310            }
1311        }
1312        proxyId = sb.toString();
1313    }
1314
1315        value.setProxyId( proxyId );
1316        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1317        blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1318        value.setBlackListPatterns( blackListPatterns );
1319        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1320        whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1321        value.setWhiteListPatterns( whiteListPatterns );
1322        java.util.Map policies = registry.getProperties( prefix + "policies" );
1323        value.setPolicies( policies );
1324        java.util.Map properties = registry.getProperties( prefix + "properties" );
1325        value.setProperties( properties );
1326        boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1327        value.setDisabled( disabled );
1328
1329        return value;
1330    }
1331    
1332    private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
1333    {
1334        NetworkProxyConfiguration value = new NetworkProxyConfiguration();
1335
1336    //String id = registry.getString( prefix + "id", value.getId() );
1337
1338    List<String> idList = registry.getList( prefix + "id" );
1339    String id = value.getId();
1340    if (idList != null && !idList.isEmpty() )
1341    {
1342        StringBuilder sb = new StringBuilder(  );
1343        for (int i = 0,size = idList.size();i<size;i++)
1344        {
1345            sb.append( idList.get( i ) );
1346            if (i<size - 1)
1347            {
1348                sb.append( ',' );
1349            }
1350        }
1351        id = sb.toString();
1352    }
1353
1354        value.setId( id );
1355    //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
1356
1357    List<String> protocolList = registry.getList( prefix + "protocol" );
1358    String protocol = value.getProtocol();
1359    if (protocolList != null && !protocolList.isEmpty() )
1360    {
1361        StringBuilder sb = new StringBuilder(  );
1362        for (int i = 0,size = protocolList.size();i<size;i++)
1363        {
1364            sb.append( protocolList.get( i ) );
1365            if (i<size - 1)
1366            {
1367                sb.append( ',' );
1368            }
1369        }
1370        protocol = sb.toString();
1371    }
1372
1373        value.setProtocol( protocol );
1374    //String host = registry.getString( prefix + "host", value.getHost() );
1375
1376    List<String> hostList = registry.getList( prefix + "host" );
1377    String host = value.getHost();
1378    if (hostList != null && !hostList.isEmpty() )
1379    {
1380        StringBuilder sb = new StringBuilder(  );
1381        for (int i = 0,size = hostList.size();i<size;i++)
1382        {
1383            sb.append( hostList.get( i ) );
1384            if (i<size - 1)
1385            {
1386                sb.append( ',' );
1387            }
1388        }
1389        host = sb.toString();
1390    }
1391
1392        value.setHost( host );
1393    int port = registry.getInt( prefix + "port", value.getPort() );
1394        value.setPort( port );
1395    //String username = registry.getString( prefix + "username", value.getUsername() );
1396
1397    List<String> usernameList = registry.getList( prefix + "username" );
1398    String username = value.getUsername();
1399    if (usernameList != null && !usernameList.isEmpty() )
1400    {
1401        StringBuilder sb = new StringBuilder(  );
1402        for (int i = 0,size = usernameList.size();i<size;i++)
1403        {
1404            sb.append( usernameList.get( i ) );
1405            if (i<size - 1)
1406            {
1407                sb.append( ',' );
1408            }
1409        }
1410        username = sb.toString();
1411    }
1412
1413        value.setUsername( username );
1414    //String password = registry.getString( prefix + "password", value.getPassword() );
1415
1416    List<String> passwordList = registry.getList( prefix + "password" );
1417    String password = value.getPassword();
1418    if (passwordList != null && !passwordList.isEmpty() )
1419    {
1420        StringBuilder sb = new StringBuilder(  );
1421        for (int i = 0,size = passwordList.size();i<size;i++)
1422        {
1423            sb.append( passwordList.get( i ) );
1424            if (i<size - 1)
1425            {
1426                sb.append( ',' );
1427            }
1428        }
1429        password = sb.toString();
1430    }
1431
1432        value.setPassword( password );
1433        boolean useNtlm = registry.getBoolean( prefix + "useNtlm", value.isUseNtlm() );
1434        value.setUseNtlm( useNtlm );
1435
1436        return value;
1437    }
1438    
1439    private RepositoryScanningConfiguration readRepositoryScanningConfiguration( String prefix, Registry registry )
1440    {
1441        RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
1442
1443        java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
1444        List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" );
1445        for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); )
1446        {
1447            FileType v = readFileType( "", (Registry) i.next() );
1448            fileTypes.add( v );
1449        }
1450        value.setFileTypes( fileTypes );
1451        java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
1452        knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) );
1453        value.setKnownContentConsumers( knownContentConsumers );
1454        java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
1455        invalidContentConsumers.addAll( registry.getList( prefix + "invalidContentConsumers.invalidContentConsumer" ) );
1456        value.setInvalidContentConsumers( invalidContentConsumers );
1457
1458        return value;
1459    }
1460    
1461    private FileType readFileType( String prefix, Registry registry )
1462    {
1463        FileType value = new FileType();
1464
1465    //String id = registry.getString( prefix + "id", value.getId() );
1466
1467    List<String> idList = registry.getList( prefix + "id" );
1468    String id = value.getId();
1469    if (idList != null && !idList.isEmpty() )
1470    {
1471        StringBuilder sb = new StringBuilder(  );
1472        for (int i = 0,size = idList.size();i<size;i++)
1473        {
1474            sb.append( idList.get( i ) );
1475            if (i<size - 1)
1476            {
1477                sb.append( ',' );
1478            }
1479        }
1480        id = sb.toString();
1481    }
1482
1483        value.setId( id );
1484        java.util.List patterns = new java.util.ArrayList/*<String>*/();
1485        patterns.addAll( registry.getList( prefix + "patterns.pattern" ) );
1486        value.setPatterns( patterns );
1487
1488        return value;
1489    }
1490    
1491    private OrganisationInformation readOrganisationInformation( String prefix, Registry registry )
1492    {
1493        OrganisationInformation value = new OrganisationInformation();
1494
1495    //String name = registry.getString( prefix + "name", value.getName() );
1496
1497    List<String> nameList = registry.getList( prefix + "name" );
1498    String name = value.getName();
1499    if (nameList != null && !nameList.isEmpty() )
1500    {
1501        StringBuilder sb = new StringBuilder(  );
1502        for (int i = 0,size = nameList.size();i<size;i++)
1503        {
1504            sb.append( nameList.get( i ) );
1505            if (i<size - 1)
1506            {
1507                sb.append( ',' );
1508            }
1509        }
1510        name = sb.toString();
1511    }
1512
1513        value.setName( name );
1514    //String url = registry.getString( prefix + "url", value.getUrl() );
1515
1516    List<String> urlList = registry.getList( prefix + "url" );
1517    String url = value.getUrl();
1518    if (urlList != null && !urlList.isEmpty() )
1519    {
1520        StringBuilder sb = new StringBuilder(  );
1521        for (int i = 0,size = urlList.size();i<size;i++)
1522        {
1523            sb.append( urlList.get( i ) );
1524            if (i<size - 1)
1525            {
1526                sb.append( ',' );
1527            }
1528        }
1529        url = sb.toString();
1530    }
1531
1532        value.setUrl( url );
1533    //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
1534
1535    List<String> logoLocationList = registry.getList( prefix + "logoLocation" );
1536    String logoLocation = value.getLogoLocation();
1537    if (logoLocationList != null && !logoLocationList.isEmpty() )
1538    {
1539        StringBuilder sb = new StringBuilder(  );
1540        for (int i = 0,size = logoLocationList.size();i<size;i++)
1541        {
1542            sb.append( logoLocationList.get( i ) );
1543            if (i<size - 1)
1544            {
1545                sb.append( ',' );
1546            }
1547        }
1548        logoLocation = sb.toString();
1549    }
1550
1551        value.setLogoLocation( logoLocation );
1552
1553        return value;
1554    }
1555    
1556    private WebappConfiguration readWebappConfiguration( String prefix, Registry registry )
1557    {
1558        WebappConfiguration value = new WebappConfiguration();
1559
1560        UserInterfaceOptions ui = readUserInterfaceOptions( prefix + "ui.", registry );
1561        value.setUi( ui );
1562
1563        return value;
1564    }
1565    
1566    private UserInterfaceOptions readUserInterfaceOptions( String prefix, Registry registry )
1567    {
1568        UserInterfaceOptions value = new UserInterfaceOptions();
1569
1570        boolean showFindArtifacts = registry.getBoolean( prefix + "showFindArtifacts", value.isShowFindArtifacts() );
1571        value.setShowFindArtifacts( showFindArtifacts );
1572        boolean appletFindEnabled = registry.getBoolean( prefix + "appletFindEnabled", value.isAppletFindEnabled() );
1573        value.setAppletFindEnabled( appletFindEnabled );
1574        boolean disableEasterEggs = registry.getBoolean( prefix + "disableEasterEggs", value.isDisableEasterEggs() );
1575        value.setDisableEasterEggs( disableEasterEggs );
1576    //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
1577
1578    List<String> applicationUrlList = registry.getList( prefix + "applicationUrl" );
1579    String applicationUrl = value.getApplicationUrl();
1580    if (applicationUrlList != null && !applicationUrlList.isEmpty() )
1581    {
1582        StringBuilder sb = new StringBuilder(  );
1583        for (int i = 0,size = applicationUrlList.size();i<size;i++)
1584        {
1585            sb.append( applicationUrlList.get( i ) );
1586            if (i<size - 1)
1587            {
1588                sb.append( ',' );
1589            }
1590        }
1591        applicationUrl = sb.toString();
1592    }
1593
1594        value.setApplicationUrl( applicationUrl );
1595        boolean disableRegistration = registry.getBoolean( prefix + "disableRegistration", value.isDisableRegistration() );
1596        value.setDisableRegistration( disableRegistration );
1597
1598        return value;
1599    }
1600    
1601    private NetworkConfiguration readNetworkConfiguration( String prefix, Registry registry )
1602    {
1603        NetworkConfiguration value = new NetworkConfiguration();
1604
1605    int maxTotal = registry.getInt( prefix + "maxTotal", value.getMaxTotal() );
1606        value.setMaxTotal( maxTotal );
1607    int maxTotalPerHost = registry.getInt( prefix + "maxTotalPerHost", value.getMaxTotalPerHost() );
1608        value.setMaxTotalPerHost( maxTotalPerHost );
1609        boolean usePooling = registry.getBoolean( prefix + "usePooling", value.isUsePooling() );
1610        value.setUsePooling( usePooling );
1611
1612        return value;
1613    }
1614    
1615    private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration( String prefix, Registry registry )
1616    {
1617        ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
1618
1619        CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration( prefix + "urlFailureCacheConfiguration.", registry );
1620        value.setUrlFailureCacheConfiguration( urlFailureCacheConfiguration );
1621        FileLockConfiguration fileLockConfiguration = readFileLockConfiguration( prefix + "fileLockConfiguration.", registry );
1622        value.setFileLockConfiguration( fileLockConfiguration );
1623
1624        return value;
1625    }
1626    
1627    private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration( String prefix, Registry registry )
1628    {
1629        RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
1630
1631        boolean migratedFromRedbackConfiguration = registry.getBoolean( prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration() );
1632        value.setMigratedFromRedbackConfiguration( migratedFromRedbackConfiguration );
1633        java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
1634        userManagerImpls.addAll( registry.getList( prefix + "userManagerImpls.userManagerImpl" ) );
1635        value.setUserManagerImpls( userManagerImpls );
1636        java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
1637        rbacManagerImpls.addAll( registry.getList( prefix + "rbacManagerImpls.rbacManagerImpl" ) );
1638        value.setRbacManagerImpls( rbacManagerImpls );
1639        LdapConfiguration ldapConfiguration = readLdapConfiguration( prefix + "ldapConfiguration.", registry );
1640        value.setLdapConfiguration( ldapConfiguration );
1641        java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
1642        List ldapGroupMappingsSubsets = registry.getSubsetList( prefix + "ldapGroupMappings.ldapGroupMapping" );
1643        for ( Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); )
1644        {
1645            LdapGroupMapping v = readLdapGroupMapping( "", (Registry) i.next() );
1646            ldapGroupMappings.add( v );
1647        }
1648        value.setLdapGroupMappings( ldapGroupMappings );
1649        java.util.Map configurationProperties = registry.getProperties( prefix + "configurationProperties" );
1650        value.setConfigurationProperties( configurationProperties );
1651        boolean useUsersCache = registry.getBoolean( prefix + "useUsersCache", value.isUseUsersCache() );
1652        value.setUseUsersCache( useUsersCache );
1653        CacheConfiguration usersCacheConfiguration = readCacheConfiguration( prefix + "usersCacheConfiguration.", registry );
1654        value.setUsersCacheConfiguration( usersCacheConfiguration );
1655
1656        return value;
1657    }
1658    
1659    private ArchivaDefaultConfiguration readArchivaDefaultConfiguration( String prefix, Registry registry )
1660    {
1661        ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
1662
1663        java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
1664        List defaultCheckPathsSubsets = registry.getSubsetList( prefix + "defaultCheckPaths.defaultCheckPath" );
1665        for ( Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); )
1666        {
1667            RepositoryCheckPath v = readRepositoryCheckPath( "", (Registry) i.next() );
1668            defaultCheckPaths.add( v );
1669        }
1670        value.setDefaultCheckPaths( defaultCheckPaths );
1671
1672        return value;
1673    }
1674    
1675    private LdapConfiguration readLdapConfiguration( String prefix, Registry registry )
1676    {
1677        LdapConfiguration value = new LdapConfiguration();
1678
1679    //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
1680
1681    List<String> hostNameList = registry.getList( prefix + "hostName" );
1682    String hostName = value.getHostName();
1683    if (hostNameList != null && !hostNameList.isEmpty() )
1684    {
1685        StringBuilder sb = new StringBuilder(  );
1686        for (int i = 0,size = hostNameList.size();i<size;i++)
1687        {
1688            sb.append( hostNameList.get( i ) );
1689            if (i<size - 1)
1690            {
1691                sb.append( ',' );
1692            }
1693        }
1694        hostName = sb.toString();
1695    }
1696
1697        value.setHostName( hostName );
1698    int port = registry.getInt( prefix + "port", value.getPort() );
1699        value.setPort( port );
1700        boolean ssl = registry.getBoolean( prefix + "ssl", value.isSsl() );
1701        value.setSsl( ssl );
1702    //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
1703
1704    List<String> baseDnList = registry.getList( prefix + "baseDn" );
1705    String baseDn = value.getBaseDn();
1706    if (baseDnList != null && !baseDnList.isEmpty() )
1707    {
1708        StringBuilder sb = new StringBuilder(  );
1709        for (int i = 0,size = baseDnList.size();i<size;i++)
1710        {
1711            sb.append( baseDnList.get( i ) );
1712            if (i<size - 1)
1713            {
1714                sb.append( ',' );
1715            }
1716        }
1717        baseDn = sb.toString();
1718    }
1719
1720        value.setBaseDn( baseDn );
1721    //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
1722
1723    List<String> baseGroupsDnList = registry.getList( prefix + "baseGroupsDn" );
1724    String baseGroupsDn = value.getBaseGroupsDn();
1725    if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty() )
1726    {
1727        StringBuilder sb = new StringBuilder(  );
1728        for (int i = 0,size = baseGroupsDnList.size();i<size;i++)
1729        {
1730            sb.append( baseGroupsDnList.get( i ) );
1731            if (i<size - 1)
1732            {
1733                sb.append( ',' );
1734            }
1735        }
1736        baseGroupsDn = sb.toString();
1737    }
1738
1739        value.setBaseGroupsDn( baseGroupsDn );
1740    //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
1741
1742    List<String> contextFactoryList = registry.getList( prefix + "contextFactory" );
1743    String contextFactory = value.getContextFactory();
1744    if (contextFactoryList != null && !contextFactoryList.isEmpty() )
1745    {
1746        StringBuilder sb = new StringBuilder(  );
1747        for (int i = 0,size = contextFactoryList.size();i<size;i++)
1748        {
1749            sb.append( contextFactoryList.get( i ) );
1750            if (i<size - 1)
1751            {
1752                sb.append( ',' );
1753            }
1754        }
1755        contextFactory = sb.toString();
1756    }
1757
1758        value.setContextFactory( contextFactory );
1759    //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
1760
1761    List<String> bindDnList = registry.getList( prefix + "bindDn" );
1762    String bindDn = value.getBindDn();
1763    if (bindDnList != null && !bindDnList.isEmpty() )
1764    {
1765        StringBuilder sb = new StringBuilder(  );
1766        for (int i = 0,size = bindDnList.size();i<size;i++)
1767        {
1768            sb.append( bindDnList.get( i ) );
1769            if (i<size - 1)
1770            {
1771                sb.append( ',' );
1772            }
1773        }
1774        bindDn = sb.toString();
1775    }
1776
1777        value.setBindDn( bindDn );
1778    //String password = registry.getString( prefix + "password", value.getPassword() );
1779
1780    List<String> passwordList = registry.getList( prefix + "password" );
1781    String password = value.getPassword();
1782    if (passwordList != null && !passwordList.isEmpty() )
1783    {
1784        StringBuilder sb = new StringBuilder(  );
1785        for (int i = 0,size = passwordList.size();i<size;i++)
1786        {
1787            sb.append( passwordList.get( i ) );
1788            if (i<size - 1)
1789            {
1790                sb.append( ',' );
1791            }
1792        }
1793        password = sb.toString();
1794    }
1795
1796        value.setPassword( password );
1797    //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
1798
1799    List<String> authenticationMethodList = registry.getList( prefix + "authenticationMethod" );
1800    String authenticationMethod = value.getAuthenticationMethod();
1801    if (authenticationMethodList != null && !authenticationMethodList.isEmpty() )
1802    {
1803        StringBuilder sb = new StringBuilder(  );
1804        for (int i = 0,size = authenticationMethodList.size();i<size;i++)
1805        {
1806            sb.append( authenticationMethodList.get( i ) );
1807            if (i<size - 1)
1808            {
1809                sb.append( ',' );
1810            }
1811        }
1812        authenticationMethod = sb.toString();
1813    }
1814
1815        value.setAuthenticationMethod( authenticationMethod );
1816        boolean bindAuthenticatorEnabled = registry.getBoolean( prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled() );
1817        value.setBindAuthenticatorEnabled( bindAuthenticatorEnabled );
1818        boolean writable = registry.getBoolean( prefix + "writable", value.isWritable() );
1819        value.setWritable( writable );
1820        boolean useRoleNameAsGroup = registry.getBoolean( prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup() );
1821        value.setUseRoleNameAsGroup( useRoleNameAsGroup );
1822        java.util.Map extraProperties = registry.getProperties( prefix + "extraProperties" );
1823        value.setExtraProperties( extraProperties );
1824
1825        return value;
1826    }
1827    
1828    private FileLockConfiguration readFileLockConfiguration( String prefix, Registry registry )
1829    {
1830        FileLockConfiguration value = new FileLockConfiguration();
1831
1832        boolean skipLocking = registry.getBoolean( prefix + "skipLocking", value.isSkipLocking() );
1833        value.setSkipLocking( skipLocking );
1834    int lockingTimeout = registry.getInt( prefix + "lockingTimeout", value.getLockingTimeout() );
1835        value.setLockingTimeout( lockingTimeout );
1836
1837        return value;
1838    }
1839    
1840    private CacheConfiguration readCacheConfiguration( String prefix, Registry registry )
1841    {
1842        CacheConfiguration value = new CacheConfiguration();
1843
1844    int timeToIdleSeconds = registry.getInt( prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds() );
1845        value.setTimeToIdleSeconds( timeToIdleSeconds );
1846    int timeToLiveSeconds = registry.getInt( prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds() );
1847        value.setTimeToLiveSeconds( timeToLiveSeconds );
1848    int maxElementsInMemory = registry.getInt( prefix + "maxElementsInMemory", value.getMaxElementsInMemory() );
1849        value.setMaxElementsInMemory( maxElementsInMemory );
1850    int maxElementsOnDisk = registry.getInt( prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk() );
1851        value.setMaxElementsOnDisk( maxElementsOnDisk );
1852
1853        return value;
1854    }
1855    
1856    private LdapGroupMapping readLdapGroupMapping( String prefix, Registry registry )
1857    {
1858        LdapGroupMapping value = new LdapGroupMapping();
1859
1860    //String group = registry.getString( prefix + "group", value.getGroup() );
1861
1862    List<String> groupList = registry.getList( prefix + "group" );
1863    String group = value.getGroup();
1864    if (groupList != null && !groupList.isEmpty() )
1865    {
1866        StringBuilder sb = new StringBuilder(  );
1867        for (int i = 0,size = groupList.size();i<size;i++)
1868        {
1869            sb.append( groupList.get( i ) );
1870            if (i<size - 1)
1871            {
1872                sb.append( ',' );
1873            }
1874        }
1875        group = sb.toString();
1876    }
1877
1878        value.setGroup( group );
1879        java.util.List roleNames = new java.util.ArrayList/*<String>*/();
1880        roleNames.addAll( registry.getList( prefix + "roleNames.roleName" ) );
1881        value.setRoleNames( roleNames );
1882
1883        return value;
1884    }
1885    
1886}