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 org.apache.archiva.repository.features.RepositoryFeature;
25 import java.util.List;
26 import java.util.Locale;
31 * Base interface for repositories.
33 * Created by Martin Stockhammer on 21.09.17.
35 public interface Repository {
38 * Return the identifier of the repository. Repository identifier should be unique at least
40 * @return The identifier.
45 * This is the display name of the repository. This string is presented in the user interface.
47 * @return The display name of the repository
52 * Returns the name in the given locale.
56 String getName(Locale locale);
59 * Returns a description of this repository.
60 * @return The description.
62 String getDescription();
65 * Returns the description for the given locale.
69 String getDescription(Locale locale);
72 * This identifies the type of repository. Archiva does only support certain types of repositories.
74 * @return A unique identifier for the repository type.
76 RepositoryType getType();
80 * Returns the location of this repository. For local repositories this might be a file URI, for
81 * remote repositories a http URL or some very repository specific schemes.
82 * Each repository has only one unique location.
84 * @return The repository location.
90 * A repository may allow additional locations that can be used, if the primary location is not available.
93 Set<URI> getFailoverLocations();
96 * True, if this repository is scanned regularly.
101 * Returns the definition, when the repository jobs are executed.
102 * This must return a valid a cron string.
104 * @See http://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html
108 String getSchedulingDefinition();
111 * Returns true, if this repository has a index available
117 * Returns the path to the index parent folder. May be a HTTP URL or a file path.
123 * Returns a layout definition. The returned string may be implementation specific and is not
131 * Returns the release schemes that are active by this repository. E.g. for maven repositories
132 * this may either be a release repository, a snapshot repository or a combined repository.
135 Set<ReleaseScheme> getActiveReleaseSchemes();
139 * Returns the capabilities of the repository implementation.
142 RepositoryCapabilities getCapabilities();
146 * Extension method that allows to provide different features that are not supported by all
149 * @param clazz The feature class that is requested
150 * @param <T> This is the class of the feature
151 * @return The feature implementation for this repository instance, if it is supported
152 * @throws UnsupportedFeatureException if the feature is not supported by this repository type
154 <T extends RepositoryFeature<T>> RepositoryFeature<T> getFeature(Class<T> clazz) throws UnsupportedFeatureException;
158 * Returns true, if the requested feature is supported by this repository.
160 * @param clazz The requested feature class
161 * @param <T> The requested feature class
162 * @return True, if the feature is supported, otherwise false.
164 <T extends RepositoryFeature<T>> boolean supportsFeature(Class<T> clazz);