1 package org.apache.archiva.proxy.common;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.apache.archiva.admin.model.beans.NetworkProxy;
23 import java.util.HashMap;
27 * @author Olivier Lamy
30 public class WagonFactoryRequest
33 * the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example
34 * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b>
36 private String protocol;
38 private Map<String, String> headers = new HashMap<>();
40 private String userAgent = "Java-Archiva";
42 private NetworkProxy networkProxy;
44 public WagonFactoryRequest()
49 public WagonFactoryRequest( String protocol, Map<String, String> headers )
51 this.protocol = protocol;
52 this.headers = headers;
55 public String getProtocol()
60 public void setProtocol( String protocol )
62 this.protocol = protocol;
65 public WagonFactoryRequest protocol( String protocol )
67 this.protocol = protocol;
71 public Map<String, String> getHeaders()
73 if ( this.headers == null )
75 this.headers = new HashMap<>();
80 public void setHeaders( Map<String, String> headers )
82 this.headers = headers;
85 public WagonFactoryRequest headers( Map<String, String> headers )
87 this.headers = headers;
91 public String getUserAgent()
96 public void setUserAgent( String userAgent )
98 this.userAgent = userAgent;
101 public WagonFactoryRequest userAgent( String userAgent )
103 this.userAgent = userAgent;
107 public NetworkProxy getNetworkProxy()
112 public void setNetworkProxy( NetworkProxy networkProxy )
114 this.networkProxy = networkProxy;
117 public WagonFactoryRequest networkProxy( NetworkProxy networkProxy )
119 this.networkProxy = networkProxy;
124 public boolean equals( Object o )
130 if ( !( o instanceof WagonFactoryRequest ) )
135 WagonFactoryRequest that = (WagonFactoryRequest) o;
137 if ( protocol != null ? !protocol.equals( that.protocol ) : that.protocol != null )
141 if ( userAgent != null ? !userAgent.equals( that.userAgent ) : that.userAgent != null )
150 public int hashCode()
152 int result = protocol != null ? protocol.hashCode() : 0;
153 result = 31 * result + ( userAgent != null ? userAgent.hashCode() : 0 );
158 public String toString()
160 return "WagonFactoryRequest{" +
161 "protocol='" + protocol + '\'' +
162 ", headers=" + headers +
163 ", userAgent='" + userAgent + '\'' +
164 ", networkProxy=" + networkProxy +