1 package org.apache.archiva.admin.model.beans;
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 javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
25 * @author Olivier Lamy
28 @XmlRootElement( name = "networkProxy" )
29 public class NetworkProxy
30 implements Serializable
35 * The network protocol to use with this proxy: "http", "socks-4"
38 private String protocol = "http";
48 private int port = 8080;
53 private String username;
58 private String password;
65 private boolean useNtlm;
72 public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
75 this.protocol = protocol;
78 this.username = username;
79 this.password = password;
87 public void setId( String id )
92 public String getProtocol()
97 public void setProtocol( String protocol )
99 this.protocol = protocol;
102 public String getHost()
107 public void setHost( String host )
117 public void setPort( int port )
122 public String getUsername()
127 public void setUsername( String username )
129 this.username = username;
132 public String getPassword()
137 public void setPassword( String password )
139 this.password = password;
142 public boolean isUseNtlm()
147 public void setUseNtlm( boolean useNtlm )
149 this.useNtlm = useNtlm;
153 public boolean equals( Object o )
159 if ( o == null || getClass() != o.getClass() )
164 NetworkProxy that = (NetworkProxy) o;
166 if ( id != null ? !id.equals( that.id ) : that.id != null )
175 public int hashCode()
178 result = 37 * result + ( id != null ? id.hashCode() : 0 );
183 public String toString()
185 final StringBuilder sb = new StringBuilder();
186 sb.append( "NetworkProxy" );
187 sb.append( "{id='" ).append( id ).append( '\'' );
188 sb.append( ", protocol='" ).append( protocol ).append( '\'' );
189 sb.append( ", host='" ).append( host ).append( '\'' );
190 sb.append( ", port=" ).append( port );
191 sb.append( ", username='" ).append( username ).append( '\'' );
192 sb.append( ", password='" ).append( password ).append( '\'' );
193 sb.append( ", useNtlm=" ).append( useNtlm );
195 return sb.toString();