]> source.dussan.org Git - archiva.git/blob
d8783453e5471aadd78ce402344109344be2a084
[archiva.git] /
1
2 package org.apache.archiva.configuration.io.registry;
3
4 /*
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
12  *
13  *   http://www.apache.org/licenses/LICENSE-2.0
14  *
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
20  * under the License.
21  */
22
23 import org.apache.archiva.configuration.*;
24 import org.apache.archiva.redback.components.registry.Registry;
25
26 import java.util.Iterator;
27 import java.util.List;
28
29 // Util imports
30 // Model class imports
31
32
33 /**
34  * Generate Redback Registry input mechanism for model 'Configuration'.
35  */
36 public class ConfigurationRegistryReader {
37     public Configuration read(Registry registry) {
38         return readConfiguration("", registry);
39     }
40
41     private Configuration readConfiguration(String prefix, Registry registry) {
42         Configuration value = new Configuration();
43
44         //String version = registry.getString( prefix + "version", value.getVersion() );
45
46         List<String> versionList = registry.getList(prefix + "version");
47         String version = value.getVersion();
48         if (versionList != null && !versionList.isEmpty()) {
49             StringBuilder sb = new StringBuilder();
50             for (int i = 0, size = versionList.size(); i < size; i++) {
51                 sb.append(versionList.get(i));
52                 if (i < size - 1) {
53                     sb.append(',');
54                 }
55             }
56             version = sb.toString();
57         }
58
59         value.setVersion(version);
60         //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() );
61
62         List<String> metadataStoreList = registry.getList(prefix + "metadataStore");
63         String metadataStore = value.getMetadataStore();
64         if (metadataStoreList != null && !metadataStoreList.isEmpty()) {
65             StringBuilder sb = new StringBuilder();
66             for (int i = 0, size = metadataStoreList.size(); i < size; i++) {
67                 sb.append(metadataStoreList.get(i));
68                 if (i < size - 1) {
69                     sb.append(',');
70                 }
71             }
72             metadataStore = sb.toString();
73         }
74
75         value.setMetadataStore(metadataStore);
76         java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
77         List repositoryGroupsSubsets = registry.getSubsetList(prefix + "repositoryGroups.repositoryGroup");
78         for (Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); ) {
79             RepositoryGroupConfiguration v = readRepositoryGroupConfiguration("", (Registry) i.next());
80             repositoryGroups.add(v);
81         }
82         value.setRepositoryGroups(repositoryGroups);
83         java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
84         List managedRepositoriesSubsets = registry.getSubsetList(prefix + "managedRepositories.managedRepository");
85         for (Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); ) {
86             ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration("", (Registry) i.next());
87             managedRepositories.add(v);
88         }
89         value.setManagedRepositories(managedRepositories);
90         java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
91         List remoteRepositoriesSubsets = registry.getSubsetList(prefix + "remoteRepositories.remoteRepository");
92         for (Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); ) {
93             RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration("", (Registry) i.next());
94             remoteRepositories.add(v);
95         }
96         value.setRemoteRepositories(remoteRepositories);
97         java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
98         List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
99         for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
100             ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
101             proxyConnectors.add(v);
102         }
103         value.setProxyConnectors(proxyConnectors);
104         java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
105         List networkProxiesSubsets = registry.getSubsetList(prefix + "networkProxies.networkProxy");
106         for (Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); ) {
107             NetworkProxyConfiguration v = readNetworkProxyConfiguration("", (Registry) i.next());
108             networkProxies.add(v);
109         }
110         value.setNetworkProxies(networkProxies);
111         java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
112         List legacyArtifactPathsSubsets = registry.getSubsetList(prefix + "legacyArtifactPaths.legacyArtifactPath");
113         for (Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); ) {
114             LegacyArtifactPath v = readLegacyArtifactPath("", (Registry) i.next());
115             legacyArtifactPaths.add(v);
116         }
117         value.setLegacyArtifactPaths(legacyArtifactPaths);
118         RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration(prefix + "repositoryScanning.", registry);
119         value.setRepositoryScanning(repositoryScanning);
120         WebappConfiguration webapp = readWebappConfiguration(prefix + "webapp.", registry);
121         value.setWebapp(webapp);
122         OrganisationInformation organisationInfo = readOrganisationInformation(prefix + "organisationInfo.", registry);
123         value.setOrganisationInfo(organisationInfo);
124         NetworkConfiguration networkConfiguration = readNetworkConfiguration(prefix + "networkConfiguration.", registry);
125         value.setNetworkConfiguration(networkConfiguration);
126         RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", registry);
127         value.setRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
128         ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", registry);
129         value.setArchivaRuntimeConfiguration(archivaRuntimeConfiguration);
130         java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
131         List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList(prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration");
132         for (Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); ) {
133             ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration("", (Registry) i.next());
134             proxyConnectorRuleConfigurations.add(v);
135         }
136         value.setProxyConnectorRuleConfigurations(proxyConnectorRuleConfigurations);
137         ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", registry);
138         value.setArchivaDefaultConfiguration(archivaDefaultConfiguration);
139
140         return value;
141     }
142
143     private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration(String prefix, Registry registry) {
144         AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
145
146         //String id = registry.getString( prefix + "id", value.getId() );
147
148         List<String> idList = registry.getList(prefix + "id");
149         String id = value.getId();
150         if (idList != null && !idList.isEmpty()) {
151             StringBuilder sb = new StringBuilder();
152             for (int i = 0, size = idList.size(); i < size; i++) {
153                 sb.append(idList.get(i));
154                 if (i < size - 1) {
155                     sb.append(',');
156                 }
157             }
158             id = sb.toString();
159         }
160
161         value.setId(id);
162         //String type = registry.getString( prefix + "type", value.getType() );
163
164         List<String> typeList = registry.getList(prefix + "type");
165         String type = value.getType();
166         if (typeList != null && !typeList.isEmpty()) {
167             StringBuilder sb = new StringBuilder();
168             for (int i = 0, size = typeList.size(); i < size; i++) {
169                 sb.append(typeList.get(i));
170                 if (i < size - 1) {
171                     sb.append(',');
172                 }
173             }
174             type = sb.toString();
175         }
176
177         value.setType(type);
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             StringBuilder sb = new StringBuilder();
184             for (int i = 0, size = nameList.size(); i < size; i++) {
185                 sb.append(nameList.get(i));
186                 if (i < size - 1) {
187                     sb.append(',');
188                 }
189             }
190             name = sb.toString();
191         }
192
193         value.setName(name);
194         //String layout = registry.getString( prefix + "layout", value.getLayout() );
195
196         List<String> layoutList = registry.getList(prefix + "layout");
197         String layout = value.getLayout();
198         if (layoutList != null && !layoutList.isEmpty()) {
199             StringBuilder sb = new StringBuilder();
200             for (int i = 0, size = layoutList.size(); i < size; i++) {
201                 sb.append(layoutList.get(i));
202                 if (i < size - 1) {
203                     sb.append(',');
204                 }
205             }
206             layout = sb.toString();
207         }
208
209         value.setLayout(layout);
210         //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
211
212         List<String> indexDirList = registry.getList(prefix + "indexDir");
213         String indexDir = value.getIndexDir();
214         if (indexDirList != null && !indexDirList.isEmpty()) {
215             StringBuilder sb = new StringBuilder();
216             for (int i = 0, size = indexDirList.size(); i < size; i++) {
217                 sb.append(indexDirList.get(i));
218                 if (i < size - 1) {
219                     sb.append(',');
220                 }
221             }
222             indexDir = sb.toString();
223         }
224
225         value.setIndexDir(indexDir);
226         //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
227
228         List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
229         String packedIndexDir = value.getPackedIndexDir();
230         if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
231             StringBuilder sb = new StringBuilder();
232             for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
233                 sb.append(packedIndexDirList.get(i));
234                 if (i < size - 1) {
235                     sb.append(',');
236                 }
237             }
238             packedIndexDir = sb.toString();
239         }
240
241         value.setPackedIndexDir(packedIndexDir);
242         //String description = registry.getString( prefix + "description", value.getDescription() );
243
244         List<String> descriptionList = registry.getList(prefix + "description");
245         String description = value.getDescription();
246         if (descriptionList != null && !descriptionList.isEmpty()) {
247             StringBuilder sb = new StringBuilder();
248             for (int i = 0, size = descriptionList.size(); i < size; i++) {
249                 sb.append(descriptionList.get(i));
250                 if (i < size - 1) {
251                     sb.append(',');
252                 }
253             }
254             description = sb.toString();
255         }
256
257         value.setDescription(description);
258
259         return value;
260     }
261
262     private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration(String prefix, Registry registry) {
263         RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
264
265         //String url = registry.getString( prefix + "url", value.getUrl() );
266
267         List<String> urlList = registry.getList(prefix + "url");
268         String url = value.getUrl();
269         if (urlList != null && !urlList.isEmpty()) {
270             StringBuilder sb = new StringBuilder();
271             for (int i = 0, size = urlList.size(); i < size; i++) {
272                 sb.append(urlList.get(i));
273                 if (i < size - 1) {
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             StringBuilder sb = new StringBuilder();
287             for (int i = 0, size = usernameList.size(); i < size; i++) {
288                 sb.append(usernameList.get(i));
289                 if (i < size - 1) {
290                     sb.append(',');
291                 }
292             }
293             username = sb.toString();
294         }
295
296         value.setUsername(username);
297         //String password = registry.getString( prefix + "password", value.getPassword() );
298
299         List<String> passwordList = registry.getList(prefix + "password");
300         String password = value.getPassword();
301         if (passwordList != null && !passwordList.isEmpty()) {
302             StringBuilder sb = new StringBuilder();
303             for (int i = 0, size = passwordList.size(); i < size; i++) {
304                 sb.append(passwordList.get(i));
305                 if (i < size - 1) {
306                     sb.append(',');
307                 }
308             }
309             password = sb.toString();
310         }
311
312         value.setPassword(password);
313         int timeout = registry.getInt(prefix + "timeout", value.getTimeout());
314         value.setTimeout(timeout);
315         //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
316
317         List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
318         String refreshCronExpression = value.getRefreshCronExpression();
319         if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
320             StringBuilder sb = new StringBuilder();
321             for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
322                 sb.append(refreshCronExpressionList.get(i));
323                 if (i < size - 1) {
324                     sb.append(',');
325                 }
326             }
327             refreshCronExpression = sb.toString();
328         }
329
330         value.setRefreshCronExpression(refreshCronExpression);
331         boolean downloadRemoteIndex = registry.getBoolean(prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex());
332         value.setDownloadRemoteIndex(downloadRemoteIndex);
333         //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
334
335         List<String> remoteIndexUrlList = registry.getList(prefix + "remoteIndexUrl");
336         String remoteIndexUrl = value.getRemoteIndexUrl();
337         if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty()) {
338             StringBuilder sb = new StringBuilder();
339             for (int i = 0, size = remoteIndexUrlList.size(); i < size; i++) {
340                 sb.append(remoteIndexUrlList.get(i));
341                 if (i < size - 1) {
342                     sb.append(',');
343                 }
344             }
345             remoteIndexUrl = sb.toString();
346         }
347
348         value.setRemoteIndexUrl(remoteIndexUrl);
349         //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
350
351         List<String> remoteDownloadNetworkProxyIdList = registry.getList(prefix + "remoteDownloadNetworkProxyId");
352         String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
353         if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty()) {
354             StringBuilder sb = new StringBuilder();
355             for (int i = 0, size = remoteDownloadNetworkProxyIdList.size(); i < size; i++) {
356                 sb.append(remoteDownloadNetworkProxyIdList.get(i));
357                 if (i < size - 1) {
358                     sb.append(',');
359                 }
360             }
361             remoteDownloadNetworkProxyId = sb.toString();
362         }
363
364         value.setRemoteDownloadNetworkProxyId(remoteDownloadNetworkProxyId);
365         int remoteDownloadTimeout = registry.getInt(prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout());
366         value.setRemoteDownloadTimeout(remoteDownloadTimeout);
367         boolean downloadRemoteIndexOnStartup = registry.getBoolean(prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup());
368         value.setDownloadRemoteIndexOnStartup(downloadRemoteIndexOnStartup);
369         java.util.Map extraParameters = registry.getProperties(prefix + "extraParameters");
370         value.setExtraParameters(extraParameters);
371         java.util.Map extraHeaders = registry.getProperties(prefix + "extraHeaders");
372         value.setExtraHeaders(extraHeaders);
373         //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
374
375         List<String> checkPathList = registry.getList(prefix + "checkPath");
376         String checkPath = value.getCheckPath();
377         if (checkPathList != null && !checkPathList.isEmpty()) {
378             StringBuilder sb = new StringBuilder();
379             for (int i = 0, size = checkPathList.size(); i < size; i++) {
380                 sb.append(checkPathList.get(i));
381                 if (i < size - 1) {
382                     sb.append(',');
383                 }
384             }
385             checkPath = sb.toString();
386         }
387
388         value.setCheckPath(checkPath);
389         //String id = registry.getString( prefix + "id", value.getId() );
390
391         List<String> idList = registry.getList(prefix + "id");
392         String id = value.getId();
393         if (idList != null && !idList.isEmpty()) {
394             StringBuilder sb = new StringBuilder();
395             for (int i = 0, size = idList.size(); i < size; i++) {
396                 sb.append(idList.get(i));
397                 if (i < size - 1) {
398                     sb.append(',');
399                 }
400             }
401             id = sb.toString();
402         }
403
404         value.setId(id);
405         //String type = registry.getString( prefix + "type", value.getType() );
406
407         List<String> typeList = registry.getList(prefix + "type");
408         String type = value.getType();
409         if (typeList != null && !typeList.isEmpty()) {
410             StringBuilder sb = new StringBuilder();
411             for (int i = 0, size = typeList.size(); i < size; i++) {
412                 sb.append(typeList.get(i));
413                 if (i < size - 1) {
414                     sb.append(',');
415                 }
416             }
417             type = sb.toString();
418         }
419
420         value.setType(type);
421         //String name = registry.getString( prefix + "name", value.getName() );
422
423         List<String> nameList = registry.getList(prefix + "name");
424         String name = value.getName();
425         if (nameList != null && !nameList.isEmpty()) {
426             StringBuilder sb = new StringBuilder();
427             for (int i = 0, size = nameList.size(); i < size; i++) {
428                 sb.append(nameList.get(i));
429                 if (i < size - 1) {
430                     sb.append(',');
431                 }
432             }
433             name = sb.toString();
434         }
435
436         value.setName(name);
437         //String layout = registry.getString( prefix + "layout", value.getLayout() );
438
439         List<String> layoutList = registry.getList(prefix + "layout");
440         String layout = value.getLayout();
441         if (layoutList != null && !layoutList.isEmpty()) {
442             StringBuilder sb = new StringBuilder();
443             for (int i = 0, size = layoutList.size(); i < size; i++) {
444                 sb.append(layoutList.get(i));
445                 if (i < size - 1) {
446                     sb.append(',');
447                 }
448             }
449             layout = sb.toString();
450         }
451
452         value.setLayout(layout);
453         //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
454
455         List<String> indexDirList = registry.getList(prefix + "indexDir");
456         String indexDir = value.getIndexDir();
457         if (indexDirList != null && !indexDirList.isEmpty()) {
458             StringBuilder sb = new StringBuilder();
459             for (int i = 0, size = indexDirList.size(); i < size; i++) {
460                 sb.append(indexDirList.get(i));
461                 if (i < size - 1) {
462                     sb.append(',');
463                 }
464             }
465             indexDir = sb.toString();
466         }
467
468         value.setIndexDir(indexDir);
469         //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
470
471         List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
472         String packedIndexDir = value.getPackedIndexDir();
473         if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
474             StringBuilder sb = new StringBuilder();
475             for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
476                 sb.append(packedIndexDirList.get(i));
477                 if (i < size - 1) {
478                     sb.append(',');
479                 }
480             }
481             packedIndexDir = sb.toString();
482         }
483
484         value.setPackedIndexDir(packedIndexDir);
485         //String description = registry.getString( prefix + "description", value.getDescription() );
486
487         List<String> descriptionList = registry.getList(prefix + "description");
488         String description = value.getDescription();
489         if (descriptionList != null && !descriptionList.isEmpty()) {
490             StringBuilder sb = new StringBuilder();
491             for (int i = 0, size = descriptionList.size(); i < size; i++) {
492                 sb.append(descriptionList.get(i));
493                 if (i < size - 1) {
494                     sb.append(',');
495                 }
496             }
497             description = sb.toString();
498         }
499
500         value.setDescription(description);
501
502         return value;
503     }
504
505     private ManagedRepositoryConfiguration readManagedRepositoryConfiguration(String prefix, Registry registry) {
506         ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
507
508         //String location = registry.getString( prefix + "location", value.getLocation() );
509
510         List<String> locationList = registry.getList(prefix + "location");
511         String location = value.getLocation();
512         if (locationList != null && !locationList.isEmpty()) {
513             StringBuilder sb = new StringBuilder();
514             for (int i = 0, size = locationList.size(); i < size; i++) {
515                 sb.append(locationList.get(i));
516                 if (i < size - 1) {
517                     sb.append(',');
518                 }
519             }
520             location = sb.toString();
521         }
522
523         value.setLocation(location);
524         boolean releases = registry.getBoolean(prefix + "releases", value.isReleases());
525         value.setReleases(releases);
526         boolean blockRedeployments = registry.getBoolean(prefix + "blockRedeployments", value.isBlockRedeployments());
527         value.setBlockRedeployments(blockRedeployments);
528         boolean snapshots = registry.getBoolean(prefix + "snapshots", value.isSnapshots());
529         value.setSnapshots(snapshots);
530         boolean scanned = registry.getBoolean(prefix + "scanned", value.isScanned());
531         value.setScanned(scanned);
532         //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
533
534         List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
535         String refreshCronExpression = value.getRefreshCronExpression();
536         if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
537             StringBuilder sb = new StringBuilder();
538             for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
539                 sb.append(refreshCronExpressionList.get(i));
540                 if (i < size - 1) {
541                     sb.append(',');
542                 }
543             }
544             refreshCronExpression = sb.toString();
545         }
546
547         value.setRefreshCronExpression(refreshCronExpression);
548         int retentionCount = registry.getInt(prefix + "retentionCount", value.getRetentionCount());
549         value.setRetentionCount(retentionCount);
550         int retentionPeriod = registry.getInt(prefix + "retentionPeriod", value.getRetentionPeriod());
551         value.setRetentionPeriod(retentionPeriod);
552         boolean deleteReleasedSnapshots = registry.getBoolean(prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots());
553         value.setDeleteReleasedSnapshots(deleteReleasedSnapshots);
554         boolean skipPackedIndexCreation = registry.getBoolean(prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation());
555         value.setSkipPackedIndexCreation(skipPackedIndexCreation);
556         boolean stageRepoNeeded = registry.getBoolean(prefix + "stageRepoNeeded", value.isStageRepoNeeded());
557         value.setStageRepoNeeded(stageRepoNeeded);
558         //String id = registry.getString( prefix + "id", value.getId() );
559
560         List<String> idList = registry.getList(prefix + "id");
561         String id = value.getId();
562         if (idList != null && !idList.isEmpty()) {
563             StringBuilder sb = new StringBuilder();
564             for (int i = 0, size = idList.size(); i < size; i++) {
565                 sb.append(idList.get(i));
566                 if (i < size - 1) {
567                     sb.append(',');
568                 }
569             }
570             id = sb.toString();
571         }
572
573         value.setId(id);
574         //String type = registry.getString( prefix + "type", value.getType() );
575
576         List<String> typeList = registry.getList(prefix + "type");
577         String type = value.getType();
578         if (typeList != null && !typeList.isEmpty()) {
579             StringBuilder sb = new StringBuilder();
580             for (int i = 0, size = typeList.size(); i < size; i++) {
581                 sb.append(typeList.get(i));
582                 if (i < size - 1) {
583                     sb.append(',');
584                 }
585             }
586             type = sb.toString();
587         }
588
589         value.setType(type);
590         //String name = registry.getString( prefix + "name", value.getName() );
591
592         List<String> nameList = registry.getList(prefix + "name");
593         String name = value.getName();
594         if (nameList != null && !nameList.isEmpty()) {
595             StringBuilder sb = new StringBuilder();
596             for (int i = 0, size = nameList.size(); i < size; i++) {
597                 sb.append(nameList.get(i));
598                 if (i < size - 1) {
599                     sb.append(',');
600                 }
601             }
602             name = sb.toString();
603         }
604
605         value.setName(name);
606         //String layout = registry.getString( prefix + "layout", value.getLayout() );
607
608         List<String> layoutList = registry.getList(prefix + "layout");
609         String layout = value.getLayout();
610         if (layoutList != null && !layoutList.isEmpty()) {
611             StringBuilder sb = new StringBuilder();
612             for (int i = 0, size = layoutList.size(); i < size; i++) {
613                 sb.append(layoutList.get(i));
614                 if (i < size - 1) {
615                     sb.append(',');
616                 }
617             }
618             layout = sb.toString();
619         }
620
621         value.setLayout(layout);
622         //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
623
624         List<String> indexDirList = registry.getList(prefix + "indexDir");
625         String indexDir = value.getIndexDir();
626         if (indexDirList != null && !indexDirList.isEmpty()) {
627             StringBuilder sb = new StringBuilder();
628             for (int i = 0, size = indexDirList.size(); i < size; i++) {
629                 sb.append(indexDirList.get(i));
630                 if (i < size - 1) {
631                     sb.append(',');
632                 }
633             }
634             indexDir = sb.toString();
635         }
636
637         value.setIndexDir(indexDir);
638         //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
639
640         List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
641         String packedIndexDir = value.getPackedIndexDir();
642         if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
643             StringBuilder sb = new StringBuilder();
644             for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
645                 sb.append(packedIndexDirList.get(i));
646                 if (i < size - 1) {
647                     sb.append(',');
648                 }
649             }
650             packedIndexDir = sb.toString();
651         }
652
653         value.setPackedIndexDir(packedIndexDir);
654         //String description = registry.getString( prefix + "description", value.getDescription() );
655
656         List<String> descriptionList = registry.getList(prefix + "description");
657         String description = value.getDescription();
658         if (descriptionList != null && !descriptionList.isEmpty()) {
659             StringBuilder sb = new StringBuilder();
660             for (int i = 0, size = descriptionList.size(); i < size; i++) {
661                 sb.append(descriptionList.get(i));
662                 if (i < size - 1) {
663                     sb.append(',');
664                 }
665             }
666             description = sb.toString();
667         }
668
669         value.setDescription(description);
670
671         return value;
672     }
673
674     private LegacyArtifactPath readLegacyArtifactPath(String prefix, Registry registry) {
675         LegacyArtifactPath value = new LegacyArtifactPath();
676
677         //String path = registry.getString( prefix + "path", value.getPath() );
678
679         List<String> pathList = registry.getList(prefix + "path");
680         String path = value.getPath();
681         if (pathList != null && !pathList.isEmpty()) {
682             StringBuilder sb = new StringBuilder();
683             for (int i = 0, size = pathList.size(); i < size; i++) {
684                 sb.append(pathList.get(i));
685                 if (i < size - 1) {
686                     sb.append(',');
687                 }
688             }
689             path = sb.toString();
690         }
691
692         value.setPath(path);
693         //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
694
695         List<String> artifactList = registry.getList(prefix + "artifact");
696         String artifact = value.getArtifact();
697         if (artifactList != null && !artifactList.isEmpty()) {
698             StringBuilder sb = new StringBuilder();
699             for (int i = 0, size = artifactList.size(); i < size; i++) {
700                 sb.append(artifactList.get(i));
701                 if (i < size - 1) {
702                     sb.append(',');
703                 }
704             }
705             artifact = sb.toString();
706         }
707
708         value.setArtifact(artifact);
709
710         return value;
711     }
712
713     private RepositoryGroupConfiguration readRepositoryGroupConfiguration(String prefix, Registry registry) {
714         RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
715
716         //String id = registry.getString( prefix + "id", value.getId() );
717
718         List<String> idList = registry.getList(prefix + "id");
719         String id = value.getId();
720         if (idList != null && !idList.isEmpty()) {
721             StringBuilder sb = new StringBuilder();
722             for (int i = 0, size = idList.size(); i < size; i++) {
723                 sb.append(idList.get(i));
724                 if (i < size - 1) {
725                     sb.append(',');
726                 }
727             }
728             id = sb.toString();
729         }
730
731         value.setId(id);
732         //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
733
734         List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
735         String mergedIndexPath = value.getMergedIndexPath();
736         if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty()) {
737             StringBuilder sb = new StringBuilder();
738             for (int i = 0, size = mergedIndexPathList.size(); i < size; i++) {
739                 sb.append(mergedIndexPathList.get(i));
740                 if (i < size - 1) {
741                     sb.append(',');
742                 }
743             }
744             mergedIndexPath = sb.toString();
745         }
746
747         value.setMergedIndexPath(mergedIndexPath);
748         int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl());
749         value.setMergedIndexTtl(mergedIndexTtl);
750         //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
751
752         List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
753         String cronExpression = value.getCronExpression();
754         if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
755             StringBuilder sb = new StringBuilder();
756             for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
757                 sb.append(cronExpressionList.get(i));
758                 if (i < size - 1) {
759                     sb.append(',');
760                 }
761             }
762             cronExpression = sb.toString();
763         }
764
765         value.setCronExpression(cronExpression);
766         java.util.List repositories = new java.util.ArrayList/*<String>*/();
767         repositories.addAll(registry.getList(prefix + "repositories.repository"));
768         value.setRepositories(repositories);
769
770         return value;
771     }
772
773     private RepositoryCheckPath readRepositoryCheckPath(String prefix, Registry registry) {
774         RepositoryCheckPath value = new RepositoryCheckPath();
775
776         //String url = registry.getString( prefix + "url", value.getUrl() );
777
778         List<String> urlList = registry.getList(prefix + "url");
779         String url = value.getUrl();
780         if (urlList != null && !urlList.isEmpty()) {
781             StringBuilder sb = new StringBuilder();
782             for (int i = 0, size = urlList.size(); i < size; i++) {
783                 sb.append(urlList.get(i));
784                 if (i < size - 1) {
785                     sb.append(',');
786                 }
787             }
788             url = sb.toString();
789         }
790
791         value.setUrl(url);
792         //String path = registry.getString( prefix + "path", value.getPath() );
793
794         List<String> pathList = registry.getList(prefix + "path");
795         String path = value.getPath();
796         if (pathList != null && !pathList.isEmpty()) {
797             StringBuilder sb = new StringBuilder();
798             for (int i = 0, size = pathList.size(); i < size; i++) {
799                 sb.append(pathList.get(i));
800                 if (i < size - 1) {
801                     sb.append(',');
802                 }
803             }
804             path = sb.toString();
805         }
806
807         value.setPath(path);
808
809         return value;
810     }
811
812     private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration(String prefix, Registry registry) {
813         AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
814
815         //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
816
817         List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
818         String sourceRepoId = value.getSourceRepoId();
819         if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
820             StringBuilder sb = new StringBuilder();
821             for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
822                 sb.append(sourceRepoIdList.get(i));
823                 if (i < size - 1) {
824                     sb.append(',');
825                 }
826             }
827             sourceRepoId = sb.toString();
828         }
829
830         value.setSourceRepoId(sourceRepoId);
831         //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
832
833         List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
834         String targetRepoId = value.getTargetRepoId();
835         if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
836             StringBuilder sb = new StringBuilder();
837             for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
838                 sb.append(targetRepoIdList.get(i));
839                 if (i < size - 1) {
840                     sb.append(',');
841                 }
842             }
843             targetRepoId = sb.toString();
844         }
845
846         value.setTargetRepoId(targetRepoId);
847         //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
848
849         List<String> proxyIdList = registry.getList(prefix + "proxyId");
850         String proxyId = value.getProxyId();
851         if (proxyIdList != null && !proxyIdList.isEmpty()) {
852             StringBuilder sb = new StringBuilder();
853             for (int i = 0, size = proxyIdList.size(); i < size; i++) {
854                 sb.append(proxyIdList.get(i));
855                 if (i < size - 1) {
856                     sb.append(',');
857                 }
858             }
859             proxyId = sb.toString();
860         }
861
862         value.setProxyId(proxyId);
863         java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
864         blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
865         value.setBlackListPatterns(blackListPatterns);
866         java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
867         whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
868         value.setWhiteListPatterns(whiteListPatterns);
869         java.util.Map policies = registry.getProperties(prefix + "policies");
870         value.setPolicies(policies);
871         java.util.Map properties = registry.getProperties(prefix + "properties");
872         value.setProperties(properties);
873         boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
874         value.setDisabled(disabled);
875
876         return value;
877     }
878
879     private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) {
880         ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
881
882         //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
883
884         List<String> ruleTypeList = registry.getList(prefix + "ruleType");
885         String ruleType = value.getRuleType();
886         if (ruleTypeList != null && !ruleTypeList.isEmpty()) {
887             StringBuilder sb = new StringBuilder();
888             for (int i = 0, size = ruleTypeList.size(); i < size; i++) {
889                 sb.append(ruleTypeList.get(i));
890                 if (i < size - 1) {
891                     sb.append(',');
892                 }
893             }
894             ruleType = sb.toString();
895         }
896
897         value.setRuleType(ruleType);
898         //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
899
900         List<String> patternList = registry.getList(prefix + "pattern");
901         String pattern = value.getPattern();
902         if (patternList != null && !patternList.isEmpty()) {
903             StringBuilder sb = new StringBuilder();
904             for (int i = 0, size = patternList.size(); i < size; i++) {
905                 sb.append(patternList.get(i));
906                 if (i < size - 1) {
907                     sb.append(',');
908                 }
909             }
910             pattern = sb.toString();
911         }
912
913         value.setPattern(pattern);
914         java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
915         List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
916         for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
917             ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
918             proxyConnectors.add(v);
919         }
920         value.setProxyConnectors(proxyConnectors);
921
922         return value;
923     }
924
925     private ProxyConnectorConfiguration readProxyConnectorConfiguration(String prefix, Registry registry) {
926         ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
927
928         int order = registry.getInt(prefix + "order", value.getOrder());
929         value.setOrder(order);
930         //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
931
932         List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
933         String sourceRepoId = value.getSourceRepoId();
934         if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
935             StringBuilder sb = new StringBuilder();
936             for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
937                 sb.append(sourceRepoIdList.get(i));
938                 if (i < size - 1) {
939                     sb.append(',');
940                 }
941             }
942             sourceRepoId = sb.toString();
943         }
944
945         value.setSourceRepoId(sourceRepoId);
946         //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
947
948         List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
949         String targetRepoId = value.getTargetRepoId();
950         if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
951             StringBuilder sb = new StringBuilder();
952             for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
953                 sb.append(targetRepoIdList.get(i));
954                 if (i < size - 1) {
955                     sb.append(',');
956                 }
957             }
958             targetRepoId = sb.toString();
959         }
960
961         value.setTargetRepoId(targetRepoId);
962         //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
963
964         List<String> proxyIdList = registry.getList(prefix + "proxyId");
965         String proxyId = value.getProxyId();
966         if (proxyIdList != null && !proxyIdList.isEmpty()) {
967             StringBuilder sb = new StringBuilder();
968             for (int i = 0, size = proxyIdList.size(); i < size; i++) {
969                 sb.append(proxyIdList.get(i));
970                 if (i < size - 1) {
971                     sb.append(',');
972                 }
973             }
974             proxyId = sb.toString();
975         }
976
977         value.setProxyId(proxyId);
978         java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
979         blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
980         value.setBlackListPatterns(blackListPatterns);
981         java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
982         whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
983         value.setWhiteListPatterns(whiteListPatterns);
984         java.util.Map policies = registry.getProperties(prefix + "policies");
985         value.setPolicies(policies);
986         java.util.Map properties = registry.getProperties(prefix + "properties");
987         value.setProperties(properties);
988         boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
989         value.setDisabled(disabled);
990
991         return value;
992     }
993
994     private SyncConnectorConfiguration readSyncConnectorConfiguration(String prefix, Registry registry) {
995         SyncConnectorConfiguration value = new SyncConnectorConfiguration();
996
997         //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
998
999         List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
1000         String cronExpression = value.getCronExpression();
1001         if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
1002             StringBuilder sb = new StringBuilder();
1003             for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
1004                 sb.append(cronExpressionList.get(i));
1005                 if (i < size - 1) {
1006                     sb.append(',');
1007                 }
1008             }
1009             cronExpression = sb.toString();
1010         }
1011
1012         value.setCronExpression(cronExpression);
1013         //String method = registry.getString( prefix + "method", value.getMethod() );
1014
1015         List<String> methodList = registry.getList(prefix + "method");
1016         String method = value.getMethod();
1017         if (methodList != null && !methodList.isEmpty()) {
1018             StringBuilder sb = new StringBuilder();
1019             for (int i = 0, size = methodList.size(); i < size; i++) {
1020                 sb.append(methodList.get(i));
1021                 if (i < size - 1) {
1022                     sb.append(',');
1023                 }
1024             }
1025             method = sb.toString();
1026         }
1027
1028         value.setMethod(method);
1029         //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1030
1031         List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
1032         String sourceRepoId = value.getSourceRepoId();
1033         if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
1034             StringBuilder sb = new StringBuilder();
1035             for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
1036                 sb.append(sourceRepoIdList.get(i));
1037                 if (i < size - 1) {
1038                     sb.append(',');
1039                 }
1040             }
1041             sourceRepoId = sb.toString();
1042         }
1043
1044         value.setSourceRepoId(sourceRepoId);
1045         //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1046
1047         List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
1048         String targetRepoId = value.getTargetRepoId();
1049         if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
1050             StringBuilder sb = new StringBuilder();
1051             for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
1052                 sb.append(targetRepoIdList.get(i));
1053                 if (i < size - 1) {
1054                     sb.append(',');
1055                 }
1056             }
1057             targetRepoId = sb.toString();
1058         }
1059
1060         value.setTargetRepoId(targetRepoId);
1061         //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1062
1063         List<String> proxyIdList = registry.getList(prefix + "proxyId");
1064         String proxyId = value.getProxyId();
1065         if (proxyIdList != null && !proxyIdList.isEmpty()) {
1066             StringBuilder sb = new StringBuilder();
1067             for (int i = 0, size = proxyIdList.size(); i < size; i++) {
1068                 sb.append(proxyIdList.get(i));
1069                 if (i < size - 1) {
1070                     sb.append(',');
1071                 }
1072             }
1073             proxyId = sb.toString();
1074         }
1075
1076         value.setProxyId(proxyId);
1077         java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1078         blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
1079         value.setBlackListPatterns(blackListPatterns);
1080         java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1081         whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
1082         value.setWhiteListPatterns(whiteListPatterns);
1083         java.util.Map policies = registry.getProperties(prefix + "policies");
1084         value.setPolicies(policies);
1085         java.util.Map properties = registry.getProperties(prefix + "properties");
1086         value.setProperties(properties);
1087         boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
1088         value.setDisabled(disabled);
1089
1090         return value;
1091     }
1092
1093     private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) {
1094         NetworkProxyConfiguration value = new NetworkProxyConfiguration();
1095
1096         //String id = registry.getString( prefix + "id", value.getId() );
1097
1098         List<String> idList = registry.getList(prefix + "id");
1099         String id = value.getId();
1100         if (idList != null && !idList.isEmpty()) {
1101             StringBuilder sb = new StringBuilder();
1102             for (int i = 0, size = idList.size(); i < size; i++) {
1103                 sb.append(idList.get(i));
1104                 if (i < size - 1) {
1105                     sb.append(',');
1106                 }
1107             }
1108             id = sb.toString();
1109         }
1110
1111         value.setId(id);
1112         //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
1113
1114         List<String> protocolList = registry.getList(prefix + "protocol");
1115         String protocol = value.getProtocol();
1116         if (protocolList != null && !protocolList.isEmpty()) {
1117             StringBuilder sb = new StringBuilder();
1118             for (int i = 0, size = protocolList.size(); i < size; i++) {
1119                 sb.append(protocolList.get(i));
1120                 if (i < size - 1) {
1121                     sb.append(',');
1122                 }
1123             }
1124             protocol = sb.toString();
1125         }
1126
1127         value.setProtocol(protocol);
1128         //String host = registry.getString( prefix + "host", value.getHost() );
1129
1130         List<String> hostList = registry.getList(prefix + "host");
1131         String host = value.getHost();
1132         if (hostList != null && !hostList.isEmpty()) {
1133             StringBuilder sb = new StringBuilder();
1134             for (int i = 0, size = hostList.size(); i < size; i++) {
1135                 sb.append(hostList.get(i));
1136                 if (i < size - 1) {
1137                     sb.append(',');
1138                 }
1139             }
1140             host = sb.toString();
1141         }
1142
1143         value.setHost(host);
1144         int port = registry.getInt(prefix + "port", value.getPort());
1145         value.setPort(port);
1146         //String username = registry.getString( prefix + "username", value.getUsername() );
1147
1148         List<String> usernameList = registry.getList(prefix + "username");
1149         String username = value.getUsername();
1150         if (usernameList != null && !usernameList.isEmpty()) {
1151             StringBuilder sb = new StringBuilder();
1152             for (int i = 0, size = usernameList.size(); i < size; i++) {
1153                 sb.append(usernameList.get(i));
1154                 if (i < size - 1) {
1155                     sb.append(',');
1156                 }
1157             }
1158             username = sb.toString();
1159         }
1160
1161         value.setUsername(username);
1162         //String password = registry.getString( prefix + "password", value.getPassword() );
1163
1164         List<String> passwordList = registry.getList(prefix + "password");
1165         String password = value.getPassword();
1166         if (passwordList != null && !passwordList.isEmpty()) {
1167             StringBuilder sb = new StringBuilder();
1168             for (int i = 0, size = passwordList.size(); i < size; i++) {
1169                 sb.append(passwordList.get(i));
1170                 if (i < size - 1) {
1171                     sb.append(',');
1172                 }
1173             }
1174             password = sb.toString();
1175         }
1176
1177         value.setPassword(password);
1178         boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm());
1179         value.setUseNtlm(useNtlm);
1180
1181         return value;
1182     }
1183
1184     private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) {
1185         RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
1186
1187         java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
1188         List fileTypesSubsets = registry.getSubsetList(prefix + "fileTypes.fileType");
1189         for (Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) {
1190             FileType v = readFileType("", (Registry) i.next());
1191             fileTypes.add(v);
1192         }
1193         value.setFileTypes(fileTypes);
1194         java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
1195         knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer"));
1196         value.setKnownContentConsumers(knownContentConsumers);
1197         java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
1198         invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer"));
1199         value.setInvalidContentConsumers(invalidContentConsumers);
1200
1201         return value;
1202     }
1203
1204     private FileType readFileType(String prefix, Registry registry) {
1205         FileType value = new FileType();
1206
1207         //String id = registry.getString( prefix + "id", value.getId() );
1208
1209         List<String> idList = registry.getList(prefix + "id");
1210         String id = value.getId();
1211         if (idList != null && !idList.isEmpty()) {
1212             StringBuilder sb = new StringBuilder();
1213             for (int i = 0, size = idList.size(); i < size; i++) {
1214                 sb.append(idList.get(i));
1215                 if (i < size - 1) {
1216                     sb.append(',');
1217                 }
1218             }
1219             id = sb.toString();
1220         }
1221
1222         value.setId(id);
1223         java.util.List patterns = new java.util.ArrayList/*<String>*/();
1224         patterns.addAll(registry.getList(prefix + "patterns.pattern"));
1225         value.setPatterns(patterns);
1226
1227         return value;
1228     }
1229
1230     private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) {
1231         OrganisationInformation value = new OrganisationInformation();
1232
1233         //String name = registry.getString( prefix + "name", value.getName() );
1234
1235         List<String> nameList = registry.getList(prefix + "name");
1236         String name = value.getName();
1237         if (nameList != null && !nameList.isEmpty()) {
1238             StringBuilder sb = new StringBuilder();
1239             for (int i = 0, size = nameList.size(); i < size; i++) {
1240                 sb.append(nameList.get(i));
1241                 if (i < size - 1) {
1242                     sb.append(',');
1243                 }
1244             }
1245             name = sb.toString();
1246         }
1247
1248         value.setName(name);
1249         //String url = registry.getString( prefix + "url", value.getUrl() );
1250
1251         List<String> urlList = registry.getList(prefix + "url");
1252         String url = value.getUrl();
1253         if (urlList != null && !urlList.isEmpty()) {
1254             StringBuilder sb = new StringBuilder();
1255             for (int i = 0, size = urlList.size(); i < size; i++) {
1256                 sb.append(urlList.get(i));
1257                 if (i < size - 1) {
1258                     sb.append(',');
1259                 }
1260             }
1261             url = sb.toString();
1262         }
1263
1264         value.setUrl(url);
1265         //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
1266
1267         List<String> logoLocationList = registry.getList(prefix + "logoLocation");
1268         String logoLocation = value.getLogoLocation();
1269         if (logoLocationList != null && !logoLocationList.isEmpty()) {
1270             StringBuilder sb = new StringBuilder();
1271             for (int i = 0, size = logoLocationList.size(); i < size; i++) {
1272                 sb.append(logoLocationList.get(i));
1273                 if (i < size - 1) {
1274                     sb.append(',');
1275                 }
1276             }
1277             logoLocation = sb.toString();
1278         }
1279
1280         value.setLogoLocation(logoLocation);
1281
1282         return value;
1283     }
1284
1285     private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
1286         WebappConfiguration value = new WebappConfiguration();
1287
1288         UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
1289         value.setUi(ui);
1290
1291         return value;
1292     }
1293
1294     private UserInterfaceOptions readUserInterfaceOptions(String prefix, Registry registry) {
1295         UserInterfaceOptions value = new UserInterfaceOptions();
1296
1297         boolean showFindArtifacts = registry.getBoolean(prefix + "showFindArtifacts", value.isShowFindArtifacts());
1298         value.setShowFindArtifacts(showFindArtifacts);
1299         boolean appletFindEnabled = registry.getBoolean(prefix + "appletFindEnabled", value.isAppletFindEnabled());
1300         value.setAppletFindEnabled(appletFindEnabled);
1301         boolean disableEasterEggs = registry.getBoolean(prefix + "disableEasterEggs", value.isDisableEasterEggs());
1302         value.setDisableEasterEggs(disableEasterEggs);
1303         //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
1304
1305         List<String> applicationUrlList = registry.getList(prefix + "applicationUrl");
1306         String applicationUrl = value.getApplicationUrl();
1307         if (applicationUrlList != null && !applicationUrlList.isEmpty()) {
1308             StringBuilder sb = new StringBuilder();
1309             for (int i = 0, size = applicationUrlList.size(); i < size; i++) {
1310                 sb.append(applicationUrlList.get(i));
1311                 if (i < size - 1) {
1312                     sb.append(',');
1313                 }
1314             }
1315             applicationUrl = sb.toString();
1316         }
1317
1318         value.setApplicationUrl(applicationUrl);
1319         boolean disableRegistration = registry.getBoolean(prefix + "disableRegistration", value.isDisableRegistration());
1320         value.setDisableRegistration(disableRegistration);
1321
1322         return value;
1323     }
1324
1325     private NetworkConfiguration readNetworkConfiguration(String prefix, Registry registry) {
1326         NetworkConfiguration value = new NetworkConfiguration();
1327
1328         int maxTotal = registry.getInt(prefix + "maxTotal", value.getMaxTotal());
1329         value.setMaxTotal(maxTotal);
1330         int maxTotalPerHost = registry.getInt(prefix + "maxTotalPerHost", value.getMaxTotalPerHost());
1331         value.setMaxTotalPerHost(maxTotalPerHost);
1332         boolean usePooling = registry.getBoolean(prefix + "usePooling", value.isUsePooling());
1333         value.setUsePooling(usePooling);
1334
1335         return value;
1336     }
1337
1338     private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration(String prefix, Registry registry) {
1339         ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
1340
1341         CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration(prefix + "urlFailureCacheConfiguration.", registry);
1342         value.setUrlFailureCacheConfiguration(urlFailureCacheConfiguration);
1343         FileLockConfiguration fileLockConfiguration = readFileLockConfiguration(prefix + "fileLockConfiguration.", registry);
1344         value.setFileLockConfiguration(fileLockConfiguration);
1345         //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
1346
1347         List<String> dataDirectoryList = registry.getList(prefix + "dataDirectory");
1348         String dataDirectory = value.getDataDirectory();
1349         if (dataDirectoryList != null && !dataDirectoryList.isEmpty()) {
1350             StringBuilder sb = new StringBuilder();
1351             for (int i = 0, size = dataDirectoryList.size(); i < size; i++) {
1352                 sb.append(dataDirectoryList.get(i));
1353                 if (i < size - 1) {
1354                     sb.append(',');
1355                 }
1356             }
1357             dataDirectory = sb.toString();
1358         }
1359
1360         value.setDataDirectory(dataDirectory);
1361         //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
1362
1363         List<String> repositoryBaseDirectoryList = registry.getList(prefix + "repositoryBaseDirectory");
1364         String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
1365         if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty()) {
1366             StringBuilder sb = new StringBuilder();
1367             for (int i = 0, size = repositoryBaseDirectoryList.size(); i < size; i++) {
1368                 sb.append(repositoryBaseDirectoryList.get(i));
1369                 if (i < size - 1) {
1370                     sb.append(',');
1371                 }
1372             }
1373             repositoryBaseDirectory = sb.toString();
1374         }
1375
1376         value.setRepositoryBaseDirectory(repositoryBaseDirectory);
1377         //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
1378
1379         List<String> remoteRepositoryBaseDirectoryList = registry.getList(prefix + "remoteRepositoryBaseDirectory");
1380         String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
1381         if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty()) {
1382             StringBuilder sb = new StringBuilder();
1383             for (int i = 0, size = remoteRepositoryBaseDirectoryList.size(); i < size; i++) {
1384                 sb.append(remoteRepositoryBaseDirectoryList.get(i));
1385                 if (i < size - 1) {
1386                     sb.append(',');
1387                 }
1388             }
1389             remoteRepositoryBaseDirectory = sb.toString();
1390         }
1391
1392         value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
1393         //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
1394
1395         List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
1396         String defaultLanguage = value.getDefaultLanguage();
1397         if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
1398             StringBuilder sb = new StringBuilder();
1399             for (int i = 0, size = defaultLanguageList.size(); i < size; i++) {
1400                 sb.append(defaultLanguageList.get(i));
1401                 if (i < size - 1) {
1402                     sb.append(',');
1403                 }
1404             }
1405             defaultLanguage = sb.toString();
1406         }
1407
1408         value.setDefaultLanguage(defaultLanguage);
1409         //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
1410
1411         List<String> languageRangeList = registry.getList(prefix + "languageRange");
1412         String languageRange = value.getLanguageRange();
1413         if (languageRangeList != null && !languageRangeList.isEmpty()) {
1414             StringBuilder sb = new StringBuilder();
1415             for (int i = 0, size = languageRangeList.size(); i < size; i++) {
1416                 sb.append(languageRangeList.get(i));
1417                 if (i < size - 1) {
1418                     sb.append(',');
1419                 }
1420             }
1421             languageRange = sb.toString();
1422         }
1423
1424         value.setLanguageRange(languageRange);
1425
1426         List<String> checksumTypeList = registry.getList(prefix + "checksumTypes.type");
1427         value.setChecksumTypes(checksumTypeList);
1428
1429         return value;
1430     }
1431
1432     private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) {
1433         RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
1434
1435         boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration());
1436         value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration);
1437         java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
1438         userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl"));
1439         value.setUserManagerImpls(userManagerImpls);
1440         java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
1441         rbacManagerImpls.addAll(registry.getList(prefix + "rbacManagerImpls.rbacManagerImpl"));
1442         value.setRbacManagerImpls(rbacManagerImpls);
1443         LdapConfiguration ldapConfiguration = readLdapConfiguration(prefix + "ldapConfiguration.", registry);
1444         value.setLdapConfiguration(ldapConfiguration);
1445         java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
1446         List ldapGroupMappingsSubsets = registry.getSubsetList(prefix + "ldapGroupMappings.ldapGroupMapping");
1447         for (Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); ) {
1448             LdapGroupMapping v = readLdapGroupMapping("", (Registry) i.next());
1449             ldapGroupMappings.add(v);
1450         }
1451         value.setLdapGroupMappings(ldapGroupMappings);
1452         java.util.Map configurationProperties = registry.getProperties(prefix + "configurationProperties");
1453         value.setConfigurationProperties(configurationProperties);
1454         boolean useUsersCache = registry.getBoolean(prefix + "useUsersCache", value.isUseUsersCache());
1455         value.setUseUsersCache(useUsersCache);
1456         CacheConfiguration usersCacheConfiguration = readCacheConfiguration(prefix + "usersCacheConfiguration.", registry);
1457         value.setUsersCacheConfiguration(usersCacheConfiguration);
1458
1459         return value;
1460     }
1461
1462     private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) {
1463         ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
1464
1465         java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
1466         List defaultCheckPathsSubsets = registry.getSubsetList(prefix + "defaultCheckPaths.defaultCheckPath");
1467         for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
1468             RepositoryCheckPath v = readRepositoryCheckPath("", (Registry) i.next());
1469             defaultCheckPaths.add(v);
1470         }
1471         value.setDefaultCheckPaths(defaultCheckPaths);
1472
1473         return value;
1474     }
1475
1476     private LdapConfiguration readLdapConfiguration(String prefix, Registry registry) {
1477         LdapConfiguration value = new LdapConfiguration();
1478
1479         //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
1480
1481         List<String> hostNameList = registry.getList(prefix + "hostName");
1482         String hostName = value.getHostName();
1483         if (hostNameList != null && !hostNameList.isEmpty()) {
1484             StringBuilder sb = new StringBuilder();
1485             for (int i = 0, size = hostNameList.size(); i < size; i++) {
1486                 sb.append(hostNameList.get(i));
1487                 if (i < size - 1) {
1488                     sb.append(',');
1489                 }
1490             }
1491             hostName = sb.toString();
1492         }
1493
1494         value.setHostName(hostName);
1495         int port = registry.getInt(prefix + "port", value.getPort());
1496         value.setPort(port);
1497         boolean ssl = registry.getBoolean(prefix + "ssl", value.isSsl());
1498         value.setSsl(ssl);
1499         //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
1500
1501         List<String> baseDnList = registry.getList(prefix + "baseDn");
1502         String baseDn = value.getBaseDn();
1503         if (baseDnList != null && !baseDnList.isEmpty()) {
1504             StringBuilder sb = new StringBuilder();
1505             for (int i = 0, size = baseDnList.size(); i < size; i++) {
1506                 sb.append(baseDnList.get(i));
1507                 if (i < size - 1) {
1508                     sb.append(',');
1509                 }
1510             }
1511             baseDn = sb.toString();
1512         }
1513
1514         value.setBaseDn(baseDn);
1515         //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
1516
1517         List<String> baseGroupsDnList = registry.getList(prefix + "baseGroupsDn");
1518         String baseGroupsDn = value.getBaseGroupsDn();
1519         if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty()) {
1520             StringBuilder sb = new StringBuilder();
1521             for (int i = 0, size = baseGroupsDnList.size(); i < size; i++) {
1522                 sb.append(baseGroupsDnList.get(i));
1523                 if (i < size - 1) {
1524                     sb.append(',');
1525                 }
1526             }
1527             baseGroupsDn = sb.toString();
1528         }
1529
1530         value.setBaseGroupsDn(baseGroupsDn);
1531         //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
1532
1533         List<String> contextFactoryList = registry.getList(prefix + "contextFactory");
1534         String contextFactory = value.getContextFactory();
1535         if (contextFactoryList != null && !contextFactoryList.isEmpty()) {
1536             StringBuilder sb = new StringBuilder();
1537             for (int i = 0, size = contextFactoryList.size(); i < size; i++) {
1538                 sb.append(contextFactoryList.get(i));
1539                 if (i < size - 1) {
1540                     sb.append(',');
1541                 }
1542             }
1543             contextFactory = sb.toString();
1544         }
1545
1546         value.setContextFactory(contextFactory);
1547         //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
1548
1549         List<String> bindDnList = registry.getList(prefix + "bindDn");
1550         String bindDn = value.getBindDn();
1551         if (bindDnList != null && !bindDnList.isEmpty()) {
1552             StringBuilder sb = new StringBuilder();
1553             for (int i = 0, size = bindDnList.size(); i < size; i++) {
1554                 sb.append(bindDnList.get(i));
1555                 if (i < size - 1) {
1556                     sb.append(',');
1557                 }
1558             }
1559             bindDn = sb.toString();
1560         }
1561
1562         value.setBindDn(bindDn);
1563         //String password = registry.getString( prefix + "password", value.getPassword() );
1564
1565         List<String> passwordList = registry.getList(prefix + "password");
1566         String password = value.getPassword();
1567         if (passwordList != null && !passwordList.isEmpty()) {
1568             StringBuilder sb = new StringBuilder();
1569             for (int i = 0, size = passwordList.size(); i < size; i++) {
1570                 sb.append(passwordList.get(i));
1571                 if (i < size - 1) {
1572                     sb.append(',');
1573                 }
1574             }
1575             password = sb.toString();
1576         }
1577
1578         value.setPassword(password);
1579         //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
1580
1581         List<String> authenticationMethodList = registry.getList(prefix + "authenticationMethod");
1582         String authenticationMethod = value.getAuthenticationMethod();
1583         if (authenticationMethodList != null && !authenticationMethodList.isEmpty()) {
1584             StringBuilder sb = new StringBuilder();
1585             for (int i = 0, size = authenticationMethodList.size(); i < size; i++) {
1586                 sb.append(authenticationMethodList.get(i));
1587                 if (i < size - 1) {
1588                     sb.append(',');
1589                 }
1590             }
1591             authenticationMethod = sb.toString();
1592         }
1593
1594         value.setAuthenticationMethod(authenticationMethod);
1595         boolean bindAuthenticatorEnabled = registry.getBoolean(prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled());
1596         value.setBindAuthenticatorEnabled(bindAuthenticatorEnabled);
1597         boolean writable = registry.getBoolean(prefix + "writable", value.isWritable());
1598         value.setWritable(writable);
1599         boolean useRoleNameAsGroup = registry.getBoolean(prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup());
1600         value.setUseRoleNameAsGroup(useRoleNameAsGroup);
1601         java.util.Map extraProperties = registry.getProperties(prefix + "extraProperties");
1602         value.setExtraProperties(extraProperties);
1603
1604         return value;
1605     }
1606
1607     private FileLockConfiguration readFileLockConfiguration(String prefix, Registry registry) {
1608         FileLockConfiguration value = new FileLockConfiguration();
1609
1610         boolean skipLocking = registry.getBoolean(prefix + "skipLocking", value.isSkipLocking());
1611         value.setSkipLocking(skipLocking);
1612         int lockingTimeout = registry.getInt(prefix + "lockingTimeout", value.getLockingTimeout());
1613         value.setLockingTimeout(lockingTimeout);
1614
1615         return value;
1616     }
1617
1618     private CacheConfiguration readCacheConfiguration(String prefix, Registry registry) {
1619         CacheConfiguration value = new CacheConfiguration();
1620
1621         int timeToIdleSeconds = registry.getInt(prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds());
1622         value.setTimeToIdleSeconds(timeToIdleSeconds);
1623         int timeToLiveSeconds = registry.getInt(prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds());
1624         value.setTimeToLiveSeconds(timeToLiveSeconds);
1625         int maxElementsInMemory = registry.getInt(prefix + "maxElementsInMemory", value.getMaxElementsInMemory());
1626         value.setMaxElementsInMemory(maxElementsInMemory);
1627         int maxElementsOnDisk = registry.getInt(prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk());
1628         value.setMaxElementsOnDisk(maxElementsOnDisk);
1629
1630         return value;
1631     }
1632
1633     private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) {
1634         LdapGroupMapping value = new LdapGroupMapping();
1635
1636         //String group = registry.getString( prefix + "group", value.getGroup() );
1637
1638         List<String> groupList = registry.getList(prefix + "group");
1639         String group = value.getGroup();
1640         if (groupList != null && !groupList.isEmpty()) {
1641             StringBuilder sb = new StringBuilder();
1642             for (int i = 0, size = groupList.size(); i < size; i++) {
1643                 sb.append(groupList.get(i));
1644                 if (i < size - 1) {
1645                     sb.append(',');
1646                 }
1647             }
1648             group = sb.toString();
1649         }
1650
1651         value.setGroup(group);
1652         java.util.List roleNames = new java.util.ArrayList/*<String>*/();
1653         roleNames.addAll(registry.getList(prefix + "roleNames.roleName"));
1654         value.setRoleNames(roleNames);
1655
1656         return value;
1657     }
1658
1659 }