View Javadoc

1   /*
2    * $HeadURL: https://svn.apache.org/repos/asf/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/ProxyHost.java $
3    * $Revision$
4    * $Date$
5    *
6    * ====================================================================
7    *
8    *  Licensed to the Apache Software Foundation (ASF) under one or more
9    *  contributor license agreements.  See the NOTICE file distributed with
10   *  this work for additional information regarding copyright ownership.
11   *  The ASF licenses this file to You under the Apache License, Version 2.0
12   *  (the "License"); you may not use this file except in compliance with
13   *  the License.  You may obtain a copy of the License at
14   *
15   *      http://www.apache.org/licenses/LICENSE-2.0
16   *
17   *  Unless required by applicable law or agreed to in writing, software
18   *  distributed under the License is distributed on an "AS IS" BASIS,
19   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   *  See the License for the specific language governing permissions and
21   *  limitations under the License.
22   * ====================================================================
23   *
24   * This software consists of voluntary contributions made by many
25   * individuals on behalf of the Apache Software Foundation.  For more
26   * information on the Apache Software Foundation, please see
27   * <http://www.apache.org/>.
28   *
29   */
30  
31  package org.apache.commons.httpclient;
32  
33  import org.apache.commons.httpclient.protocol.Protocol;
34  
35  /***
36   * Holds all of the variables needed to describe an HTTP connection to a proxy. Proxy hosts
37   * always use plain HTTP connection when communicating with clients.
38   * 
39   * @author <a href="mailto:becke@u.washington.edu">Michael Becke</a>
40   * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
41   * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
42   * @author Laura Werner
43   * 
44   * @since 3.0 
45   */
46  public class ProxyHost extends HttpHost {
47  
48      /***
49       * Copy constructor for HttpHost
50       * 
51       * @param httpproxy the HTTP host to copy details from
52       */
53      public ProxyHost (final ProxyHost httpproxy) {
54          super(httpproxy);
55      }
56  
57      /***
58       * Constructor for ProxyHost.
59       *   
60       * @param hostname the hostname (IP or DNS name). Can be <code>null</code>.
61       * @param port the port. Value <code>-1</code> can be used to set default protocol port
62       */
63      public ProxyHost(final String hostname, int port) {
64          super(hostname, port, Protocol.getProtocol("http"));
65      }
66      
67      /***
68       * Constructor for HttpHost.
69       *   
70       * @param hostname the hostname (IP or DNS name). Can be <code>null</code>.
71       */
72      public ProxyHost(final String hostname) {
73          this(hostname, -1);
74      }
75      
76      /***
77       * @throws CloneNotSupportedException 
78       * @see java.lang.Object#clone()
79       */
80      public Object clone() throws CloneNotSupportedException {
81      	ProxyHost copy = (ProxyHost) super.clone();
82          return copy;
83      }    
84      
85  }