org.apache.http
Class HttpHost

java.lang.Object
  extended by org.apache.http.HttpHost

public class HttpHost
extends java.lang.Object

Holds all of the variables needed to describe an HTTP connection to a host. This includes remote host name, port and scheme.

Since:
4.0
Author:
Michael Becke, Mike Bowler, Oleg Kalnichevski, Laura Werner

Field Summary
static java.lang.String DEFAULT_SCHEME_NAME
          The default scheme is "http".
 
Constructor Summary
HttpHost(HttpHost httphost)
          Copy constructor for HttpHost
HttpHost(java.lang.String hostname)
          Constructor for HttpHost.
HttpHost(java.lang.String hostname, int port)
          Constructor for HttpHost.
HttpHost(java.lang.String hostname, int port, java.lang.String schemeName)
          Constructor for HttpHost.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getHostName()
          Returns the host name (IP or DNS name).
 int getPort()
          Returns the port.
 java.lang.String getSchemeName()
          Returns the scheme.
 int hashCode()
           
 java.lang.String toHostString()
           
 java.lang.String toString()
           
 java.lang.String toURI()
          Return the host uri.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SCHEME_NAME

public static final java.lang.String DEFAULT_SCHEME_NAME
The default scheme is "http".

See Also:
Constant Field Values
Constructor Detail

HttpHost

public HttpHost(java.lang.String hostname,
                int port,
                java.lang.String schemeName)
Constructor for HttpHost.

Parameters:
hostname - the hostname (IP or DNS name). Can be null.
port - the port. Value -1 can be used to set default scheme port
schemeName - the name of the scheme. Value null can be used to set default scheme

HttpHost

public HttpHost(java.lang.String hostname,
                int port)
Constructor for HttpHost.

Parameters:
hostname - the hostname (IP or DNS name). Can be null.
port - the port. Value -1 can be used to set default scheme port

HttpHost

public HttpHost(java.lang.String hostname)
Constructor for HttpHost.

Parameters:
hostname - the hostname (IP or DNS name). Can be null.

HttpHost

public HttpHost(HttpHost httphost)
Copy constructor for HttpHost

Parameters:
httphost - the HTTP host to copy details from
Method Detail

getHostName

public java.lang.String getHostName()
Returns the host name (IP or DNS name).

Returns:
the host name (IP or DNS name), or null if not set

getPort

public int getPort()
Returns the port.

Returns:
the host port, or -1 if not set

getSchemeName

public java.lang.String getSchemeName()
Returns the scheme.

Returns:
The scheme.

toURI

public java.lang.String toURI()
Return the host uri.

Returns:
The host uri.

toHostString

public java.lang.String toHostString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.