summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-proxy-api
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-29 21:00:51 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-29 21:00:51 +0000
commit6f95f668fcb8c766d83d0b5caa4a02d3e02d20a9 (patch)
tree01b4d1c7bc77ba18ba938fb1761fb5a7496dc2e0 /archiva-modules/archiva-base/archiva-proxy-api
parentc7b2d0af209c5515125571b715a7ca1190425e11 (diff)
downloadarchiva-6f95f668fcb8c766d83d0b5caa4a02d3e02d20a9.tar.gz
archiva-6f95f668fcb8c766d83d0b5caa4a02d3e02d20a9.zip
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403507 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy-api')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/ProxyConnector.java164
1 files changed, 164 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/ProxyConnector.java b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/ProxyConnector.java
new file mode 100644
index 000000000..90c75983d
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/ProxyConnector.java
@@ -0,0 +1,164 @@
+package org.apache.archiva.proxy.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.repository.ManagedRepositoryContent;
+import org.apache.archiva.repository.RemoteRepositoryContent;
+import org.apache.archiva.repository.connector.RepositoryConnector;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This represents a connector for a repository to repository proxy.
+ */
+public class ProxyConnector
+ implements RepositoryConnector
+{
+ private ManagedRepositoryContent sourceRepository;
+
+ private RemoteRepositoryContent targetRepository;
+
+ private List<String> blacklist;
+
+ private List<String> whitelist;
+
+ private String proxyId;
+
+ private int order;
+
+ private Map<String, String> policies;
+
+ private boolean disabled;
+
+ public ProxyConnector()
+ {
+ // no op
+ }
+
+ public boolean isDisabled()
+ {
+ return disabled;
+ }
+
+ public void setDisabled( boolean disabled )
+ {
+ this.disabled = disabled;
+ }
+
+ public List<String> getBlacklist()
+ {
+ return blacklist;
+ }
+
+ public void setBlacklist( List<String> blacklist )
+ {
+ this.blacklist = blacklist;
+ }
+
+ public ManagedRepositoryContent getSourceRepository()
+ {
+ return sourceRepository;
+ }
+
+ public void setSourceRepository( ManagedRepositoryContent sourceRepository )
+ {
+ this.sourceRepository = sourceRepository;
+ }
+
+ public RemoteRepositoryContent getTargetRepository()
+ {
+ return targetRepository;
+ }
+
+ public void setTargetRepository( RemoteRepositoryContent targetRepository )
+ {
+ this.targetRepository = targetRepository;
+ }
+
+ public List<String> getWhitelist()
+ {
+ return whitelist;
+ }
+
+ public void setWhitelist( List<String> whitelist )
+ {
+ this.whitelist = whitelist;
+ }
+
+ public Map<String, String> getPolicies()
+ {
+ return policies;
+ }
+
+ public void setPolicies( Map<String, String> policies )
+ {
+ this.policies = policies;
+ }
+
+ public String getProxyId()
+ {
+ return proxyId;
+ }
+
+ public void setProxyId( String proxyId )
+ {
+ this.proxyId = proxyId;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append( "ProxyConnector[\n" );
+ sb.append( " source: [managed] " ).append( this.sourceRepository.getRepoRoot() ).append( "\n" );
+ sb.append( " target: [remote] " ).append( this.targetRepository.getRepository().getUrl() ).append( "\n" );
+ sb.append( " proxyId:" ).append( this.proxyId ).append( "\n" );
+
+ Iterator<String> keys = this.policies.keySet().iterator();
+ while ( keys.hasNext() )
+ {
+ String name = keys.next();
+ sb.append( " policy[" ).append( name ).append( "]:" );
+ sb.append( this.policies.get( name ) ).append( "\n" );
+ }
+
+ sb.append( "]" );
+
+ return sb.toString();
+ }
+
+ public void setPolicy( String policyId, String policySetting )
+ {
+ this.policies.put( policyId, policySetting );
+ }
+
+ public int getOrder()
+ {
+ return order;
+ }
+
+ public void setOrder( int order )
+ {
+ this.order = order;
+ }
+}