1 package org.apache.archiva.proxy; 2 3 /* 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 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 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 19 * under the License. 20 */ 21 22 import org.apache.archiva.proxy.model.NetworkProxy; 23 import org.apache.archiva.proxy.model.ProxyConnector; 24 import org.apache.archiva.proxy.model.RepositoryProxyHandler; 25 import org.apache.archiva.repository.RepositoryType; 26 27 import java.util.List; 28 import java.util.Map; 29 30 /** 31 * A proxy registry is central access point for accessing a proxy. It gives access to the proxy handlers 32 * that are registered for the different repository types. 33 * 34 * @author Martin Stockhammer <martin_s@apache.org> 35 */ 36 public interface ProxyRegistry { 37 38 /** 39 * Returns the network proxy that is configured for the given id (repository id). 40 * 41 * @param id The proxy id 42 * @return The network proxy object if defined, otherwise null. 43 */ 44 NetworkProxy getNetworkProxy(String id); 45 46 /** 47 * Returns a map that contains a list of repository handlers for each repository type. 48 * @return The map with the repository type as key and a list of handler objects as value. 49 */ 50 Map<RepositoryType, List<RepositoryProxyHandler>> getAllHandler(); 51 52 /** 53 * Returns the repository handler that are defined for the given repository type. 54 * 55 * @param type The repository type 56 * @return Returns the list of the handler objects, or a empty list, if none defined. 57 */ 58 List<RepositoryProxyHandler> getHandler(RepositoryType type); 59 60 /** 61 * Returns true, if there are proxy handler registered for the given type. 62 * 63 * @param type The repository type 64 * @return True, if a handler is registered, otherwise false. 65 */ 66 boolean hasHandler(RepositoryType type); 67 68 /** 69 * Returns the list of all proxy connectors. 70 * @return 71 */ 72 List<org.apache.archiva.proxy.model.ProxyConnector> getProxyConnectors( ); 73 74 /** 75 * Returns a map of connector lists with the source repository id as key 76 * @return A map with source repository ids as key and list of corresponding proxy connector objects as value. 77 */ 78 Map<String, List<ProxyConnector>> getProxyConnectorAsMap( ); 79 80 /** 81 * Reloads the proxies from the configuration. 82 */ 83 void reload(); 84 }