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 022import org.apache.archiva.repository.storage.RepositoryStorage; 023 024import java.util.List; 025 026/** 027 * Interface for repository groups. 028 * 029 * Repository groups are a combined view over a list of repositories. 030 * All repositories of this group must be of the same type. 031 * 032 * Repository groups are read only. You cannot store artifacts into a repository group. 033 * 034 * This interface extends <code>{@link RepositoryStorage}</code> to provide access to the merged 035 * index data files and other metadata. 036 * 037 */ 038public interface RepositoryGroup extends Repository, RepositoryStorage { 039 040 /** 041 * Returns the list of repositories. The order of the elements represents 042 * the order of getting artifacts (first one wins). 043 * 044 * 045 * @return 046 */ 047 List<ManagedRepository> getRepositories(); 048 049 /** 050 * Returns true, if the given repository is part of this group. 051 * 052 * @param repository The repository to check. 053 * @return True, if it is part, otherwise false. 054 */ 055 boolean contains(ManagedRepository repository); 056 057 /** 058 * Returns true, if the repository with the given id is part of this group. 059 * 060 * @param id The repository id to check 061 * @return True, if it is part, otherwise false 062 */ 063 boolean contains(String id); 064 065 /** 066 * Returns the time to live in seconds for the merged index. 067 * 068 * @return 069 */ 070 int getMergedIndexTTL(); 071}