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