View Javadoc
1   package org.apache.maven.repository;
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   * Proxy
24   */
25  public class Proxy
26  {
27      public static final String PROXY_SOCKS5 = "SOCKS_5";
28  
29      public static final String PROXY_SOCKS4 = "SOCKS4";
30  
31      public static final String PROXY_HTTP = "HTTP";
32  
33      /**
34       * Proxy server host
35       */
36      private String host;
37  
38      /**
39       * Username used to access the proxy server
40       */
41      private String userName;
42  
43      /**
44       * Password associated with the proxy server
45       */
46      private String password;
47  
48      /**
49       * Proxy server port
50       */
51      private int port;
52  
53      /**
54       * Type of the proxy
55       */
56      private String protocol;
57  
58      /**
59       * The non-proxy hosts. Follows Java system property format: <code>*.foo.com|localhost</code>.
60       */
61      private String nonProxyHosts;
62  
63      /**
64       * For NTLM proxies, specifies the NTLM host.
65       */
66      private String ntlmHost;
67  
68      /**
69       * For NTLM proxies, specifies the NTLM domain.
70       */
71      private String ntlmDomain;
72  
73      /**
74       * Return proxy server host name.
75       *
76       * @return proxy server host name
77       */
78      public String getHost()
79      {
80          return host;
81      }
82  
83      /**
84       * Set proxy host name.
85       *
86       * @param host proxy server host name
87       */
88      public void setHost( String host )
89      {
90          this.host = host;
91      }
92  
93      /**
94       * Get user's password used to login to proxy server.
95       *
96       * @return user's password at proxy host
97       */
98      public String getPassword()
99      {
100         return password;
101     }
102 
103     /**
104      * Set the user's password for the proxy server.
105      *
106      * @param password password to use to login to a proxy server
107      */
108     public void setPassword( String password )
109     {
110         this.password = password;
111     }
112 
113     /**
114      * Get the proxy port.
115      *
116      * @return proxy server port
117      */
118     public int getPort()
119     {
120         return port;
121     }
122 
123     /**
124      * Set the proxy port.
125      *
126      * @param port proxy server port
127      */
128     public void setPort( int port )
129     {
130         this.port = port;
131     }
132 
133     /**
134      * Get the proxy username.
135      *
136      * @return username for the proxy server
137      */
138     public String getUserName()
139     {
140         return userName;
141     }
142 
143     /**
144      * Set the proxy username.
145      *
146      * @param userName username for the proxy server
147      */
148     public void setUserName( String userName )
149     {
150         this.userName = userName;
151     }
152 
153     /**
154      * Get the protocol of the proxy server.
155      *
156      * @return the protocol of the proxy server
157      */
158     public String getProtocol()
159     {
160         return protocol;
161     }
162 
163     /**
164      * @param protocol the protocol of the proxy server like <i>SOCKSv4</i>
165      */
166     public void setProtocol( String protocol )
167     {
168         this.protocol = protocol;
169     }
170 
171     public String getNonProxyHosts()
172     {
173         return nonProxyHosts;
174     }
175 
176     public void setNonProxyHosts( String nonProxyHosts )
177     {
178         this.nonProxyHosts = nonProxyHosts;
179     }
180 
181     public String getNtlmHost()
182     {
183         return ntlmHost;
184     }
185 
186     public void setNtlmHost( String ntlmHost )
187     {
188         this.ntlmHost = ntlmHost;
189     }
190 
191     public void setNtlmDomain( String ntlmDomain )
192     {
193         this.ntlmDomain = ntlmDomain;
194     }
195 
196     public String getNtlmDomain()
197     {
198         return ntlmDomain;
199     }
200 }