2 package org.apache.archiva.configuration.io.registry;
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
23 import org.apache.archiva.redback.components.registry.Registry;
28 // Model class imports
29 import org.apache.archiva.configuration.Configuration;
30 import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
31 import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
32 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
33 import org.apache.archiva.configuration.LegacyArtifactPath;
34 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
35 import org.apache.archiva.configuration.RepositoryCheckPath;
36 import org.apache.archiva.configuration.AbstractRepositoryConnectorConfiguration;
37 import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration;
38 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
39 import org.apache.archiva.configuration.SyncConnectorConfiguration;
40 import org.apache.archiva.configuration.NetworkProxyConfiguration;
41 import org.apache.archiva.configuration.RepositoryScanningConfiguration;
42 import org.apache.archiva.configuration.FileType;
43 import org.apache.archiva.configuration.OrganisationInformation;
44 import org.apache.archiva.configuration.WebappConfiguration;
45 import org.apache.archiva.configuration.UserInterfaceOptions;
46 import org.apache.archiva.configuration.NetworkConfiguration;
47 import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
48 import org.apache.archiva.configuration.RedbackRuntimeConfiguration;
49 import org.apache.archiva.configuration.ArchivaDefaultConfiguration;
50 import org.apache.archiva.configuration.LdapConfiguration;
51 import org.apache.archiva.configuration.FileLockConfiguration;
52 import org.apache.archiva.configuration.CacheConfiguration;
53 import org.apache.archiva.configuration.LdapGroupMapping;
59 * Generate Redback Registry input mechanism for model 'Configuration'.
61 public class ConfigurationRegistryReader
63 public Configuration read( Registry registry )
65 return readConfiguration( "", registry );
68 private Configuration readConfiguration( String prefix, Registry registry )
70 Configuration value = new Configuration();
72 //String version = registry.getString( prefix + "version", value.getVersion() );
74 List<String> versionList = registry.getList( prefix + "version" );
75 String version = value.getVersion();
76 if (versionList != null && !versionList.isEmpty() )
78 StringBuilder sb = new StringBuilder( );
79 for (int i = 0,size = versionList.size();i<size;i++)
81 sb.append( versionList.get( i ) );
87 version = sb.toString();
90 value.setVersion( version );
91 //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() );
93 List<String> metadataStoreList = registry.getList( prefix + "metadataStore" );
94 String metadataStore = value.getMetadataStore();
95 if (metadataStoreList != null && !metadataStoreList.isEmpty() )
97 StringBuilder sb = new StringBuilder( );
98 for (int i = 0,size = metadataStoreList.size();i<size;i++)
100 sb.append( metadataStoreList.get( i ) );
106 metadataStore = sb.toString();
109 value.setMetadataStore( metadataStore );
110 java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
111 List repositoryGroupsSubsets = registry.getSubsetList( prefix + "repositoryGroups.repositoryGroup" );
112 for ( Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); )
114 RepositoryGroupConfiguration v = readRepositoryGroupConfiguration( "", (Registry) i.next() );
115 repositoryGroups.add( v );
117 value.setRepositoryGroups( repositoryGroups );
118 java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
119 List managedRepositoriesSubsets = registry.getSubsetList( prefix + "managedRepositories.managedRepository" );
120 for ( Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); )
122 ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration( "", (Registry) i.next() );
123 managedRepositories.add( v );
125 value.setManagedRepositories( managedRepositories );
126 java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
127 List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" );
128 for ( Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); )
130 RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration( "", (Registry) i.next() );
131 remoteRepositories.add( v );
133 value.setRemoteRepositories( remoteRepositories );
134 java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
135 List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
136 for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
138 ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
139 proxyConnectors.add( v );
141 value.setProxyConnectors( proxyConnectors );
142 java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
143 List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
144 for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
146 NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
147 networkProxies.add( v );
149 value.setNetworkProxies( networkProxies );
150 java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
151 List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
152 for ( Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); )
154 LegacyArtifactPath v = readLegacyArtifactPath( "", (Registry) i.next() );
155 legacyArtifactPaths.add( v );
157 value.setLegacyArtifactPaths( legacyArtifactPaths );
158 RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration( prefix + "repositoryScanning.", registry );
159 value.setRepositoryScanning( repositoryScanning );
160 WebappConfiguration webapp = readWebappConfiguration( prefix + "webapp.", registry );
161 value.setWebapp( webapp );
162 OrganisationInformation organisationInfo = readOrganisationInformation( prefix + "organisationInfo.", registry );
163 value.setOrganisationInfo( organisationInfo );
164 NetworkConfiguration networkConfiguration = readNetworkConfiguration( prefix + "networkConfiguration.", registry );
165 value.setNetworkConfiguration( networkConfiguration );
166 RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration( prefix + "redbackRuntimeConfiguration.", registry );
167 value.setRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
168 ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration( prefix + "archivaRuntimeConfiguration.", registry );
169 value.setArchivaRuntimeConfiguration( archivaRuntimeConfiguration );
170 java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
171 List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList( prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration" );
172 for ( Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); )
174 ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration( "", (Registry) i.next() );
175 proxyConnectorRuleConfigurations.add( v );
177 value.setProxyConnectorRuleConfigurations( proxyConnectorRuleConfigurations );
178 ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration( prefix + "archivaDefaultConfiguration.", registry );
179 value.setArchivaDefaultConfiguration( archivaDefaultConfiguration );
184 private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration( String prefix, Registry registry )
186 AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
188 //String id = registry.getString( prefix + "id", value.getId() );
190 List<String> idList = registry.getList( prefix + "id" );
191 String id = value.getId();
192 if (idList != null && !idList.isEmpty() )
194 StringBuilder sb = new StringBuilder( );
195 for (int i = 0,size = idList.size();i<size;i++)
197 sb.append( idList.get( i ) );
207 //String type = registry.getString( prefix + "type", value.getType() );
209 List<String> typeList = registry.getList( prefix + "type" );
210 String type = value.getType();
211 if (typeList != null && !typeList.isEmpty() )
213 StringBuilder sb = new StringBuilder( );
214 for (int i = 0,size = typeList.size();i<size;i++)
216 sb.append( typeList.get( i ) );
222 type = sb.toString();
225 value.setType( type );
226 //String name = registry.getString( prefix + "name", value.getName() );
228 List<String> nameList = registry.getList( prefix + "name" );
229 String name = value.getName();
230 if (nameList != null && !nameList.isEmpty() )
232 StringBuilder sb = new StringBuilder( );
233 for (int i = 0,size = nameList.size();i<size;i++)
235 sb.append( nameList.get( i ) );
241 name = sb.toString();
244 value.setName( name );
245 //String layout = registry.getString( prefix + "layout", value.getLayout() );
247 List<String> layoutList = registry.getList( prefix + "layout" );
248 String layout = value.getLayout();
249 if (layoutList != null && !layoutList.isEmpty() )
251 StringBuilder sb = new StringBuilder( );
252 for (int i = 0,size = layoutList.size();i<size;i++)
254 sb.append( layoutList.get( i ) );
260 layout = sb.toString();
263 value.setLayout( layout );
264 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
266 List<String> indexDirList = registry.getList( prefix + "indexDir" );
267 String indexDir = value.getIndexDir();
268 if (indexDirList != null && !indexDirList.isEmpty() )
270 StringBuilder sb = new StringBuilder( );
271 for (int i = 0,size = indexDirList.size();i<size;i++)
273 sb.append( indexDirList.get( i ) );
279 indexDir = sb.toString();
282 value.setIndexDir( indexDir );
283 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
285 List<String> packedIndexDirList = registry.getList( prefix + "packedIndexDir" );
286 String packedIndexDir = value.getPackedIndexDir();
287 if (packedIndexDirList != null && !packedIndexDirList.isEmpty() )
289 StringBuilder sb = new StringBuilder( );
290 for (int i = 0,size = packedIndexDirList.size();i<size;i++)
292 sb.append( packedIndexDirList.get( i ) );
298 packedIndexDir = sb.toString();
301 value.setPackedIndexDir( packedIndexDir );
302 //String description = registry.getString( prefix + "description", value.getDescription() );
304 List<String> descriptionList = registry.getList( prefix + "description" );
305 String description = value.getDescription();
306 if (descriptionList != null && !descriptionList.isEmpty() )
308 StringBuilder sb = new StringBuilder( );
309 for (int i = 0,size = descriptionList.size();i<size;i++)
311 sb.append( descriptionList.get( i ) );
317 description = sb.toString();
320 value.setDescription( description );
325 private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration( String prefix, Registry registry )
327 RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
329 //String url = registry.getString( prefix + "url", value.getUrl() );
331 List<String> urlList = registry.getList( prefix + "url" );
332 String url = value.getUrl();
333 if (urlList != null && !urlList.isEmpty() )
335 StringBuilder sb = new StringBuilder( );
336 for (int i = 0,size = urlList.size();i<size;i++)
338 sb.append( urlList.get( i ) );
348 //String username = registry.getString( prefix + "username", value.getUsername() );
350 List<String> usernameList = registry.getList( prefix + "username" );
351 String username = value.getUsername();
352 if (usernameList != null && !usernameList.isEmpty() )
354 StringBuilder sb = new StringBuilder( );
355 for (int i = 0,size = usernameList.size();i<size;i++)
357 sb.append( usernameList.get( i ) );
363 username = sb.toString();
366 value.setUsername( username );
367 //String password = registry.getString( prefix + "password", value.getPassword() );
369 List<String> passwordList = registry.getList( prefix + "password" );
370 String password = value.getPassword();
371 if (passwordList != null && !passwordList.isEmpty() )
373 StringBuilder sb = new StringBuilder( );
374 for (int i = 0,size = passwordList.size();i<size;i++)
376 sb.append( passwordList.get( i ) );
382 password = sb.toString();
385 value.setPassword( password );
386 int timeout = registry.getInt( prefix + "timeout", value.getTimeout() );
387 value.setTimeout( timeout );
388 //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
390 List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
391 String refreshCronExpression = value.getRefreshCronExpression();
392 if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
394 StringBuilder sb = new StringBuilder( );
395 for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
397 sb.append( refreshCronExpressionList.get( i ) );
403 refreshCronExpression = sb.toString();
406 value.setRefreshCronExpression( refreshCronExpression );
407 boolean downloadRemoteIndex = registry.getBoolean( prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex() );
408 value.setDownloadRemoteIndex( downloadRemoteIndex );
409 //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
411 List<String> remoteIndexUrlList = registry.getList( prefix + "remoteIndexUrl" );
412 String remoteIndexUrl = value.getRemoteIndexUrl();
413 if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty() )
415 StringBuilder sb = new StringBuilder( );
416 for (int i = 0,size = remoteIndexUrlList.size();i<size;i++)
418 sb.append( remoteIndexUrlList.get( i ) );
424 remoteIndexUrl = sb.toString();
427 value.setRemoteIndexUrl( remoteIndexUrl );
428 //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
430 List<String> remoteDownloadNetworkProxyIdList = registry.getList( prefix + "remoteDownloadNetworkProxyId" );
431 String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
432 if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty() )
434 StringBuilder sb = new StringBuilder( );
435 for (int i = 0,size = remoteDownloadNetworkProxyIdList.size();i<size;i++)
437 sb.append( remoteDownloadNetworkProxyIdList.get( i ) );
443 remoteDownloadNetworkProxyId = sb.toString();
446 value.setRemoteDownloadNetworkProxyId( remoteDownloadNetworkProxyId );
447 int remoteDownloadTimeout = registry.getInt( prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout() );
448 value.setRemoteDownloadTimeout( remoteDownloadTimeout );
449 boolean downloadRemoteIndexOnStartup = registry.getBoolean( prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup() );
450 value.setDownloadRemoteIndexOnStartup( downloadRemoteIndexOnStartup );
451 java.util.Map extraParameters = registry.getProperties( prefix + "extraParameters" );
452 value.setExtraParameters( extraParameters );
453 java.util.Map extraHeaders = registry.getProperties( prefix + "extraHeaders" );
454 value.setExtraHeaders( extraHeaders );
455 //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
457 List<String> checkPathList = registry.getList( prefix + "checkPath" );
458 String checkPath = value.getCheckPath();
459 if (checkPathList != null && !checkPathList.isEmpty() )
461 StringBuilder sb = new StringBuilder( );
462 for (int i = 0,size = checkPathList.size();i<size;i++)
464 sb.append( checkPathList.get( i ) );
470 checkPath = sb.toString();
473 value.setCheckPath( checkPath );
474 //String id = registry.getString( prefix + "id", value.getId() );
476 List<String> idList = registry.getList( prefix + "id" );
477 String id = value.getId();
478 if (idList != null && !idList.isEmpty() )
480 StringBuilder sb = new StringBuilder( );
481 for (int i = 0,size = idList.size();i<size;i++)
483 sb.append( idList.get( i ) );
493 //String type = registry.getString( prefix + "type", value.getType() );
495 List<String> typeList = registry.getList( prefix + "type" );
496 String type = value.getType();
497 if (typeList != null && !typeList.isEmpty() )
499 StringBuilder sb = new StringBuilder( );
500 for (int i = 0,size = typeList.size();i<size;i++)
502 sb.append( typeList.get( i ) );
508 type = sb.toString();
511 value.setType( type );
512 //String name = registry.getString( prefix + "name", value.getName() );
514 List<String> nameList = registry.getList( prefix + "name" );
515 String name = value.getName();
516 if (nameList != null && !nameList.isEmpty() )
518 StringBuilder sb = new StringBuilder( );
519 for (int i = 0,size = nameList.size();i<size;i++)
521 sb.append( nameList.get( i ) );
527 name = sb.toString();
530 value.setName( name );
531 //String layout = registry.getString( prefix + "layout", value.getLayout() );
533 List<String> layoutList = registry.getList( prefix + "layout" );
534 String layout = value.getLayout();
535 if (layoutList != null && !layoutList.isEmpty() )
537 StringBuilder sb = new StringBuilder( );
538 for (int i = 0,size = layoutList.size();i<size;i++)
540 sb.append( layoutList.get( i ) );
546 layout = sb.toString();
549 value.setLayout( layout );
550 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
552 List<String> indexDirList = registry.getList( prefix + "indexDir" );
553 String indexDir = value.getIndexDir();
554 if (indexDirList != null && !indexDirList.isEmpty() )
556 StringBuilder sb = new StringBuilder( );
557 for (int i = 0,size = indexDirList.size();i<size;i++)
559 sb.append( indexDirList.get( i ) );
565 indexDir = sb.toString();
568 value.setIndexDir( indexDir );
569 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
571 List<String> packedIndexDirList = registry.getList( prefix + "packedIndexDir" );
572 String packedIndexDir = value.getPackedIndexDir();
573 if (packedIndexDirList != null && !packedIndexDirList.isEmpty() )
575 StringBuilder sb = new StringBuilder( );
576 for (int i = 0,size = packedIndexDirList.size();i<size;i++)
578 sb.append( packedIndexDirList.get( i ) );
584 packedIndexDir = sb.toString();
587 value.setPackedIndexDir( packedIndexDir );
588 //String description = registry.getString( prefix + "description", value.getDescription() );
590 List<String> descriptionList = registry.getList( prefix + "description" );
591 String description = value.getDescription();
592 if (descriptionList != null && !descriptionList.isEmpty() )
594 StringBuilder sb = new StringBuilder( );
595 for (int i = 0,size = descriptionList.size();i<size;i++)
597 sb.append( descriptionList.get( i ) );
603 description = sb.toString();
606 value.setDescription( description );
611 private ManagedRepositoryConfiguration readManagedRepositoryConfiguration( String prefix, Registry registry )
613 ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
615 //String location = registry.getString( prefix + "location", value.getLocation() );
617 List<String> locationList = registry.getList( prefix + "location" );
618 String location = value.getLocation();
619 if (locationList != null && !locationList.isEmpty() )
621 StringBuilder sb = new StringBuilder( );
622 for (int i = 0,size = locationList.size();i<size;i++)
624 sb.append( locationList.get( i ) );
630 location = sb.toString();
633 value.setLocation( location );
634 boolean releases = registry.getBoolean( prefix + "releases", value.isReleases() );
635 value.setReleases( releases );
636 boolean blockRedeployments = registry.getBoolean( prefix + "blockRedeployments", value.isBlockRedeployments() );
637 value.setBlockRedeployments( blockRedeployments );
638 boolean snapshots = registry.getBoolean( prefix + "snapshots", value.isSnapshots() );
639 value.setSnapshots( snapshots );
640 boolean scanned = registry.getBoolean( prefix + "scanned", value.isScanned() );
641 value.setScanned( scanned );
642 //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
644 List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
645 String refreshCronExpression = value.getRefreshCronExpression();
646 if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
648 StringBuilder sb = new StringBuilder( );
649 for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
651 sb.append( refreshCronExpressionList.get( i ) );
657 refreshCronExpression = sb.toString();
660 value.setRefreshCronExpression( refreshCronExpression );
661 int retentionCount = registry.getInt( prefix + "retentionCount", value.getRetentionCount() );
662 value.setRetentionCount( retentionCount );
663 int retentionPeriod = registry.getInt( prefix + "retentionPeriod", value.getRetentionPeriod() );
664 value.setRetentionPeriod( retentionPeriod );
665 boolean deleteReleasedSnapshots = registry.getBoolean( prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots() );
666 value.setDeleteReleasedSnapshots( deleteReleasedSnapshots );
667 boolean skipPackedIndexCreation = registry.getBoolean( prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation() );
668 value.setSkipPackedIndexCreation( skipPackedIndexCreation );
669 boolean stageRepoNeeded = registry.getBoolean( prefix + "stageRepoNeeded", value.isStageRepoNeeded() );
670 value.setStageRepoNeeded( stageRepoNeeded );
671 //String id = registry.getString( prefix + "id", value.getId() );
673 List<String> idList = registry.getList( prefix + "id" );
674 String id = value.getId();
675 if (idList != null && !idList.isEmpty() )
677 StringBuilder sb = new StringBuilder( );
678 for (int i = 0,size = idList.size();i<size;i++)
680 sb.append( idList.get( i ) );
690 //String type = registry.getString( prefix + "type", value.getType() );
692 List<String> typeList = registry.getList( prefix + "type" );
693 String type = value.getType();
694 if (typeList != null && !typeList.isEmpty() )
696 StringBuilder sb = new StringBuilder( );
697 for (int i = 0,size = typeList.size();i<size;i++)
699 sb.append( typeList.get( i ) );
705 type = sb.toString();
708 value.setType( type );
709 //String name = registry.getString( prefix + "name", value.getName() );
711 List<String> nameList = registry.getList( prefix + "name" );
712 String name = value.getName();
713 if (nameList != null && !nameList.isEmpty() )
715 StringBuilder sb = new StringBuilder( );
716 for (int i = 0,size = nameList.size();i<size;i++)
718 sb.append( nameList.get( i ) );
724 name = sb.toString();
727 value.setName( name );
728 //String layout = registry.getString( prefix + "layout", value.getLayout() );
730 List<String> layoutList = registry.getList( prefix + "layout" );
731 String layout = value.getLayout();
732 if (layoutList != null && !layoutList.isEmpty() )
734 StringBuilder sb = new StringBuilder( );
735 for (int i = 0,size = layoutList.size();i<size;i++)
737 sb.append( layoutList.get( i ) );
743 layout = sb.toString();
746 value.setLayout( layout );
747 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
749 List<String> indexDirList = registry.getList( prefix + "indexDir" );
750 String indexDir = value.getIndexDir();
751 if (indexDirList != null && !indexDirList.isEmpty() )
753 StringBuilder sb = new StringBuilder( );
754 for (int i = 0,size = indexDirList.size();i<size;i++)
756 sb.append( indexDirList.get( i ) );
762 indexDir = sb.toString();
765 value.setIndexDir( indexDir );
766 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
768 List<String> packedIndexDirList = registry.getList( prefix + "packedIndexDir" );
769 String packedIndexDir = value.getPackedIndexDir();
770 if (packedIndexDirList != null && !packedIndexDirList.isEmpty() )
772 StringBuilder sb = new StringBuilder( );
773 for (int i = 0,size = packedIndexDirList.size();i<size;i++)
775 sb.append( packedIndexDirList.get( i ) );
781 packedIndexDir = sb.toString();
784 value.setPackedIndexDir( packedIndexDir );
785 //String description = registry.getString( prefix + "description", value.getDescription() );
787 List<String> descriptionList = registry.getList( prefix + "description" );
788 String description = value.getDescription();
789 if (descriptionList != null && !descriptionList.isEmpty() )
791 StringBuilder sb = new StringBuilder( );
792 for (int i = 0,size = descriptionList.size();i<size;i++)
794 sb.append( descriptionList.get( i ) );
800 description = sb.toString();
803 value.setDescription( description );
808 private LegacyArtifactPath readLegacyArtifactPath( String prefix, Registry registry )
810 LegacyArtifactPath value = new LegacyArtifactPath();
812 //String path = registry.getString( prefix + "path", value.getPath() );
814 List<String> pathList = registry.getList( prefix + "path" );
815 String path = value.getPath();
816 if (pathList != null && !pathList.isEmpty() )
818 StringBuilder sb = new StringBuilder( );
819 for (int i = 0,size = pathList.size();i<size;i++)
821 sb.append( pathList.get( i ) );
827 path = sb.toString();
830 value.setPath( path );
831 //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
833 List<String> artifactList = registry.getList( prefix + "artifact" );
834 String artifact = value.getArtifact();
835 if (artifactList != null && !artifactList.isEmpty() )
837 StringBuilder sb = new StringBuilder( );
838 for (int i = 0,size = artifactList.size();i<size;i++)
840 sb.append( artifactList.get( i ) );
846 artifact = sb.toString();
849 value.setArtifact( artifact );
854 private RepositoryGroupConfiguration readRepositoryGroupConfiguration( String prefix, Registry registry )
856 RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
858 //String id = registry.getString( prefix + "id", value.getId() );
860 List<String> idList = registry.getList( prefix + "id" );
861 String id = value.getId();
862 if (idList != null && !idList.isEmpty() )
864 StringBuilder sb = new StringBuilder( );
865 for (int i = 0,size = idList.size();i<size;i++)
867 sb.append( idList.get( i ) );
877 //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
879 List<String> mergedIndexPathList = registry.getList( prefix + "mergedIndexPath" );
880 String mergedIndexPath = value.getMergedIndexPath();
881 if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty() )
883 StringBuilder sb = new StringBuilder( );
884 for (int i = 0,size = mergedIndexPathList.size();i<size;i++)
886 sb.append( mergedIndexPathList.get( i ) );
892 mergedIndexPath = sb.toString();
895 value.setMergedIndexPath( mergedIndexPath );
896 int mergedIndexTtl = registry.getInt( prefix + "mergedIndexTtl", value.getMergedIndexTtl() );
897 value.setMergedIndexTtl( mergedIndexTtl );
898 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
900 List<String> cronExpressionList = registry.getList( prefix + "cronExpression" );
901 String cronExpression = value.getCronExpression();
902 if (cronExpressionList != null && !cronExpressionList.isEmpty() )
904 StringBuilder sb = new StringBuilder( );
905 for (int i = 0,size = cronExpressionList.size();i<size;i++)
907 sb.append( cronExpressionList.get( i ) );
913 cronExpression = sb.toString();
916 value.setCronExpression( cronExpression );
917 java.util.List repositories = new java.util.ArrayList/*<String>*/();
918 repositories.addAll( registry.getList( prefix + "repositories.repository" ) );
919 value.setRepositories( repositories );
924 private RepositoryCheckPath readRepositoryCheckPath( String prefix, Registry registry )
926 RepositoryCheckPath value = new RepositoryCheckPath();
928 //String url = registry.getString( prefix + "url", value.getUrl() );
930 List<String> urlList = registry.getList( prefix + "url" );
931 String url = value.getUrl();
932 if (urlList != null && !urlList.isEmpty() )
934 StringBuilder sb = new StringBuilder( );
935 for (int i = 0,size = urlList.size();i<size;i++)
937 sb.append( urlList.get( i ) );
947 //String path = registry.getString( prefix + "path", value.getPath() );
949 List<String> pathList = registry.getList( prefix + "path" );
950 String path = value.getPath();
951 if (pathList != null && !pathList.isEmpty() )
953 StringBuilder sb = new StringBuilder( );
954 for (int i = 0,size = pathList.size();i<size;i++)
956 sb.append( pathList.get( i ) );
962 path = sb.toString();
965 value.setPath( path );
970 private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration( String prefix, Registry registry )
972 AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
974 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
976 List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
977 String sourceRepoId = value.getSourceRepoId();
978 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
980 StringBuilder sb = new StringBuilder( );
981 for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
983 sb.append( sourceRepoIdList.get( i ) );
989 sourceRepoId = sb.toString();
992 value.setSourceRepoId( sourceRepoId );
993 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
995 List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
996 String targetRepoId = value.getTargetRepoId();
997 if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
999 StringBuilder sb = new StringBuilder( );
1000 for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1002 sb.append( targetRepoIdList.get( i ) );
1008 targetRepoId = sb.toString();
1011 value.setTargetRepoId( targetRepoId );
1012 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1014 List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1015 String proxyId = value.getProxyId();
1016 if (proxyIdList != null && !proxyIdList.isEmpty() )
1018 StringBuilder sb = new StringBuilder( );
1019 for (int i = 0,size = proxyIdList.size();i<size;i++)
1021 sb.append( proxyIdList.get( i ) );
1027 proxyId = sb.toString();
1030 value.setProxyId( proxyId );
1031 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1032 blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1033 value.setBlackListPatterns( blackListPatterns );
1034 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1035 whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1036 value.setWhiteListPatterns( whiteListPatterns );
1037 java.util.Map policies = registry.getProperties( prefix + "policies" );
1038 value.setPolicies( policies );
1039 java.util.Map properties = registry.getProperties( prefix + "properties" );
1040 value.setProperties( properties );
1041 boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1042 value.setDisabled( disabled );
1047 private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration( String prefix, Registry registry )
1049 ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
1051 //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
1053 List<String> ruleTypeList = registry.getList( prefix + "ruleType" );
1054 String ruleType = value.getRuleType();
1055 if (ruleTypeList != null && !ruleTypeList.isEmpty() )
1057 StringBuilder sb = new StringBuilder( );
1058 for (int i = 0,size = ruleTypeList.size();i<size;i++)
1060 sb.append( ruleTypeList.get( i ) );
1066 ruleType = sb.toString();
1069 value.setRuleType( ruleType );
1070 //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
1072 List<String> patternList = registry.getList( prefix + "pattern" );
1073 String pattern = value.getPattern();
1074 if (patternList != null && !patternList.isEmpty() )
1076 StringBuilder sb = new StringBuilder( );
1077 for (int i = 0,size = patternList.size();i<size;i++)
1079 sb.append( patternList.get( i ) );
1085 pattern = sb.toString();
1088 value.setPattern( pattern );
1089 java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
1090 List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
1091 for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
1093 ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
1094 proxyConnectors.add( v );
1096 value.setProxyConnectors( proxyConnectors );
1101 private ProxyConnectorConfiguration readProxyConnectorConfiguration( String prefix, Registry registry )
1103 ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
1105 int order = registry.getInt( prefix + "order", value.getOrder() );
1106 value.setOrder( order );
1107 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1109 List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
1110 String sourceRepoId = value.getSourceRepoId();
1111 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
1113 StringBuilder sb = new StringBuilder( );
1114 for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
1116 sb.append( sourceRepoIdList.get( i ) );
1122 sourceRepoId = sb.toString();
1125 value.setSourceRepoId( sourceRepoId );
1126 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1128 List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
1129 String targetRepoId = value.getTargetRepoId();
1130 if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
1132 StringBuilder sb = new StringBuilder( );
1133 for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1135 sb.append( targetRepoIdList.get( i ) );
1141 targetRepoId = sb.toString();
1144 value.setTargetRepoId( targetRepoId );
1145 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1147 List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1148 String proxyId = value.getProxyId();
1149 if (proxyIdList != null && !proxyIdList.isEmpty() )
1151 StringBuilder sb = new StringBuilder( );
1152 for (int i = 0,size = proxyIdList.size();i<size;i++)
1154 sb.append( proxyIdList.get( i ) );
1160 proxyId = sb.toString();
1163 value.setProxyId( proxyId );
1164 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1165 blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1166 value.setBlackListPatterns( blackListPatterns );
1167 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1168 whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1169 value.setWhiteListPatterns( whiteListPatterns );
1170 java.util.Map policies = registry.getProperties( prefix + "policies" );
1171 value.setPolicies( policies );
1172 java.util.Map properties = registry.getProperties( prefix + "properties" );
1173 value.setProperties( properties );
1174 boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1175 value.setDisabled( disabled );
1180 private SyncConnectorConfiguration readSyncConnectorConfiguration( String prefix, Registry registry )
1182 SyncConnectorConfiguration value = new SyncConnectorConfiguration();
1184 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
1186 List<String> cronExpressionList = registry.getList( prefix + "cronExpression" );
1187 String cronExpression = value.getCronExpression();
1188 if (cronExpressionList != null && !cronExpressionList.isEmpty() )
1190 StringBuilder sb = new StringBuilder( );
1191 for (int i = 0,size = cronExpressionList.size();i<size;i++)
1193 sb.append( cronExpressionList.get( i ) );
1199 cronExpression = sb.toString();
1202 value.setCronExpression( cronExpression );
1203 //String method = registry.getString( prefix + "method", value.getMethod() );
1205 List<String> methodList = registry.getList( prefix + "method" );
1206 String method = value.getMethod();
1207 if (methodList != null && !methodList.isEmpty() )
1209 StringBuilder sb = new StringBuilder( );
1210 for (int i = 0,size = methodList.size();i<size;i++)
1212 sb.append( methodList.get( i ) );
1218 method = sb.toString();
1221 value.setMethod( method );
1222 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1224 List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
1225 String sourceRepoId = value.getSourceRepoId();
1226 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
1228 StringBuilder sb = new StringBuilder( );
1229 for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
1231 sb.append( sourceRepoIdList.get( i ) );
1237 sourceRepoId = sb.toString();
1240 value.setSourceRepoId( sourceRepoId );
1241 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1243 List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
1244 String targetRepoId = value.getTargetRepoId();
1245 if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
1247 StringBuilder sb = new StringBuilder( );
1248 for (int i = 0,size = targetRepoIdList.size();i<size;i++)
1250 sb.append( targetRepoIdList.get( i ) );
1256 targetRepoId = sb.toString();
1259 value.setTargetRepoId( targetRepoId );
1260 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1262 List<String> proxyIdList = registry.getList( prefix + "proxyId" );
1263 String proxyId = value.getProxyId();
1264 if (proxyIdList != null && !proxyIdList.isEmpty() )
1266 StringBuilder sb = new StringBuilder( );
1267 for (int i = 0,size = proxyIdList.size();i<size;i++)
1269 sb.append( proxyIdList.get( i ) );
1275 proxyId = sb.toString();
1278 value.setProxyId( proxyId );
1279 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1280 blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
1281 value.setBlackListPatterns( blackListPatterns );
1282 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1283 whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
1284 value.setWhiteListPatterns( whiteListPatterns );
1285 java.util.Map policies = registry.getProperties( prefix + "policies" );
1286 value.setPolicies( policies );
1287 java.util.Map properties = registry.getProperties( prefix + "properties" );
1288 value.setProperties( properties );
1289 boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
1290 value.setDisabled( disabled );
1295 private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
1297 NetworkProxyConfiguration value = new NetworkProxyConfiguration();
1299 //String id = registry.getString( prefix + "id", value.getId() );
1301 List<String> idList = registry.getList( prefix + "id" );
1302 String id = value.getId();
1303 if (idList != null && !idList.isEmpty() )
1305 StringBuilder sb = new StringBuilder( );
1306 for (int i = 0,size = idList.size();i<size;i++)
1308 sb.append( idList.get( i ) );
1318 //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
1320 List<String> protocolList = registry.getList( prefix + "protocol" );
1321 String protocol = value.getProtocol();
1322 if (protocolList != null && !protocolList.isEmpty() )
1324 StringBuilder sb = new StringBuilder( );
1325 for (int i = 0,size = protocolList.size();i<size;i++)
1327 sb.append( protocolList.get( i ) );
1333 protocol = sb.toString();
1336 value.setProtocol( protocol );
1337 //String host = registry.getString( prefix + "host", value.getHost() );
1339 List<String> hostList = registry.getList( prefix + "host" );
1340 String host = value.getHost();
1341 if (hostList != null && !hostList.isEmpty() )
1343 StringBuilder sb = new StringBuilder( );
1344 for (int i = 0,size = hostList.size();i<size;i++)
1346 sb.append( hostList.get( i ) );
1352 host = sb.toString();
1355 value.setHost( host );
1356 int port = registry.getInt( prefix + "port", value.getPort() );
1357 value.setPort( port );
1358 //String username = registry.getString( prefix + "username", value.getUsername() );
1360 List<String> usernameList = registry.getList( prefix + "username" );
1361 String username = value.getUsername();
1362 if (usernameList != null && !usernameList.isEmpty() )
1364 StringBuilder sb = new StringBuilder( );
1365 for (int i = 0,size = usernameList.size();i<size;i++)
1367 sb.append( usernameList.get( i ) );
1373 username = sb.toString();
1376 value.setUsername( username );
1377 //String password = registry.getString( prefix + "password", value.getPassword() );
1379 List<String> passwordList = registry.getList( prefix + "password" );
1380 String password = value.getPassword();
1381 if (passwordList != null && !passwordList.isEmpty() )
1383 StringBuilder sb = new StringBuilder( );
1384 for (int i = 0,size = passwordList.size();i<size;i++)
1386 sb.append( passwordList.get( i ) );
1392 password = sb.toString();
1395 value.setPassword( password );
1396 boolean useNtlm = registry.getBoolean( prefix + "useNtlm", value.isUseNtlm() );
1397 value.setUseNtlm( useNtlm );
1402 private RepositoryScanningConfiguration readRepositoryScanningConfiguration( String prefix, Registry registry )
1404 RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
1406 java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
1407 List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" );
1408 for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); )
1410 FileType v = readFileType( "", (Registry) i.next() );
1413 value.setFileTypes( fileTypes );
1414 java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
1415 knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) );
1416 value.setKnownContentConsumers( knownContentConsumers );
1417 java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
1418 invalidContentConsumers.addAll( registry.getList( prefix + "invalidContentConsumers.invalidContentConsumer" ) );
1419 value.setInvalidContentConsumers( invalidContentConsumers );
1424 private FileType readFileType( String prefix, Registry registry )
1426 FileType value = new FileType();
1428 //String id = registry.getString( prefix + "id", value.getId() );
1430 List<String> idList = registry.getList( prefix + "id" );
1431 String id = value.getId();
1432 if (idList != null && !idList.isEmpty() )
1434 StringBuilder sb = new StringBuilder( );
1435 for (int i = 0,size = idList.size();i<size;i++)
1437 sb.append( idList.get( i ) );
1447 java.util.List patterns = new java.util.ArrayList/*<String>*/();
1448 patterns.addAll( registry.getList( prefix + "patterns.pattern" ) );
1449 value.setPatterns( patterns );
1454 private OrganisationInformation readOrganisationInformation( String prefix, Registry registry )
1456 OrganisationInformation value = new OrganisationInformation();
1458 //String name = registry.getString( prefix + "name", value.getName() );
1460 List<String> nameList = registry.getList( prefix + "name" );
1461 String name = value.getName();
1462 if (nameList != null && !nameList.isEmpty() )
1464 StringBuilder sb = new StringBuilder( );
1465 for (int i = 0,size = nameList.size();i<size;i++)
1467 sb.append( nameList.get( i ) );
1473 name = sb.toString();
1476 value.setName( name );
1477 //String url = registry.getString( prefix + "url", value.getUrl() );
1479 List<String> urlList = registry.getList( prefix + "url" );
1480 String url = value.getUrl();
1481 if (urlList != null && !urlList.isEmpty() )
1483 StringBuilder sb = new StringBuilder( );
1484 for (int i = 0,size = urlList.size();i<size;i++)
1486 sb.append( urlList.get( i ) );
1492 url = sb.toString();
1495 value.setUrl( url );
1496 //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
1498 List<String> logoLocationList = registry.getList( prefix + "logoLocation" );
1499 String logoLocation = value.getLogoLocation();
1500 if (logoLocationList != null && !logoLocationList.isEmpty() )
1502 StringBuilder sb = new StringBuilder( );
1503 for (int i = 0,size = logoLocationList.size();i<size;i++)
1505 sb.append( logoLocationList.get( i ) );
1511 logoLocation = sb.toString();
1514 value.setLogoLocation( logoLocation );
1519 private WebappConfiguration readWebappConfiguration( String prefix, Registry registry )
1521 WebappConfiguration value = new WebappConfiguration();
1523 UserInterfaceOptions ui = readUserInterfaceOptions( prefix + "ui.", registry );
1529 private UserInterfaceOptions readUserInterfaceOptions( String prefix, Registry registry )
1531 UserInterfaceOptions value = new UserInterfaceOptions();
1533 boolean showFindArtifacts = registry.getBoolean( prefix + "showFindArtifacts", value.isShowFindArtifacts() );
1534 value.setShowFindArtifacts( showFindArtifacts );
1535 boolean appletFindEnabled = registry.getBoolean( prefix + "appletFindEnabled", value.isAppletFindEnabled() );
1536 value.setAppletFindEnabled( appletFindEnabled );
1537 boolean disableEasterEggs = registry.getBoolean( prefix + "disableEasterEggs", value.isDisableEasterEggs() );
1538 value.setDisableEasterEggs( disableEasterEggs );
1539 //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
1541 List<String> applicationUrlList = registry.getList( prefix + "applicationUrl" );
1542 String applicationUrl = value.getApplicationUrl();
1543 if (applicationUrlList != null && !applicationUrlList.isEmpty() )
1545 StringBuilder sb = new StringBuilder( );
1546 for (int i = 0,size = applicationUrlList.size();i<size;i++)
1548 sb.append( applicationUrlList.get( i ) );
1554 applicationUrl = sb.toString();
1557 value.setApplicationUrl( applicationUrl );
1558 boolean disableRegistration = registry.getBoolean( prefix + "disableRegistration", value.isDisableRegistration() );
1559 value.setDisableRegistration( disableRegistration );
1564 private NetworkConfiguration readNetworkConfiguration( String prefix, Registry registry )
1566 NetworkConfiguration value = new NetworkConfiguration();
1568 int maxTotal = registry.getInt( prefix + "maxTotal", value.getMaxTotal() );
1569 value.setMaxTotal( maxTotal );
1570 int maxTotalPerHost = registry.getInt( prefix + "maxTotalPerHost", value.getMaxTotalPerHost() );
1571 value.setMaxTotalPerHost( maxTotalPerHost );
1572 boolean usePooling = registry.getBoolean( prefix + "usePooling", value.isUsePooling() );
1573 value.setUsePooling( usePooling );
1578 private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration( String prefix, Registry registry )
1580 ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
1582 CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration( prefix + "urlFailureCacheConfiguration.", registry );
1583 value.setUrlFailureCacheConfiguration( urlFailureCacheConfiguration );
1584 FileLockConfiguration fileLockConfiguration = readFileLockConfiguration( prefix + "fileLockConfiguration.", registry );
1585 value.setFileLockConfiguration( fileLockConfiguration );
1586 //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
1588 List<String> dataDirectoryList = registry.getList( prefix + "dataDirectory" );
1589 String dataDirectory = value.getDataDirectory();
1590 if (dataDirectoryList != null && !dataDirectoryList.isEmpty() )
1592 StringBuilder sb = new StringBuilder( );
1593 for (int i = 0,size = dataDirectoryList.size();i<size;i++)
1595 sb.append( dataDirectoryList.get( i ) );
1601 dataDirectory = sb.toString();
1604 value.setDataDirectory( dataDirectory );
1605 //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
1607 List<String> repositoryBaseDirectoryList = registry.getList( prefix + "repositoryBaseDirectory" );
1608 String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
1609 if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty() )
1611 StringBuilder sb = new StringBuilder( );
1612 for (int i = 0,size = repositoryBaseDirectoryList.size();i<size;i++)
1614 sb.append( repositoryBaseDirectoryList.get( i ) );
1620 repositoryBaseDirectory = sb.toString();
1623 value.setRepositoryBaseDirectory( repositoryBaseDirectory );
1624 //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
1626 List<String> remoteRepositoryBaseDirectoryList = registry.getList( prefix + "remoteRepositoryBaseDirectory" );
1627 String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
1628 if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty() )
1630 StringBuilder sb = new StringBuilder( );
1631 for (int i = 0,size = remoteRepositoryBaseDirectoryList.size();i<size;i++)
1633 sb.append( remoteRepositoryBaseDirectoryList.get( i ) );
1639 remoteRepositoryBaseDirectory = sb.toString();
1642 value.setRemoteRepositoryBaseDirectory( remoteRepositoryBaseDirectory );
1643 //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
1645 List<String> defaultLanguageList = registry.getList( prefix + "defaultLanguage" );
1646 String defaultLanguage = value.getDefaultLanguage();
1647 if (defaultLanguageList != null && !defaultLanguageList.isEmpty() )
1649 StringBuilder sb = new StringBuilder( );
1650 for (int i = 0,size = defaultLanguageList.size();i<size;i++)
1652 sb.append( defaultLanguageList.get( i ) );
1658 defaultLanguage = sb.toString();
1661 value.setDefaultLanguage( defaultLanguage );
1662 //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
1664 List<String> languageRangeList = registry.getList( prefix + "languageRange" );
1665 String languageRange = value.getLanguageRange();
1666 if (languageRangeList != null && !languageRangeList.isEmpty() )
1668 StringBuilder sb = new StringBuilder( );
1669 for (int i = 0,size = languageRangeList.size();i<size;i++)
1671 sb.append( languageRangeList.get( i ) );
1677 languageRange = sb.toString();
1680 value.setLanguageRange( languageRange );
1685 private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration( String prefix, Registry registry )
1687 RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
1689 boolean migratedFromRedbackConfiguration = registry.getBoolean( prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration() );
1690 value.setMigratedFromRedbackConfiguration( migratedFromRedbackConfiguration );
1691 java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
1692 userManagerImpls.addAll( registry.getList( prefix + "userManagerImpls.userManagerImpl" ) );
1693 value.setUserManagerImpls( userManagerImpls );
1694 java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
1695 rbacManagerImpls.addAll( registry.getList( prefix + "rbacManagerImpls.rbacManagerImpl" ) );
1696 value.setRbacManagerImpls( rbacManagerImpls );
1697 LdapConfiguration ldapConfiguration = readLdapConfiguration( prefix + "ldapConfiguration.", registry );
1698 value.setLdapConfiguration( ldapConfiguration );
1699 java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
1700 List ldapGroupMappingsSubsets = registry.getSubsetList( prefix + "ldapGroupMappings.ldapGroupMapping" );
1701 for ( Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); )
1703 LdapGroupMapping v = readLdapGroupMapping( "", (Registry) i.next() );
1704 ldapGroupMappings.add( v );
1706 value.setLdapGroupMappings( ldapGroupMappings );
1707 java.util.Map configurationProperties = registry.getProperties( prefix + "configurationProperties" );
1708 value.setConfigurationProperties( configurationProperties );
1709 boolean useUsersCache = registry.getBoolean( prefix + "useUsersCache", value.isUseUsersCache() );
1710 value.setUseUsersCache( useUsersCache );
1711 CacheConfiguration usersCacheConfiguration = readCacheConfiguration( prefix + "usersCacheConfiguration.", registry );
1712 value.setUsersCacheConfiguration( usersCacheConfiguration );
1717 private ArchivaDefaultConfiguration readArchivaDefaultConfiguration( String prefix, Registry registry )
1719 ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
1721 java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
1722 List defaultCheckPathsSubsets = registry.getSubsetList( prefix + "defaultCheckPaths.defaultCheckPath" );
1723 for ( Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); )
1725 RepositoryCheckPath v = readRepositoryCheckPath( "", (Registry) i.next() );
1726 defaultCheckPaths.add( v );
1728 value.setDefaultCheckPaths( defaultCheckPaths );
1733 private LdapConfiguration readLdapConfiguration( String prefix, Registry registry )
1735 LdapConfiguration value = new LdapConfiguration();
1737 //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
1739 List<String> hostNameList = registry.getList( prefix + "hostName" );
1740 String hostName = value.getHostName();
1741 if (hostNameList != null && !hostNameList.isEmpty() )
1743 StringBuilder sb = new StringBuilder( );
1744 for (int i = 0,size = hostNameList.size();i<size;i++)
1746 sb.append( hostNameList.get( i ) );
1752 hostName = sb.toString();
1755 value.setHostName( hostName );
1756 int port = registry.getInt( prefix + "port", value.getPort() );
1757 value.setPort( port );
1758 boolean ssl = registry.getBoolean( prefix + "ssl", value.isSsl() );
1759 value.setSsl( ssl );
1760 //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
1762 List<String> baseDnList = registry.getList( prefix + "baseDn" );
1763 String baseDn = value.getBaseDn();
1764 if (baseDnList != null && !baseDnList.isEmpty() )
1766 StringBuilder sb = new StringBuilder( );
1767 for (int i = 0,size = baseDnList.size();i<size;i++)
1769 sb.append( baseDnList.get( i ) );
1775 baseDn = sb.toString();
1778 value.setBaseDn( baseDn );
1779 //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
1781 List<String> baseGroupsDnList = registry.getList( prefix + "baseGroupsDn" );
1782 String baseGroupsDn = value.getBaseGroupsDn();
1783 if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty() )
1785 StringBuilder sb = new StringBuilder( );
1786 for (int i = 0,size = baseGroupsDnList.size();i<size;i++)
1788 sb.append( baseGroupsDnList.get( i ) );
1794 baseGroupsDn = sb.toString();
1797 value.setBaseGroupsDn( baseGroupsDn );
1798 //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
1800 List<String> contextFactoryList = registry.getList( prefix + "contextFactory" );
1801 String contextFactory = value.getContextFactory();
1802 if (contextFactoryList != null && !contextFactoryList.isEmpty() )
1804 StringBuilder sb = new StringBuilder( );
1805 for (int i = 0,size = contextFactoryList.size();i<size;i++)
1807 sb.append( contextFactoryList.get( i ) );
1813 contextFactory = sb.toString();
1816 value.setContextFactory( contextFactory );
1817 //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
1819 List<String> bindDnList = registry.getList( prefix + "bindDn" );
1820 String bindDn = value.getBindDn();
1821 if (bindDnList != null && !bindDnList.isEmpty() )
1823 StringBuilder sb = new StringBuilder( );
1824 for (int i = 0,size = bindDnList.size();i<size;i++)
1826 sb.append( bindDnList.get( i ) );
1832 bindDn = sb.toString();
1835 value.setBindDn( bindDn );
1836 //String password = registry.getString( prefix + "password", value.getPassword() );
1838 List<String> passwordList = registry.getList( prefix + "password" );
1839 String password = value.getPassword();
1840 if (passwordList != null && !passwordList.isEmpty() )
1842 StringBuilder sb = new StringBuilder( );
1843 for (int i = 0,size = passwordList.size();i<size;i++)
1845 sb.append( passwordList.get( i ) );
1851 password = sb.toString();
1854 value.setPassword( password );
1855 //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
1857 List<String> authenticationMethodList = registry.getList( prefix + "authenticationMethod" );
1858 String authenticationMethod = value.getAuthenticationMethod();
1859 if (authenticationMethodList != null && !authenticationMethodList.isEmpty() )
1861 StringBuilder sb = new StringBuilder( );
1862 for (int i = 0,size = authenticationMethodList.size();i<size;i++)
1864 sb.append( authenticationMethodList.get( i ) );
1870 authenticationMethod = sb.toString();
1873 value.setAuthenticationMethod( authenticationMethod );
1874 boolean bindAuthenticatorEnabled = registry.getBoolean( prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled() );
1875 value.setBindAuthenticatorEnabled( bindAuthenticatorEnabled );
1876 boolean writable = registry.getBoolean( prefix + "writable", value.isWritable() );
1877 value.setWritable( writable );
1878 boolean useRoleNameAsGroup = registry.getBoolean( prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup() );
1879 value.setUseRoleNameAsGroup( useRoleNameAsGroup );
1880 java.util.Map extraProperties = registry.getProperties( prefix + "extraProperties" );
1881 value.setExtraProperties( extraProperties );
1886 private FileLockConfiguration readFileLockConfiguration( String prefix, Registry registry )
1888 FileLockConfiguration value = new FileLockConfiguration();
1890 boolean skipLocking = registry.getBoolean( prefix + "skipLocking", value.isSkipLocking() );
1891 value.setSkipLocking( skipLocking );
1892 int lockingTimeout = registry.getInt( prefix + "lockingTimeout", value.getLockingTimeout() );
1893 value.setLockingTimeout( lockingTimeout );
1898 private CacheConfiguration readCacheConfiguration( String prefix, Registry registry )
1900 CacheConfiguration value = new CacheConfiguration();
1902 int timeToIdleSeconds = registry.getInt( prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds() );
1903 value.setTimeToIdleSeconds( timeToIdleSeconds );
1904 int timeToLiveSeconds = registry.getInt( prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds() );
1905 value.setTimeToLiveSeconds( timeToLiveSeconds );
1906 int maxElementsInMemory = registry.getInt( prefix + "maxElementsInMemory", value.getMaxElementsInMemory() );
1907 value.setMaxElementsInMemory( maxElementsInMemory );
1908 int maxElementsOnDisk = registry.getInt( prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk() );
1909 value.setMaxElementsOnDisk( maxElementsOnDisk );
1914 private LdapGroupMapping readLdapGroupMapping( String prefix, Registry registry )
1916 LdapGroupMapping value = new LdapGroupMapping();
1918 //String group = registry.getString( prefix + "group", value.getGroup() );
1920 List<String> groupList = registry.getList( prefix + "group" );
1921 String group = value.getGroup();
1922 if (groupList != null && !groupList.isEmpty() )
1924 StringBuilder sb = new StringBuilder( );
1925 for (int i = 0,size = groupList.size();i<size;i++)
1927 sb.append( groupList.get( i ) );
1933 group = sb.toString();
1936 value.setGroup( group );
1937 java.util.List roleNames = new java.util.ArrayList/*<String>*/();
1938 roleNames.addAll( registry.getList( prefix + "roleNames.roleName" ) );
1939 value.setRoleNames( roleNames );