|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.httpclient.HostConfiguration
public class HostConfiguration
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.
| Field Summary | |
|---|---|
static HostConfiguration |
ANY_HOST_CONFIGURATION
A value to represent any host configuration, instead of using something like null. |
| Constructor Summary | |
|---|---|
HostConfiguration()
Constructor for HostConfiguration. |
|
HostConfiguration(HostConfiguration hostConfiguration)
Copy constructor for HostConfiguration |
|
| Method Summary | |
|---|---|
Object |
clone()
|
boolean |
equals(Object o)
|
String |
getHost()
Returns the host. |
String |
getHostURL()
Return the host url. |
InetAddress |
getLocalAddress()
Return the local address to be used when creating connections. |
HostParams |
getParams()
Returns HTTP protocol parameters associated with this host. |
int |
getPort()
Returns the port. |
Protocol |
getProtocol()
Returns the protocol. |
String |
getProxyHost()
Returns the proxyHost. |
int |
getProxyPort()
Returns the proxyPort. |
String |
getVirtualHost()
Deprecated. use HostParams |
int |
hashCode()
|
boolean |
hostEquals(HttpConnection connection)
Tests if the host configuration equals the configuration set on the connection. |
boolean |
isHostSet()
Deprecated. no longer used |
boolean |
isProxySet()
Deprecated. no longer used |
boolean |
proxyEquals(HttpConnection connection)
Tests if the proxy configuration equals the configuration set on the connection. |
void |
setHost(HttpHost host)
Sets the given host |
void |
setHost(String host)
Set the given host. |
void |
setHost(String host,
int port)
Sets the given host and port. |
void |
setHost(String host,
int port,
Protocol protocol)
Sets the given host, port and protocol. |
void |
setHost(String host,
int port,
String protocol)
Sets the given host, port and protocol |
void |
setHost(String host,
String virtualHost,
int port,
Protocol protocol)
Deprecated. #setHost(String, int, Protocol) |
void |
setHost(URI uri)
Sets the protocol, host and port from the given URI. |
void |
setLocalAddress(InetAddress localAddress)
Set the local address to be used when creating connections. |
void |
setParams(HostParams params)
Assigns HTTP protocol parameters specific to this host. |
void |
setProxy(String proxyHost,
int proxyPort)
Set the proxy settings. |
void |
setProxyHost(ProxyHost proxyHost)
Sets the given proxy host |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final HostConfiguration ANY_HOST_CONFIGURATION
null. This value should be treated as immutable and only used in
lookups and other such places to represent "any" host config.
| Constructor Detail |
|---|
public HostConfiguration()
public HostConfiguration(HostConfiguration hostConfiguration)
hostConfiguration - the hostConfiguration to copy| Method Detail |
|---|
public Object clone()
clone in class ObjectObject.clone()public String toString()
toString in class ObjectObject.toString()public boolean hostEquals(HttpConnection connection)
connection - the connection to test against
true if the connection's host information equals that of this
configurationproxyEquals(HttpConnection)public boolean proxyEquals(HttpConnection connection)
connection - the connection to test against
true if the connection's proxy information equals that of this
configurationhostEquals(HttpConnection)public boolean isHostSet()
true if the host is set.public void setHost(HttpHost host)
host - the host
public void setHost(String host,
int port,
String protocol)
host - the host(IP or DNS name)port - The portprotocol - The protocol.
public void setHost(String host,
String virtualHost,
int port,
Protocol protocol)
host - the host(IP or DNS name)virtualHost - the virtual host name or nullport - the host port or -1 to use protocol defaultprotocol - the protocol
public void setHost(String host,
int port,
Protocol protocol)
host - the host(IP or DNS name)port - The portprotocol - the protocol
public void setHost(String host,
int port)
host - the host(IP or DNS name)port - The portpublic void setHost(String host)
host - The host(IP or DNS name).public void setHost(URI uri)
uri - the URI.public String getHostURL()
public String getHost()
null if not setisHostSet()public String getVirtualHost()
null if not setpublic int getPort()
-1 if not setisHostSet()public Protocol getProtocol()
public boolean isProxySet()
true if a proxy server has been set.setProxy(String, int)public void setProxyHost(ProxyHost proxyHost)
proxyHost - the proxy host
public void setProxy(String proxyHost,
int proxyPort)
proxyHost - The proxy hostproxyPort - The proxy portpublic String getProxyHost()
null if not setisProxySet()public int getProxyPort()
-1 if not setisProxySet()public void setLocalAddress(InetAddress localAddress)
localAddress - the local address to usepublic InetAddress getLocalAddress()
nullpublic HostParams getParams()
HTTP protocol parameters associated with this host.
public void setParams(HostParams params)
HTTP protocol parameters specific to this host.
HostParamspublic boolean equals(Object o)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||