1 package org.apache.maven.repository.proxy;
4 * Copyright 2005-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import org.apache.maven.artifact.repository.ArtifactRepository;
21 import java.util.HashSet;
25 * A proxied artifact repository - contains the artifact repository and additional information about
26 * the proxied repository.
28 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
30 public class ProxiedArtifactRepository
33 * Whether to cache failures or not.
35 private boolean cacheFailures;
38 * Whether failures on this repository cause the whole group to fail.
40 private boolean hardFail;
43 * Whether to use the network proxy for any requests.
45 private boolean useNetworkProxy;
48 * The artifact repository on the other end of the proxy.
50 private ArtifactRepository repository;
53 * Cache of failures that have already occurred, containing paths from the repository root.
55 private Set/*<String>*/ failureCache = new HashSet/*<String>*/();
58 * A user friendly name for the repository.
62 public boolean isHardFail()
67 public boolean isUseNetworkProxy()
69 return useNetworkProxy;
72 public boolean isCacheFailures()
77 public ArtifactRepository getRepository()
82 public boolean isCachedFailure( String path )
84 return cacheFailures && failureCache.contains( path );
87 public void addFailure( String path )
91 failureCache.add( path );
95 public void clearFailure( String path )
99 failureCache.remove( path );
103 public String getName()