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.artifact.repository.ArtifactRepository;
23 import org.apache.maven.wagon.ResourceDoesNotExistException;
24 import org.apache.maven.wagon.proxy.ProxyInfo;
27 import java.util.List;
30 * An individual request handler for the proxy.
32 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
34 public interface ProxyRequestHandler
37 * The Plexus role of the component.
39 String ROLE = ProxyRequestHandler.class.getName();
42 * Used to retrieve an artifact at a particular path, giving the cached version if it exists.
44 * @param path the expected repository path
45 * @param proxiedRepositories the repositories being proxied to
46 * @param managedRepository the locally managed repository to cache artifacts in
47 * @return File object referencing the requested path in the cache
48 * @throws ProxyException when an exception occurred during the retrieval of the requested path
49 * @throws org.apache.maven.wagon.ResourceDoesNotExistException
50 * when the requested object can't be found in any of the
51 * configured repositories
53 File get( String path, List proxiedRepositories, ArtifactRepository managedRepository )
54 throws ProxyException, ResourceDoesNotExistException;
57 * Used to retrieve an artifact at a particular path, giving the cached version if it exists.
59 * @param path the expected repository path
60 * @param proxiedRepositories the repositories being proxied to
61 * @param managedRepository the locally managed repository to cache artifacts in
62 * @param wagonProxy a network proxy to use when transferring files if needed
63 * @return File object referencing the requested path in the cache
64 * @throws ProxyException when an exception occurred during the retrieval of the requested path
65 * @throws org.apache.maven.wagon.ResourceDoesNotExistException
66 * when the requested object can't be found in any of the
67 * configured repositories
69 File get( String path, List proxiedRepositories, ArtifactRepository managedRepository, ProxyInfo wagonProxy )
70 throws ProxyException, ResourceDoesNotExistException;
73 * Used to force remote download of the requested path from any the configured repositories. This method will
74 * only bypass the cache for searching but the requested path will still be cached.
76 * @param path the expected repository path
77 * @param proxiedRepositories the repositories being proxied to
78 * @param managedRepository the locally managed repository to cache artifacts in
79 * @return File object referencing the requested path in the cache
80 * @throws ProxyException when an exception occurred during the retrieval of the requested path
81 * @throws org.apache.maven.wagon.ResourceDoesNotExistException
82 * when the requested object can't be found in any of the
83 * configured repositories
85 File getAlways( String path, List proxiedRepositories, ArtifactRepository managedRepository )
86 throws ProxyException, ResourceDoesNotExistException;
89 * Used to force remote download of the requested path from any the configured repositories. This method will
90 * only bypass the cache for searching but the requested path will still be cached.
92 * @param path the expected repository path
93 * @param proxiedRepositories the repositories being proxied to
94 * @param managedRepository the locally managed repository to cache artifacts in
95 * @param wagonProxy a network proxy to use when transferring files if needed
96 * @return File object referencing the requested path in the cache
97 * @throws ProxyException when an exception occurred during the retrieval of the requested path
98 * @throws org.apache.maven.wagon.ResourceDoesNotExistException
99 * when the requested object can't be found in any of the
100 * configured repositories
102 File getAlways( String path, List proxiedRepositories, ArtifactRepository managedRepository, ProxyInfo wagonProxy )
103 throws ProxyException, ResourceDoesNotExistException;