1 package org.apache.maven.archiva.proxy;
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.maven.archiva.model.ArtifactReference;
23 import org.apache.maven.archiva.model.ProjectReference;
24 import org.apache.maven.archiva.model.VersionedReference;
25 import org.apache.maven.archiva.policies.ProxyDownloadException;
26 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
29 import java.util.List;
32 * Handler for potential repository proxy connectors.
34 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
37 public interface RepositoryProxyConnectors
40 * Performs the artifact fetch operation against the target repositories
41 * of the provided source repository.
43 * If the artifact is found, it is downloaded and placed into the source repository
46 * @param repository the source repository to use. (must be a managed repository)
47 * @param artifact the artifact to fetch.
48 * @return the file that was obtained, or null if no content was obtained
49 * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories.
51 public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
52 throws ProxyDownloadException;
55 * Performs the metadata fetch operation against the target repositories
56 * of the provided source repository.
58 * If the metadata is found, it is downloaded and placed into the source repository
61 * @param repository the source repository to use. (must be a managed repository)
62 * @param metadata the metadata to fetch.
63 * @return the file that was obtained, or null if no content was obtained
65 public File fetchFromProxies( ManagedRepositoryContent repository, VersionedReference metadata );
68 * Performs the metadata fetch operation against the target repositories
69 * of the provided source repository.
71 * If the metadata is found, it is downloaded and placed into the source repository
74 * @param repository the source repository to use. (must be a managed repository)
75 * @param metadata the metadata to fetch.
76 * @return the file that was obtained, or null if no content was obtained
78 public File fetchFromProxies( ManagedRepositoryContent repository, ProjectReference metadata );
81 * Performs the fetch operation against the target repositories
82 * of the provided source repository.
84 * @param repository the source repository to use. (must be a managed repository)
85 * @param path the path of the resource to fetch
86 * @return the file that was obtained, or null if no content was obtained
88 public File fetchFromProxies( ManagedRepositoryContent managedRepository, String path );
91 * Get the List of {@link ProxyConnector} objects of the source repository.
93 * @param repository the source repository to look for.
94 * @return the List of {@link ProxyConnector} objects.
96 public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
99 * Tests to see if the provided repository is a source repository for
100 * any {@link ProxyConnector} objects.
102 * @param repository the source repository to look for.
103 * @return true if there are proxy connectors that use the provided
104 * repository as a source repository.
106 public boolean hasProxies( ManagedRepositoryContent repository );