org.apache.commons.httpclient
Class HttpHost
- Cloneable
public class HttpHost
implements Cloneable
Holds all of the variables needed to describe an HTTP connection to a host. This includes
remote host, port and protocol.
- Michael Becke
- Mike Bowler
- Oleg Kalnichevski
- Laura Werner
- 3.0
HttpHost(String hostname) - Constructor for HttpHost.
|
HttpHost(String hostname, int port) - Constructor for HttpHost.
|
HttpHost(String hostname, int port, Protocol protocol) - Constructor for HttpHost.
|
HttpHost(HttpHost httphost) - Copy constructor for HttpHost
|
HttpHost(URI uri) - URI constructor for HttpHost.
|
HttpHost
public HttpHost(String hostname)
Constructor for HttpHost.
hostname
- the hostname (IP or DNS name). Can be null
.
HttpHost
public HttpHost(String hostname,
int port)
Constructor for HttpHost.
hostname
- the hostname (IP or DNS name). Can be null
.port
- the port. Value -1
can be used to set default protocol port
HttpHost
public HttpHost(String hostname,
int port,
Protocol protocol)
Constructor for HttpHost.
hostname
- the hostname (IP or DNS name). Can be null
.port
- the port. Value -1
can be used to set default protocol portprotocol
- the protocol. Value null
can be used to set default protocol
HttpHost
public HttpHost(HttpHost httphost)
Copy constructor for HttpHost
httphost
- the HTTP host to copy details from
HttpHost
public HttpHost(URI uri)
throws URIException
URI constructor for HttpHost.
uri
- the URI.
clone
public Object clone()
java.lang.Object.clone()
equals
public boolean equals(Object o)
java.lang.Object.equals(java.lang.Object)
getHostName
public String getHostName()
Returns the host name (IP or DNS name).
- the host name (IP or DNS name), or
null
if not set
getPort
public int getPort()
Returns the port.
- the host port, or
-1
if not set
getProtocol
public Protocol getProtocol()
Returns the protocol.
- The protocol.
hashCode
public int hashCode()
java.lang.Object.hashCode()
toString
public String toString()
java.lang.Object.toString()
toURI
public String toURI()
Return the host uri.
- The host uri.
Copyright (c) 1999-2005 - Apache Software Foundation