1 package org.apache.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.archiva.model.ArtifactReference;
23 import org.apache.archiva.policies.ProxyDownloadException;
24 import org.apache.archiva.repository.ManagedRepositoryContent;
27 import java.util.List;
30 * Handler for potential repository proxy connectors.
34 public interface RepositoryProxyConnectors
37 * Performs the artifact fetch operation against the target repositories
38 * of the provided source repository.
40 * If the artifact is found, it is downloaded and placed into the source repository
43 * @param repository the source repository to use. (must be a managed repository)
44 * @param artifact the artifact to fetch.
45 * @return the file that was obtained, or null if no content was obtained
46 * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories.
48 public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
49 throws ProxyDownloadException;
52 * Performs the metadata fetch operation against the target repositories
53 * of the provided source repository.
55 * If the metadata is found, it is downloaded and placed into the source repository
58 * @param repository the source repository to use. (must be a managed repository)
59 * @param metadata the metadata to fetch.
60 * @return the file that was obtained, or null if no content was obtained
62 public File fetchMetatadaFromProxies( ManagedRepositoryContent repository, String logicalPath );
65 * Performs the fetch operation against the target repositories
66 * of the provided source repository.
68 * @param repository the source repository to use. (must be a managed repository)
69 * @param path the path of the resource to fetch
70 * @return the file that was obtained, or null if no content was obtained
72 public File fetchFromProxies( ManagedRepositoryContent managedRepository, String path );
75 * Get the List of {@link ProxyConnector} objects of the source repository.
77 * @param repository the source repository to look for.
78 * @return the List of {@link ProxyConnector} objects.
80 public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
83 * Tests to see if the provided repository is a source repository for
84 * any {@link ProxyConnector} objects.
86 * @param repository the source repository to look for.
87 * @return true if there are proxy connectors that use the provided
88 * repository as a source repository.
90 public boolean hasProxies( ManagedRepositoryContent repository );