This project has retired. For details please refer to its
Attic page.
StandardCapabilities xref
1 package org.apache.archiva.repository;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Collections;
23 import java.util.HashSet;
24 import java.util.Set;
25
26
27
28
29 public class StandardCapabilities implements RepositoryCapabilities
30 {
31 private final Set<ReleaseScheme> supportedReleaseSchemes;
32 private final Set<ReleaseScheme> uSupportedReleaseSchemes;
33 private final Set<String> supportedLayouts;
34 private final Set<String> uSupportedLayouts;
35 private final Set<String> customCapabilities;
36 private final Set<String> uCustomCapabilities;
37 private final Set<String> supportedFeatures;
38 private final Set<String> uSupportedFeatures;
39 private final boolean indexable;
40 private final boolean fileBased;
41 private final boolean canBlockRedeployments;
42 private final boolean scannable;
43 private final boolean allowsFailover;
44
45
46 public StandardCapabilities( ReleaseScheme[] supportedReleaseSchemes, String[] supportedLayouts,
47 String[] customCapabilities, String[] supportedFeatures,
48 boolean indexable, boolean fileBased,
49 boolean canBlockRedeployments, boolean scannable, boolean allowsFailover )
50 {
51 this.supportedReleaseSchemes = new HashSet<>();
52 for (ReleaseScheme scheme : supportedReleaseSchemes) {
53 this.supportedReleaseSchemes.add(scheme);
54 }
55 this.uSupportedReleaseSchemes = Collections.unmodifiableSet( this.supportedReleaseSchemes);
56 this.supportedLayouts = new HashSet<>( );
57 for (String layout : supportedLayouts) {
58 this.supportedLayouts.add(layout);
59 }
60 this.uSupportedLayouts = Collections.unmodifiableSet( this.supportedLayouts );
61 this.customCapabilities = new HashSet<>( );
62 for (String cap : customCapabilities) {
63 this.customCapabilities.add(cap);
64 }
65 this.uCustomCapabilities = Collections.unmodifiableSet( this.customCapabilities );
66 this.supportedFeatures = new HashSet<>( );
67 for (String feature : supportedFeatures) {
68 this.supportedFeatures.add(feature);
69 }
70 this.uSupportedFeatures = Collections.unmodifiableSet( this.supportedFeatures );
71 this.indexable = indexable;
72 this.fileBased = fileBased;
73 this.canBlockRedeployments = canBlockRedeployments;
74 this.scannable = scannable;
75 this.allowsFailover = allowsFailover;
76 }
77
78 @Override
79 public Set<ReleaseScheme> supportedReleaseSchemes( )
80 {
81 return uSupportedReleaseSchemes;
82 }
83
84 @Override
85 public Set<String> supportedLayouts( )
86 {
87 return uSupportedLayouts;
88 }
89
90 @Override
91 public Set<String> customCapabilities( )
92 {
93 return uCustomCapabilities;
94 }
95
96 @Override
97 public Set<String> supportedFeatures( )
98 {
99 return uSupportedFeatures;
100 }
101
102 @Override
103 public boolean isIndexable( )
104 {
105 return indexable;
106 }
107
108 @Override
109 public boolean isFileBased( )
110 {
111 return fileBased;
112 }
113
114 @Override
115 public boolean canBlockRedeployments( )
116 {
117 return canBlockRedeployments;
118 }
119
120 @Override
121 public boolean isScannable( )
122 {
123 return scannable;
124 }
125
126 @Override
127 public boolean allowsFailover( )
128 {
129 return allowsFailover;
130 }
131 }