1 package org.apache.archiva.proxy.model;
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.model.ArtifactReference;
23 import org.apache.archiva.policies.ProxyDownloadException;
24 import org.apache.archiva.repository.ManagedRepositoryContent;
25 import org.apache.archiva.repository.RepositoryType;
26 import org.apache.archiva.repository.content.StorageAsset;
28 import java.util.List;
32 * Handler for potential repository proxy connectors.
36 public interface RepositoryProxyHandler
39 List<RepositoryType> supports();
42 * Performs the artifact fetch operation against the target repositories
43 * of the provided source repository.
45 * If the artifact is found, it is downloaded and placed into the source repository
48 * @param repository the source repository to use. (must be a managed repository)
49 * @param artifact the artifact to fetch.
50 * @return the file that was obtained, or null if no content was obtained
51 * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories.
53 StorageAsset fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
54 throws ProxyDownloadException;
57 * Performs the metadata fetch operation against the target repositories
58 * of the provided source repository.
60 * If the metadata is found, it is downloaded and placed into the source repository
63 * @param repository the source repository to use. (must be a managed repository)
64 * @param logicalPath the metadata to fetch.
65 * @return the file that was obtained, or null if no content was obtained
67 ProxyFetchResult fetchMetadataFromProxies( ManagedRepositoryContent repository, String logicalPath );
70 * Performs the fetch operation against the target repositories
71 * of the provided source repository.
73 * @param managedRepository the source repository to use. (must be a managed repository)
74 * @param path the path of the resource to fetch
75 * @return the file that was obtained, or null if no content was obtained
77 StorageAsset fetchFromProxies( ManagedRepositoryContent managedRepository, String path );
80 * Get the List of {@link ProxyConnector} objects of the source repository.
82 * @param repository the source repository to look for.
83 * @return the List of {@link ProxyConnector} objects.
85 List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
88 * Tests to see if the provided repository is a source repository for
89 * any {@link ProxyConnector} objects.
91 * @param repository the source repository to look for.
92 * @return true if there are proxy connectors that use the provided
93 * repository as a source repository.
95 boolean hasProxies( ManagedRepositoryContent repository );
97 void setNetworkProxies(Map<String, NetworkProxy> proxies);
99 Map<String, NetworkProxy> getNetworkProxies();
101 NetworkProxy getNetworkProxy(String id);