1 package org.apache.archiva.repository;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import java.util.Collections;
23 import java.util.HashSet;
27 * Capability implementation.
29 public class StandardCapabilities implements RepositoryCapabilities
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;
46 public StandardCapabilities( ReleaseScheme[] supportedReleaseSchemes, String[] supportedLayouts,
47 String[] customCapabilities, String[] supportedFeatures,
48 boolean indexable, boolean fileBased,
49 boolean canBlockRedeployments, boolean scannable, boolean allowsFailover )
51 this.supportedReleaseSchemes = new HashSet();
52 for (ReleaseScheme scheme : supportedReleaseSchemes) {
53 this.supportedReleaseSchemes.add(scheme);
55 this.uSupportedReleaseSchemes = Collections.unmodifiableSet( this.supportedReleaseSchemes);
56 this.supportedLayouts = new HashSet<>( );
57 for (String layout : supportedLayouts) {
58 this.supportedLayouts.add(layout);
60 this.uSupportedLayouts = Collections.unmodifiableSet( this.supportedLayouts );
61 this.customCapabilities = new HashSet<>( );
62 for (String cap : customCapabilities) {
63 this.customCapabilities.add(cap);
65 this.uCustomCapabilities = Collections.unmodifiableSet( this.customCapabilities );
66 this.supportedFeatures = new HashSet<>( );
67 for (String feature : supportedFeatures) {
68 this.supportedFeatures.add(feature);
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;
79 public Set<ReleaseScheme> supportedReleaseSchemes( )
81 return uSupportedReleaseSchemes;
85 public Set<String> supportedLayouts( )
87 return uSupportedLayouts;
91 public Set<String> customCapabilities( )
93 return uCustomCapabilities;
97 public Set<String> supportedFeatures( )
99 return uSupportedFeatures;
103 public boolean isIndexable( )
109 public boolean isFileBased( )
115 public boolean canBlockRedeployments( )
117 return canBlockRedeployments;
121 public boolean isScannable( )
127 public boolean allowsFailover( )
129 return allowsFailover;