001package org.apache.archiva.proxy; 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.proxy.model.NetworkProxy; 023import org.apache.archiva.proxy.model.ProxyConnector; 024import org.apache.archiva.proxy.model.RepositoryProxyHandler; 025import org.apache.archiva.repository.RepositoryType; 026 027import java.util.List; 028import java.util.Map; 029 030/** 031 * A proxy registry is central access point for accessing a proxy. It gives access to the proxy handlers 032 * that are registered for the different repository types. 033 * 034 * @author Martin Stockhammer <martin_s@apache.org> 035 */ 036public interface ProxyRegistry { 037 038 /** 039 * Returns the network proxy that is configured for the given id (repository id). 040 * 041 * @param id The proxy id 042 * @return The network proxy object if defined, otherwise null. 043 */ 044 NetworkProxy getNetworkProxy(String id); 045 046 /** 047 * Returns a map that contains a list of repository handlers for each repository type. 048 * @return The map with the repository type as key and a list of handler objects as value. 049 */ 050 Map<RepositoryType, List<RepositoryProxyHandler>> getAllHandler(); 051 052 /** 053 * Returns the repository handler that are defined for the given repository type. 054 * 055 * @param type The repository type 056 * @return Returns the list of the handler objects, or a empty list, if none defined. 057 */ 058 List<RepositoryProxyHandler> getHandler(RepositoryType type); 059 060 /** 061 * Returns true, if there are proxy handler registered for the given type. 062 * 063 * @param type The repository type 064 * @return True, if a handler is registered, otherwise false. 065 */ 066 boolean hasHandler(RepositoryType type); 067 068 /** 069 * Returns the list of all proxy connectors. 070 * @return 071 */ 072 List<org.apache.archiva.proxy.model.ProxyConnector> getProxyConnectors( ); 073 074 /** 075 * Returns a map of connector lists with the source repository id as key 076 * @return A map with source repository ids as key and list of corresponding proxy connector objects as value. 077 */ 078 Map<String, List<ProxyConnector>> getProxyConnectorAsMap( ); 079 080 /** 081 * Reloads the proxies from the configuration. 082 */ 083 void reload(); 084}