1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.maven.repository; 20 21 /** 22 * Proxy 23 */ 24 public class Proxy { 25 public static final String PROXY_SOCKS5 = "SOCKS_5"; 26 27 public static final String PROXY_SOCKS4 = "SOCKS4"; 28 29 public static final String PROXY_HTTP = "HTTP"; 30 31 /** 32 * Proxy server host 33 */ 34 private String host; 35 36 /** 37 * Username used to access the proxy server 38 */ 39 private String userName; 40 41 /** 42 * Password associated with the proxy server 43 */ 44 private String password; 45 46 /** 47 * Proxy server port 48 */ 49 private int port; 50 51 /** 52 * Type of the proxy 53 */ 54 private String protocol; 55 56 /** 57 * The non-proxy hosts. Follows Java system property format: <code>*.foo.com|localhost</code>. 58 */ 59 private String nonProxyHosts; 60 61 /** 62 * For NTLM proxies, specifies the NTLM host. 63 */ 64 private String ntlmHost; 65 66 /** 67 * For NTLM proxies, specifies the NTLM domain. 68 */ 69 private String ntlmDomain; 70 71 /** 72 * Return proxy server host name. 73 * 74 * @return proxy server host name 75 */ 76 public String getHost() { 77 return host; 78 } 79 80 /** 81 * Set proxy host name. 82 * 83 * @param host proxy server host name 84 */ 85 public void setHost(String host) { 86 this.host = host; 87 } 88 89 /** 90 * Get user's password used to log in to proxy server. 91 * 92 * @return user's password at proxy host 93 */ 94 public String getPassword() { 95 return password; 96 } 97 98 /** 99 * Set the user's password for the proxy server. 100 * 101 * @param password password to use to log in to a proxy server 102 */ 103 public void setPassword(String password) { 104 this.password = password; 105 } 106 107 /** 108 * Get the proxy port. 109 * 110 * @return proxy server port 111 */ 112 public int getPort() { 113 return port; 114 } 115 116 /** 117 * Set the proxy port. 118 * 119 * @param port proxy server port 120 */ 121 public void setPort(int port) { 122 this.port = port; 123 } 124 125 /** 126 * Get the proxy username. 127 * 128 * @return username for the proxy server 129 */ 130 public String getUserName() { 131 return userName; 132 } 133 134 /** 135 * Set the proxy username. 136 * 137 * @param userName username for the proxy server 138 */ 139 public void setUserName(String userName) { 140 this.userName = userName; 141 } 142 143 /** 144 * Get the protocol of the proxy server. 145 * 146 * @return the protocol of the proxy server 147 */ 148 public String getProtocol() { 149 return protocol; 150 } 151 152 /** 153 * @param protocol the protocol of the proxy server like <i>SOCKSv4</i> 154 */ 155 public void setProtocol(String protocol) { 156 this.protocol = protocol; 157 } 158 159 public String getNonProxyHosts() { 160 return nonProxyHosts; 161 } 162 163 public void setNonProxyHosts(String nonProxyHosts) { 164 this.nonProxyHosts = nonProxyHosts; 165 } 166 167 public String getNtlmHost() { 168 return ntlmHost; 169 } 170 171 public void setNtlmHost(String ntlmHost) { 172 this.ntlmHost = ntlmHost; 173 } 174 175 public void setNtlmDomain(String ntlmDomain) { 176 this.ntlmDomain = ntlmDomain; 177 } 178 179 public String getNtlmDomain() { 180 return ntlmDomain; 181 } 182 }