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.configuration.ManagedRepositoryConfiguration;
23 import org.apache.maven.archiva.model.ArtifactReference;
24 import org.apache.maven.archiva.model.ProjectReference;
25 import org.apache.maven.archiva.model.VersionedReference;
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 true if the fetch operation succeeded in obtaining content, false if no content was obtained.
49 * @throws ProxyException if there was a problem fetching the content from the target repositories.
51 public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
52 throws ProxyException;
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 true if the fetch operation succeeded in obtaining content, false if no content was obtained.
64 * @throws ProxyException if there was a problem fetching the content from the target repositories.
66 public File fetchFromProxies( ManagedRepositoryContent repository, VersionedReference metadata )
67 throws ProxyException;
70 * Performs the metadata fetch operation against the target repositories
71 * of the provided source repository.
73 * If the metadata is found, it is downloaded and placed into the source repository
76 * @param repository the source repository to use. (must be a managed repository)
77 * @param metadata the metadata to fetch.
78 * @return true if the fetch operation succeeded in obtaining content, false if no content was obtained.
79 * @throws ProxyException if there was a problem fetching the content from the target repositories.
81 public File fetchFromProxies( ManagedRepositoryContent repository, ProjectReference metadata )
82 throws ProxyException;
85 * Get the List of {@link ProxyConnector} objects of the source repository.
87 * @param repository the source repository to look for.
88 * @return the List of {@link ProxyConnector} objects.
90 public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
93 * Tests to see if the provided repository is a source repository for
94 * any {@link ProxyConnector} objects.
96 * @param repository the source repository to look for.
97 * @return true if there are proxy connectors that use the provided
98 * repository as a source repository.
100 public boolean hasProxies( ManagedRepositoryContent repository );