1 package org.apache.archiva.admin.repository.networkproxy;
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 java.io.Serializable;
24 * @author Olivier Lamy
27 public class NetworkProxy
28 implements Serializable
33 * The network protocol to use with this proxy: "http", "socks-4"
36 private String protocol = "http";
46 private int port = 8080;
51 private String username;
56 private String password;
63 public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
66 this.protocol = protocol;
69 this.username = username;
70 this.password = password;
78 public void setId( String id )
83 public String getProtocol()
88 public void setProtocol( String protocol )
90 this.protocol = protocol;
93 public String getHost()
98 public void setHost( String host )
108 public void setPort( int port )
113 public String getUsername()
118 public void setUsername( String username )
120 this.username = username;
123 public String getPassword()
128 public void setPassword( String password )
130 this.password = password;
134 public boolean equals( Object o )
140 if ( o == null || getClass() != o.getClass() )
145 NetworkProxy that = (NetworkProxy) o;
147 if ( id != null ? !id.equals( that.id ) : that.id != null )
156 public int hashCode()
159 result = 37 * result + ( id != null ? id.hashCode() : 0 );
164 public String toString()
166 final StringBuilder sb = new StringBuilder();
167 sb.append( "NetworkProxy" );
168 sb.append( "{id='" ).append( id ).append( '\'' );
169 sb.append( ", protocol='" ).append( protocol ).append( '\'' );
170 sb.append( ", host='" ).append( host ).append( '\'' );
171 sb.append( ", port=" ).append( port );
172 sb.append( ", username='" ).append( username ).append( '\'' );
173 sb.append( ", password='" ).append( password ).append( '\'' );
175 return sb.toString();