1 package org.apache.archiva.configuration; 2 3 /* 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 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 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 19 * under the License. 20 */ 21 22 /** 23 * Class NetworkProxyConfiguration. 24 * 25 * @version $Revision$ $Date$ 26 */ 27 @SuppressWarnings( "all" ) 28 public class NetworkProxyConfiguration 29 implements java.io.Serializable 30 { 31 32 //--------------------------/ 33 //- Class/Member Variables -/ 34 //--------------------------/ 35 36 /** 37 * 38 * The ID for this proxy. 39 * 40 */ 41 private String id; 42 43 /** 44 * 45 * The network protocol to use with this proxy: 46 * "http", "socks-4" 47 * . 48 */ 49 private String protocol = "http"; 50 51 /** 52 * 53 * The proxy host. 54 * 55 */ 56 private String host; 57 58 /** 59 * 60 * The proxy port. 61 * 62 */ 63 private int port = 8080; 64 65 /** 66 * 67 * The proxy user. 68 * 69 */ 70 private String username; 71 72 /** 73 * 74 * The proxy password. 75 * 76 */ 77 private String password; 78 79 /** 80 * 81 * Use ntlm authentification. 82 * 83 */ 84 private boolean useNtlm = false; 85 86 87 //-----------/ 88 //- Methods -/ 89 //-----------/ 90 91 /** 92 * Get the proxy host. 93 * 94 * @return String 95 */ 96 public String getHost() 97 { 98 return this.host; 99 } //-- String getHost() 100 101 /** 102 * Get the ID for this proxy. 103 * 104 * @return String 105 */ 106 public String getId() 107 { 108 return this.id; 109 } //-- String getId() 110 111 /** 112 * Get the proxy password. 113 * 114 * @return String 115 */ 116 public String getPassword() 117 { 118 return this.password; 119 } //-- String getPassword() 120 121 /** 122 * Get the proxy port. 123 * 124 * @return int 125 */ 126 public int getPort() 127 { 128 return this.port; 129 } //-- int getPort() 130 131 /** 132 * Get the network protocol to use with this proxy: "http", 133 * "socks-4". 134 * 135 * @return String 136 */ 137 public String getProtocol() 138 { 139 return this.protocol; 140 } //-- String getProtocol() 141 142 /** 143 * Get the proxy user. 144 * 145 * @return String 146 */ 147 public String getUsername() 148 { 149 return this.username; 150 } //-- String getUsername() 151 152 /** 153 * Get use ntlm authentification. 154 * 155 * @return boolean 156 */ 157 public boolean isUseNtlm() 158 { 159 return this.useNtlm; 160 } //-- boolean isUseNtlm() 161 162 /** 163 * Set the proxy host. 164 * 165 * @param host 166 */ 167 public void setHost( String host ) 168 { 169 this.host = host; 170 } //-- void setHost( String ) 171 172 /** 173 * Set the ID for this proxy. 174 * 175 * @param id 176 */ 177 public void setId( String id ) 178 { 179 this.id = id; 180 } //-- void setId( String ) 181 182 /** 183 * Set the proxy password. 184 * 185 * @param password 186 */ 187 public void setPassword( String password ) 188 { 189 this.password = password; 190 } //-- void setPassword( String ) 191 192 /** 193 * Set the proxy port. 194 * 195 * @param port 196 */ 197 public void setPort( int port ) 198 { 199 this.port = port; 200 } //-- void setPort( int ) 201 202 /** 203 * Set the network protocol to use with this proxy: "http", 204 * "socks-4". 205 * 206 * @param protocol 207 */ 208 public void setProtocol( String protocol ) 209 { 210 this.protocol = protocol; 211 } //-- void setProtocol( String ) 212 213 /** 214 * Set use ntlm authentification. 215 * 216 * @param useNtlm 217 */ 218 public void setUseNtlm( boolean useNtlm ) 219 { 220 this.useNtlm = useNtlm; 221 } //-- void setUseNtlm( boolean ) 222 223 /** 224 * Set the proxy user. 225 * 226 * @param username 227 */ 228 public void setUsername( String username ) 229 { 230 this.username = username; 231 } //-- void setUsername( String ) 232 233 234 public int hashCode() 235 { 236 int result = 17; 237 result = 37 * result + ( id != null ? id.hashCode() : 0 ); 238 return result; 239 } 240 241 public boolean equals( Object other ) 242 { 243 if ( this == other ) 244 { 245 return true; 246 } 247 248 if ( !( other instanceof NetworkProxyConfiguration ) ) 249 { 250 return false; 251 } 252 253 NetworkProxyConfigurationpache/archiva/configuration/NetworkProxyConfiguration.html#NetworkProxyConfiguration">NetworkProxyConfiguration that = (NetworkProxyConfiguration) other; 254 boolean result = true; 255 result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) ); 256 return result; 257 } 258 259 }