This project has retired. For details please refer to its
Attic page.
Configuration xref
1 package org.apache.archiva.configuration;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 @SuppressWarnings( "all" )
28 public class Configuration
29 implements java.io.Serializable
30 {
31
32
33
34
35
36
37
38
39 private String version = "3.0.0";
40
41
42
43
44
45 private String metadataStore = "jcr";
46
47
48
49
50 private java.util.List<RepositoryGroupConfiguration> repositoryGroups;
51
52
53
54
55 private java.util.List<ManagedRepositoryConfiguration> managedRepositories;
56
57
58
59
60 private java.util.List<RemoteRepositoryConfiguration> remoteRepositories;
61
62
63
64
65 private java.util.List<ProxyConnectorConfiguration> proxyConnectors;
66
67
68
69
70 private java.util.List<NetworkProxyConfiguration> networkProxies;
71
72
73
74
75 private java.util.List<LegacyArtifactPath> legacyArtifactPaths;
76
77
78
79
80
81
82 private RepositoryScanningConfiguration repositoryScanning;
83
84
85
86
87
88
89 private WebappConfiguration webapp;
90
91
92
93
94
95
96 private OrganisationInformation organisationInfo;
97
98
99
100
101
102
103 private NetworkConfiguration networkConfiguration;
104
105
106
107
108 private RedbackRuntimeConfiguration redbackRuntimeConfiguration;
109
110
111
112
113 private ArchivaRuntimeConfiguration archivaRuntimeConfiguration;
114
115
116
117
118 private java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations;
119
120
121
122
123 private ArchivaDefaultConfiguration archivaDefaultConfiguration;
124
125
126
127
128 private String modelEncoding = "UTF-8";
129
130
131
132
133
134
135
136
137
138
139
140 public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
141 {
142 getLegacyArtifactPaths().add( legacyArtifactPath );
143 }
144
145
146
147
148
149
150 public void addManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
151 {
152 getManagedRepositories().add( managedRepositoryConfiguration );
153 }
154
155
156
157
158
159
160 public void addNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
161 {
162 getNetworkProxies().add( networkProxyConfiguration );
163 }
164
165
166
167
168
169
170 public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
171 {
172 getProxyConnectors().add( proxyConnectorConfiguration );
173 }
174
175
176
177
178
179
180 public void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
181 {
182 getProxyConnectorRuleConfigurations().add( proxyConnectorRuleConfiguration );
183 }
184
185
186
187
188
189
190 public void addRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
191 {
192 getRemoteRepositories().add( remoteRepositoryConfiguration );
193 }
194
195
196
197
198
199
200 public void addRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
201 {
202 getRepositoryGroups().add( repositoryGroupConfiguration );
203 }
204
205
206
207
208
209
210 public ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
211 {
212 return this.archivaDefaultConfiguration;
213 }
214
215
216
217
218
219
220 public ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
221 {
222 return this.archivaRuntimeConfiguration;
223 }
224
225
226
227
228
229
230 public java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
231 {
232 if ( this.legacyArtifactPaths == null )
233 {
234 this.legacyArtifactPaths = new java.util.ArrayList<LegacyArtifactPath>();
235 }
236
237 return this.legacyArtifactPaths;
238 }
239
240
241
242
243
244
245 public java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
246 {
247 if ( this.managedRepositories == null )
248 {
249 this.managedRepositories = new java.util.ArrayList<ManagedRepositoryConfiguration>();
250 }
251
252 return this.managedRepositories;
253 }
254
255
256
257
258
259
260
261 public String getMetadataStore()
262 {
263 return this.metadataStore;
264 }
265
266
267
268
269
270
271 public String getModelEncoding()
272 {
273 return this.modelEncoding;
274 }
275
276
277
278
279
280
281 public NetworkConfiguration getNetworkConfiguration()
282 {
283 return this.networkConfiguration;
284 }
285
286
287
288
289
290
291 public java.util.List<NetworkProxyConfiguration> getNetworkProxies()
292 {
293 if ( this.networkProxies == null )
294 {
295 this.networkProxies = new java.util.ArrayList<NetworkProxyConfiguration>();
296 }
297
298 return this.networkProxies;
299 }
300
301
302
303
304
305
306 public OrganisationInformation getOrganisationInfo()
307 {
308 return this.organisationInfo;
309 }
310
311
312
313
314
315
316 public java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
317 {
318 if ( this.proxyConnectorRuleConfigurations == null )
319 {
320 this.proxyConnectorRuleConfigurations = new java.util.ArrayList<ProxyConnectorRuleConfiguration>();
321 }
322
323 return this.proxyConnectorRuleConfigurations;
324 }
325
326
327
328
329
330
331 public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
332 {
333 if ( this.proxyConnectors == null )
334 {
335 this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
336 }
337
338 return this.proxyConnectors;
339 }
340
341
342
343
344
345
346 public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
347 {
348 return this.redbackRuntimeConfiguration;
349 }
350
351
352
353
354
355
356 public java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
357 {
358 if ( this.remoteRepositories == null )
359 {
360 this.remoteRepositories = new java.util.ArrayList<RemoteRepositoryConfiguration>();
361 }
362
363 return this.remoteRepositories;
364 }
365
366
367
368
369
370
371 public java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
372 {
373 if ( this.repositoryGroups == null )
374 {
375 this.repositoryGroups = new java.util.ArrayList<RepositoryGroupConfiguration>();
376 }
377
378 return this.repositoryGroups;
379 }
380
381
382
383
384
385
386 public RepositoryScanningConfiguration getRepositoryScanning()
387 {
388 return this.repositoryScanning;
389 }
390
391
392
393
394
395
396 public String getVersion()
397 {
398 return this.version;
399 }
400
401
402
403
404
405
406 public WebappConfiguration getWebapp()
407 {
408 return this.webapp;
409 }
410
411
412
413
414
415
416 public void removeLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
417 {
418 getLegacyArtifactPaths().remove( legacyArtifactPath );
419 }
420
421
422
423
424
425
426 public void removeManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
427 {
428 getManagedRepositories().remove( managedRepositoryConfiguration );
429 }
430
431
432
433
434
435
436 public void removeNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
437 {
438 getNetworkProxies().remove( networkProxyConfiguration );
439 }
440
441
442
443
444
445
446 public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
447 {
448 getProxyConnectors().remove( proxyConnectorConfiguration );
449 }
450
451
452
453
454
455
456 public void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
457 {
458 getProxyConnectorRuleConfigurations().remove( proxyConnectorRuleConfiguration );
459 }
460
461
462
463
464
465
466 public void removeRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
467 {
468 getRemoteRepositories().remove( remoteRepositoryConfiguration );
469 }
470
471
472
473
474
475
476 public void removeRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
477 {
478 getRepositoryGroups().remove( repositoryGroupConfiguration );
479 }
480
481
482
483
484
485
486 public void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration archivaDefaultConfiguration )
487 {
488 this.archivaDefaultConfiguration = archivaDefaultConfiguration;
489 }
490
491
492
493
494
495
496 public void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
497 {
498 this.archivaRuntimeConfiguration = archivaRuntimeConfiguration;
499 }
500
501
502
503
504
505
506 public void setLegacyArtifactPaths( java.util.List<LegacyArtifactPath> legacyArtifactPaths )
507 {
508 this.legacyArtifactPaths = legacyArtifactPaths;
509 }
510
511
512
513
514
515
516
517 public void setManagedRepositories( java.util.List<ManagedRepositoryConfiguration> managedRepositories )
518 {
519 this.managedRepositories = managedRepositories;
520 }
521
522
523
524
525
526
527
528 public void setMetadataStore( String metadataStore )
529 {
530 this.metadataStore = metadataStore;
531 }
532
533
534
535
536
537
538 public void setModelEncoding( String modelEncoding )
539 {
540 this.modelEncoding = modelEncoding;
541 }
542
543
544
545
546
547
548 public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
549 {
550 this.networkConfiguration = networkConfiguration;
551 }
552
553
554
555
556
557
558
559 public void setNetworkProxies( java.util.List<NetworkProxyConfiguration> networkProxies )
560 {
561 this.networkProxies = networkProxies;
562 }
563
564
565
566
567
568
569 public void setOrganisationInfo( OrganisationInformation organisationInfo )
570 {
571 this.organisationInfo = organisationInfo;
572 }
573
574
575
576
577
578
579 public void setProxyConnectorRuleConfigurations( java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations )
580 {
581 this.proxyConnectorRuleConfigurations = proxyConnectorRuleConfigurations;
582 }
583
584
585
586
587
588
589 public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
590 {
591 this.proxyConnectors = proxyConnectors;
592 }
593
594
595
596
597
598
599 public void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
600 {
601 this.redbackRuntimeConfiguration = redbackRuntimeConfiguration;
602 }
603
604
605
606
607
608
609
610 public void setRemoteRepositories( java.util.List<RemoteRepositoryConfiguration> remoteRepositories )
611 {
612 this.remoteRepositories = remoteRepositories;
613 }
614
615
616
617
618
619
620 public void setRepositoryGroups( java.util.List<RepositoryGroupConfiguration> repositoryGroups )
621 {
622 this.repositoryGroups = repositoryGroups;
623 }
624
625
626
627
628
629
630 public void setRepositoryScanning( RepositoryScanningConfiguration repositoryScanning )
631 {
632 this.repositoryScanning = repositoryScanning;
633 }
634
635
636
637
638
639
640 public void setVersion( String version )
641 {
642 this.version = version;
643 }
644
645
646
647
648
649
650 public void setWebapp( WebappConfiguration webapp )
651 {
652 this.webapp = webapp;
653 }
654
655
656 private java.util.Map<String, java.util.List<String>> repositoryToGroupMap;
657
658 public java.util.Map<String, java.util.List<String>> getRepositoryToGroupMap()
659 {
660 if ( repositoryGroups != null )
661 {
662 java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
663
664 for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
665 {
666 for ( String repositoryId : (java.util.List<String>) group.getRepositories() )
667 {
668 java.util.List<String> groups = map.get( repositoryId );
669 if ( groups == null )
670 {
671 groups = new java.util.ArrayList<String>();
672 map.put( repositoryId, groups );
673 }
674 groups.add( group.getId() );
675 }
676 }
677
678 repositoryToGroupMap = map;
679 }
680 return repositoryToGroupMap;
681 }
682
683 public java.util.Map<String, RepositoryGroupConfiguration> getRepositoryGroupsAsMap()
684 {
685 java.util.Map<String, RepositoryGroupConfiguration> map = new java.util.HashMap<String, RepositoryGroupConfiguration>();
686 if ( repositoryGroups != null )
687 {
688 for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
689 {
690 map.put( group.getId(), group );
691 }
692 }
693 return map;
694 }
695
696 public RepositoryGroupConfiguration findRepositoryGroupById( String id )
697 {
698 if ( repositoryGroups != null )
699 {
700 for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
701 {
702 if ( group.getId().equals( id ) )
703 {
704 return group;
705 }
706 }
707 }
708 return null;
709 }
710
711 private java.util.Map<String, java.util.List<String>> groupToRepositoryMap;
712
713 public java.util.Map<String, java.util.List<String>> getGroupToRepositoryMap()
714 {
715 if ( repositoryGroups != null && managedRepositories != null )
716 {
717 java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
718
719 for ( ManagedRepositoryConfiguration repo : (java.util.List<ManagedRepositoryConfiguration>) managedRepositories )
720 {
721 for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
722 {
723 if ( !group.getRepositories().contains( repo.getId() ) )
724 {
725 String groupId = group.getId();
726 java.util.List<String> repos = map.get( groupId );
727 if ( repos == null )
728 {
729 repos = new java.util.ArrayList<String>();
730 map.put( groupId, repos );
731 }
732 repos.add( repo.getId() );
733 }
734 }
735 }
736 groupToRepositoryMap = map;
737 }
738 return groupToRepositoryMap;
739 }
740
741
742 public java.util.Map<String, NetworkProxyConfiguration> getNetworkProxiesAsMap()
743 {
744 java.util.Map<String, NetworkProxyConfiguration> map = new java.util.HashMap<String, NetworkProxyConfiguration>();
745 if ( networkProxies != null )
746 {
747 for ( java.util.Iterator<NetworkProxyConfiguration> i = networkProxies.iterator(); i.hasNext(); )
748 {
749 NetworkProxyConfiguration proxy = i.next();
750 map.put( proxy.getId(), proxy );
751 }
752 }
753 return map;
754 }
755
756 public java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> getProxyConnectorAsMap()
757 {
758 java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
759 new java.util.HashMap<String, java.util.List<ProxyConnectorConfiguration>>();
760
761 if( proxyConnectors != null )
762 {
763 java.util.Iterator<ProxyConnectorConfiguration> it = proxyConnectors.iterator();
764 while ( it.hasNext() )
765 {
766 ProxyConnectorConfiguration proxyConfig = it.next();
767 String key = proxyConfig.getSourceRepoId();
768
769 java.util.List<ProxyConnectorConfiguration> connectors = proxyConnectorMap.get( key );
770 if ( connectors == null )
771 {
772 connectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
773 proxyConnectorMap.put( key, connectors );
774 }
775
776 connectors.add( proxyConfig );
777 java.util.Collections.sort( connectors,
778 org.apache.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
779 }
780 }
781
782 return proxyConnectorMap;
783 }
784
785 public java.util.Map<String, RemoteRepositoryConfiguration> getRemoteRepositoriesAsMap()
786 {
787 java.util.Map<String, RemoteRepositoryConfiguration> map = new java.util.HashMap<String, RemoteRepositoryConfiguration>();
788 if ( remoteRepositories != null )
789 {
790 for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
791 {
792 RemoteRepositoryConfiguration repo = i.next();
793 map.put( repo.getId(), repo );
794 }
795 }
796 return map;
797 }
798
799 public RemoteRepositoryConfiguration findRemoteRepositoryById( String id )
800 {
801 if ( remoteRepositories != null )
802 {
803 for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
804 {
805 RemoteRepositoryConfiguration repo = i.next();
806 if ( repo.getId().equals( id ) )
807 {
808 return repo;
809 }
810 }
811 }
812 return null;
813 }
814
815 public java.util.Map<String, ManagedRepositoryConfiguration> getManagedRepositoriesAsMap()
816 {
817 java.util.Map<String, ManagedRepositoryConfiguration> map = new java.util.HashMap<String, ManagedRepositoryConfiguration>();
818 if ( managedRepositories != null )
819 {
820 for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
821 {
822 ManagedRepositoryConfiguration repo = i.next();
823 map.put( repo.getId(), repo );
824 }
825 }
826 return map;
827 }
828
829 public ManagedRepositoryConfiguration findManagedRepositoryById( String id )
830 {
831 if ( managedRepositories != null )
832 {
833 for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
834 {
835 ManagedRepositoryConfiguration repo = i.next();
836 if ( repo.getId().equals( id ) )
837 {
838 return repo;
839 }
840 }
841 }
842 return null;
843 }
844
845 }