001package org.apache.archiva.repository; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022 023import java.util.Set; 024 025/** 026 * Describe the capabilities a repository implementation supports. 027 */ 028public interface RepositoryCapabilities { 029 030 /** 031 * Returns true, if this repository has a mechanism for indexes 032 * @return true, if this repository is indexable, otherwise false. 033 */ 034 default boolean isIndexable() { 035 return true; 036 } 037 038 /** 039 * Returns true, if this repository type is storing its artifacts on the filesystem. 040 * @return true, if this is a file based repository, otherwise false. 041 */ 042 default boolean isFileBased() { 043 return true; 044 } 045 046 /** 047 * Returns true, if this repository allows to block redeployments to prevent overriding 048 * released artifacts 049 * @return true, if this repo can block redeployments, otherwise false. 050 */ 051 default boolean canBlockRedeployments() { 052 return true; 053 } 054 055 /** 056 * Returns true, if the artifacts can be scanned for metadata retrieval or maintenance tasks 057 * @return true, if this repository can be scanned regularily, otherwise false. 058 */ 059 default boolean isScannable() { 060 return true; 061 } 062 063 /** 064 * Returns true, if this repository can use failover repository urls 065 * @return true, if there is a failover mechanism for repository access, otherwise false. 066 */ 067 default boolean allowsFailover() { 068 return false; 069 } 070 071 /** 072 * Returns the release schemes this repository type can handle 073 */ 074 Set<ReleaseScheme> supportedReleaseSchemes(); 075 076 /** 077 * Returns the layouts this repository type can provide 078 * @return The list of layouts supported by this repository. 079 */ 080 Set<String> supportedLayouts(); 081 082 /** 083 * Returns additional capabilities, that this repository type implements. 084 * @return A list of custom capabilities. 085 */ 086 Set<String> customCapabilities(); 087 088 /** 089 * Returns the supported features this repository type supports. This method returns 090 * string that corresponds to fully qualified class names. 091 * We use string representation to allow implementations provide their own feature 092 * implementations if necessary and to avoid class errors. 093 * 094 * @return The list of supported features as string values. 095 */ 096 Set<String> supportedFeatures(); 097 098 099}