Class HttpHost
java.lang.Object
org.apache.commons.httpclient.HttpHost
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ProxyHost
Holds all of the variables needed to describe an HTTP connection to a host. This includes
remote host, port and protocol.
- Since:
- 3.0
- Author:
- Michael Becke, Mike Bowler, Oleg Kalnichevski, Laura Werner
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for HttpHost.Constructor for HttpHost.Constructor for HttpHost.Copy constructor for HttpHostURI constructor for HttpHost. -
Method Summary
-
Constructor Details
-
HttpHost
-
HttpHost
Constructor for HttpHost.- Parameters:
hostname- the hostname (IP or DNS name). Can benull.port- the port. Value-1can be used to set default protocol port
-
HttpHost
Constructor for HttpHost.- Parameters:
hostname- the hostname (IP or DNS name). Can benull.
-
HttpHost
URI constructor for HttpHost.- Parameters:
uri- the URI.- Throws:
URIException
-
HttpHost
Copy constructor for HttpHost- Parameters:
httphost- the HTTP host to copy details from
-
-
Method Details
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
-
getHostName
Returns the host name (IP or DNS name).- Returns:
- the host name (IP or DNS name), or
nullif not set
-
getPort
public int getPort()Returns the port.- Returns:
- the host port, or
-1if not set
-
getProtocol
-
toURI
-
toString
-
equals
-
hashCode
-