1 package org.apache.archiva.proxy.model;
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.repository.ManagedRepositoryContent;
23 import org.apache.archiva.repository.RemoteRepositoryContent;
24 import org.apache.archiva.repository.connector.RepositoryConnector;
26 import java.util.Iterator;
27 import java.util.List;
31 * This represents a connector for a repository to repository proxy.
33 public class ProxyConnector
34 implements RepositoryConnector
36 private ManagedRepositoryContent sourceRepository;
38 private RemoteRepositoryContent targetRepository;
40 private List<String> blacklist;
42 private List<String> whitelist;
44 private String proxyId;
48 private Map<String, String> policies;
50 private boolean disabled;
52 public ProxyConnector()
58 public boolean isDisabled()
64 public void setDisabled( boolean disabled )
66 this.disabled = disabled;
70 public List<String> getBlacklist()
75 public void setBlacklist( List<String> blacklist )
77 this.blacklist = blacklist;
81 public ManagedRepositoryContent getSourceRepository()
83 return sourceRepository;
86 public void setSourceRepository( ManagedRepositoryContent sourceRepository )
88 this.sourceRepository = sourceRepository;
92 public RemoteRepositoryContent getTargetRepository()
94 return targetRepository;
97 public void setTargetRepository( RemoteRepositoryContent targetRepository )
99 this.targetRepository = targetRepository;
103 public List<String> getWhitelist()
108 public void setWhitelist( List<String> whitelist )
110 this.whitelist = whitelist;
113 public Map<String, String> getPolicies()
118 public void setPolicies( Map<String, String> policies )
120 this.policies = policies;
123 public String getProxyId()
128 public void setProxyId( String proxyId )
130 this.proxyId = proxyId;
134 public String toString()
136 StringBuilder sb = new StringBuilder();
138 sb.append( "ProxyConnector[\n" );
139 sb.append( " source: [managed] " ).append( this.sourceRepository.getRepoRoot() ).append( "\n" );
140 sb.append( " target: [remote] " ).append( this.targetRepository.getRepository().getUrl() ).append( "\n" );
141 sb.append( " proxyId:" ).append( this.proxyId ).append( "\n" );
143 Iterator<String> keys = this.policies.keySet().iterator();
144 while ( keys.hasNext() )
146 String name = keys.next();
147 sb.append( " policy[" ).append( name ).append( "]:" );
148 sb.append( this.policies.get( name ) ).append( "\n" );
153 return sb.toString();
156 public void setPolicy( String policyId, String policySetting )
158 this.policies.put( policyId, policySetting );
161 public int getOrder()
166 public void setOrder( int order )