diff options
author | James William Dumay <jdumay@apache.org> | 2008-08-19 08:45:45 +0000 |
---|---|---|
committer | James William Dumay <jdumay@apache.org> | 2008-08-19 08:45:45 +0000 |
commit | e5be21e4bbafdc2842e52ed5b403d4bf4e8c1040 (patch) | |
tree | 02dfba9e0e744b54e474591f75ad8ef16031fe82 /archiva-modules/archiva-base/archiva-proxy | |
parent | 62b4332f98badbfb87d532f3edfc6bc79482032c (diff) | |
download | archiva-e5be21e4bbafdc2842e52ed5b403d4bf4e8c1040.tar.gz archiva-e5be21e4bbafdc2842e52ed5b403d4bf4e8c1040.zip |
MRM-541 - convenient way to take Archiva proxies "offline"
* Implemented UI for enabling/disabling proxy connectors
* changes to RepositoryProxyConnectors to skip offline connectors
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-541@686984 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy')
2 files changed, 28 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index 2c5da3ebf..9c81b53ed 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -151,6 +151,11 @@ public class DefaultRepositoryProxyConnectors Map<String, Exception> previousExceptions = new LinkedHashMap<String, Exception>(); for ( ProxyConnector connector : connectors ) { + if (connector.isDisabled()) + { + continue; + } + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() ); @@ -221,6 +226,11 @@ public class DefaultRepositoryProxyConnectors List<ProxyConnector> connectors = getProxyConnectors( repository ); for ( ProxyConnector connector : connectors ) { + if (connector.isDisabled()) + { + continue; + } + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() ); @@ -280,6 +290,11 @@ public class DefaultRepositoryProxyConnectors List<ProxyConnector> connectors = getProxyConnectors( repository ); for ( ProxyConnector connector : connectors ) { + if (connector.isDisabled()) + { + continue; + } + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); File localRepoFile = toLocalRepoFile( repository, targetRepository, logicalPath ); diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java index 8d59d7d6b..8bf9d4548 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java @@ -49,6 +49,18 @@ public class ProxyConnector private int order; private Map<String, String> policies; + + private boolean disabled; + + public boolean isDisabled() + { + return disabled; + } + + public void setDisabled(boolean disabled) + { + this.disabled = disabled; + } public List<String> getBlacklist() { @@ -110,6 +122,7 @@ public class ProxyConnector this.proxyId = proxyId; } + @Override public String toString() { StringBuffer sb = new StringBuffer(); |