mbecke      2003/09/04 19:09:41

  Modified:    httpclient/src/java/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH HostConfiguration.java
  Log:
  Javadoc cleanup.
  PR: 22073
  Submitted by: Michael Becke
  Reviewed by: Oleg Kalnichevski
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.11.2.2  +55 -40    
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HostConfiguration.java
  
  Index: HostConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HostConfiguration.java,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- HostConfiguration.java    31 Jul 2003 02:31:09 -0000      1.11.2.1
  +++ HostConfiguration.java    5 Sep 2003 02:09:41 -0000       1.11.2.2
  @@ -68,7 +68,9 @@
   import java.net.InetAddress;
   
   /**
  - *
  + * Holds all of the variables needed to describe an HTTP connection to a host.  
This includes 
  + * remote host, port and protocol, proxy host and port, local address, and virtual 
host.
  + * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Michael Becke</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Mike Bowler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Oleg Kalnichevski</a>
  @@ -151,8 +153,7 @@
        */
       public Object clone() {
           return new HostConfiguration(this);
  -    }
  -    
  +    }    
       
       /**
        * @see java.lang.Object#toString()
  @@ -196,15 +197,16 @@
       }    
       
       /**
  -     * Tests if the host configuration equals the configuraiton set on the
  -     * connection. True only if the host, port and protocol are equal.  If no
  -     * host configuration has been set false will be returned.
  +     * Tests if the host configuration equals the configuration set on the
  +     * connection. True only if the host, port, protocol, local address and virtual 
address
  +     * are equal.  If no host configuration has been set false will be returned.
        * 
        * @param connection the connection to test against
  -     * @return true if the connection's host information equals that of this
  +     * @return <code>true</code> if the connection's host information equals that 
of this
        * configuration
        * 
        * @see #proxyEquals(HttpConnection)
  +     * @see #isHostSet()
        */
       public synchronized boolean hostEquals(HttpConnection connection) {
           
  @@ -244,11 +246,11 @@
       }
   
       /**
  -     * Tests if the proxy configuration equals the configuraiton set on the
  +     * Tests if the proxy configuration equals the configuration set on the
        * connection. True only if the proxyHost and proxyPort are equal.
        *
        * @param connection the connection to test against
  -     * @return true if the connection's proxy information equals that of this
  +     * @return <code>true</code> if the connection's proxy information equals that 
of this
        * configuration
        *
        * @see #hostEquals(HttpConnection)
  @@ -263,21 +265,20 @@
                   && proxyPort == connection.getProxyPort()
               );
           }
  -        
       }    
       
       /**
  -     * Return true if the host is set.
  -     * @return boolean True if the host is set.
  +     * Returns true if the host is set.
  +     * @return <code>true</code> if the host is set.
        */
       public synchronized boolean isHostSet() {
           return hostSet;
       }
   
       /**
  -     *  Set the given host, port and protocol
  +     * Sets the given host, port and protocol
        * 
  -     * @param host the host, IP or DNS name
  +     * @param host the host(IP or DNS name)
        * @param port The port
        * @param protocol The protocol.
        */
  @@ -286,10 +287,10 @@
       }
       
       /**
  -     * Set the given host, virtual host, port and protocol.
  +     * Sets the given host, virtual host, port and protocol.
        * 
  -     * @param host the host, IP or DNS name
  -     * @param virtualHost the virtual host name
  +     * @param host the host(IP or DNS name)
  +     * @param virtualHost the virtual host name or <code>null</code>
        * @param port the host port or -1 to use protocol default
        * @param protocol the protocol
        */
  @@ -309,41 +310,39 @@
           this.protocol = protocol;
           
           this.hostSet = true;
  -        
       }
   
       /**
  -     *  Set the given host, port and protocol.
  +     * Sets the given host, port and protocol.
        *   
  -     * @param host the host, IP or DNS name
  +     * @param host the host(IP or DNS name)
        * @param port The port
        * @param protocol the protocol
        */
       public synchronized void setHost(String host, int port, Protocol protocol) {
           setHost(host, null, port, protocol);
       }
  -    
   
       /**
  -     *  Set the given host and port. Select default protocol. 
  -     * @param host the host, IP or DNS name
  +     * Sets the given host and port.  Uses the default protocol "http".
  +     * 
  +     * @param host the host(IP or DNS name)
        * @param port The port
        */
       public synchronized void setHost(String host, int port) {
           setHost(host, null, port, Protocol.getProtocol("http"));
       }
       
  -
       /**
  -     * Set the given host. Select default protocol and port. 
  -     * @param host The host.
  +     * Set the given host. Uses the default protocol("http") and its port.
  +     * 
  +     * @param host The host(IP or DNS name).
        */
       public synchronized void setHost(String host) {
           Protocol defaultProtocol = Protocol.getProtocol("http"); 
           setHost(host, null, defaultProtocol.getDefaultPort(), defaultProtocol);
       }
       
  -    
       /**
        * Sets the protocol, host and port from the given URI.
        * @param uri the URI.
  @@ -359,7 +358,7 @@
       /**
        * Return the host url.
        * 
  -     * @return String The host url.
  +     * @return The host url.
        */
       public synchronized String getHostURL() {
           
  @@ -376,12 +375,14 @@
           }
           
           return url;
  -        
       }
   
       /**
        * Returns the host.
  -     * @return String
  +     * 
  +     * @return the host(IP or DNS name), or <code>null</code> if not set
  +     * 
  +     * @see #isHostSet()
        */
       public synchronized String getHost() {
           return host;
  @@ -389,7 +390,8 @@
   
       /**
        * Returns the virtual host.
  -     * @return String
  +     * 
  +     * @return the virtual host name, or <code>null</code> if not set
        */
       public synchronized String getVirtualHost() {
           return virtualHost;
  @@ -397,7 +399,10 @@
   
       /**
        * Returns the port.
  -     * @return int
  +     * 
  +     * @return the host port, or <code>-1</code> if not set
  +     * 
  +     * @see #isHostSet()
        */
       public synchronized int getPort() {
           return port;
  @@ -405,14 +410,18 @@
   
       /**
        * Returns the protocol.
  -     * @return String The protocol.
  +     * @return The protocol.
        */
       public synchronized Protocol getProtocol() {
           return protocol;
       }
   
       /**
  -     * @return boolean True if a proxy server has been set.
  +     * Tests if the proxy host/port have been set.
  +     * 
  +     * @return <code>true</code> if a proxy server has been set.
  +     * 
  +     * @see #setProxy(String, int)
        */    
       public synchronized boolean isProxySet() {
           return proxySet;   
  @@ -433,7 +442,10 @@
   
       /**
        * Returns the proxyHost.
  -     * @return String
  +     * 
  +     * @return the proxy host, or <code>null</code> if not set
  +     * 
  +     * @see #isProxySet()
        */
       public synchronized String getProxyHost() {
           return proxyHost;
  @@ -441,7 +453,10 @@
   
       /**
        * Returns the proxyPort.
  -     * @return int
  +     * 
  +     * @return the proxy port, or <code>-1</code> if not set
  +     * 
  +     * @see #isProxySet()
        */
       public synchronized int getProxyPort() {
           return proxyPort;
  @@ -462,7 +477,7 @@
        * Return the local address to be used when creating connections.
        * If this is unset, the default address should be used.
        * 
  -     * @return InetAddress the local address to be used when creating Sockets
  +     * @return the local address to be used when creating Sockets, or 
<code>null</code>
        */
       public synchronized InetAddress getLocalAddress() {
           return this.localAddress;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to