|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.HttpHost
@Immutable public final class HttpHost
Holds all of the variables needed to describe an HTTP connection to a host. This includes remote host name, port and scheme.
| Field Summary | |
|---|---|
static String |
DEFAULT_SCHEME_NAME
The default scheme is "http". |
protected String |
hostname
The host to use. |
protected String |
lcHostname
The lowercase host, for equals(java.lang.Object) and hashCode(). |
protected int |
port
The port to use, defaults to -1 if not set. |
protected String |
schemeName
The scheme (lowercased) |
| Constructor Summary | |
|---|---|
HttpHost(HttpHost httphost)
Copy constructor for HttpHost. |
|
HttpHost(String hostname)
Creates a new HttpHost, with default scheme and port. |
|
HttpHost(String hostname,
int port)
Creates a new HttpHost, with default scheme. |
|
HttpHost(String hostname,
int port,
String scheme)
Creates a new HttpHost, specifying all values. |
|
| Method Summary | |
|---|---|
Object |
clone()
|
boolean |
equals(Object obj)
|
String |
getHostName()
Returns the host name. |
int |
getPort()
Returns the port. |
String |
getSchemeName()
Returns the scheme name. |
int |
hashCode()
|
String |
toHostString()
Obtains the host string, without scheme prefix. |
String |
toString()
|
String |
toURI()
Return the host URI, as a string. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_SCHEME_NAME
protected final String hostname
protected final String lcHostname
equals(java.lang.Object) and hashCode().
protected final int port
protected final String schemeName
| Constructor Detail |
|---|
public HttpHost(String hostname,
int port,
String scheme)
HttpHost, specifying all values.
Constructor for HttpHost.
hostname - the hostname (IP or DNS name)port - the port number.
-1 indicates the scheme default port.scheme - the name of the scheme.
null indicates the
default scheme
public HttpHost(String hostname,
int port)
HttpHost, with default scheme.
hostname - the hostname (IP or DNS name)port - the port number.
-1 indicates the scheme default port.public HttpHost(String hostname)
HttpHost, with default scheme and port.
hostname - the hostname (IP or DNS name)public HttpHost(HttpHost httphost)
HttpHost.
httphost - the HTTP host to copy details from| Method Detail |
|---|
public String getHostName()
public int getPort()
-1 if not setpublic String getSchemeName()
public String toURI()
public String toHostString()
localhost:8080public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class ObjectObject.hashCode()
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||