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 public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
68 this.protocol = protocol;
71 this.username = username;
72 this.password = password;
80 public void setId( String id )
85 public String getProtocol()
90 public void setProtocol( String protocol )
92 this.protocol = protocol;
95 public String getHost()
100 public void setHost( String host )
110 public void setPort( int port )
115 public String getUsername()
120 public void setUsername( String username )
122 this.username = username;
125 public String getPassword()
130 public void setPassword( String password )
132 this.password = password;
136 public boolean equals( Object o )
142 if ( o == null || getClass() != o.getClass() )
147 NetworkProxy that = (NetworkProxy) o;
149 if ( id != null ? !id.equals( that.id ) : that.id != null )
158 public int hashCode()
161 result = 37 * result + ( id != null ? id.hashCode() : 0 );
166 public String toString()
168 final StringBuilder sb = new StringBuilder();
169 sb.append( "NetworkProxy" );
170 sb.append( "{id='" ).append( id ).append( '\'' );
171 sb.append( ", protocol='" ).append( protocol ).append( '\'' );
172 sb.append( ", host='" ).append( host ).append( '\'' );
173 sb.append( ", port=" ).append( port );
174 sb.append( ", username='" ).append( username ).append( '\'' );
175 sb.append( ", password='" ).append( password ).append( '\'' );
177 return sb.toString();