|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.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.
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. |
int |
getPort()
Returns the port. |
Protocol |
getProtocol()
Returns the protocol. |
String |
getProxyHost()
Returns the proxyHost. |
int |
getProxyPort()
Returns the proxyPort. |
String |
getVirtualHost()
Returns the virtual host. |
int |
hashCode()
|
boolean |
hostEquals(HttpConnection connection)
Tests if the host configuration equals the configuration set on the connection. |
boolean |
isHostSet()
Returns true if the host is set. |
boolean |
isProxySet()
Tests if the proxy host/port have been set. |
boolean |
proxyEquals(HttpConnection connection)
Tests if the proxy configuration equals the configuration set on the connection. |
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)
Sets the given host, virtual host, port and 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 |
setProxy(String proxyHost,
int proxyPort)
Set the proxy settings. |
String |
toString()
|
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public HostConfiguration()
public HostConfiguration(HostConfiguration hostConfiguration)
hostConfiguration
- the hostConfiguration to copyMethod Detail |
public Object clone()
clone
in class Object
Object.clone()
public String toString()
toString
in class Object
Object.toString()
public boolean hostEquals(HttpConnection connection)
connection
- the connection to test againsttrue
if the connection's host information equals that of this
configurationproxyEquals(HttpConnection)
,
isHostSet()
public boolean proxyEquals(HttpConnection connection)
connection
- the connection to test againsttrue
if the connection's proxy information equals that of this
configurationhostEquals(HttpConnection)
public boolean isHostSet()
true
if the host is set.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 null
port
- the host port or -1 to use protocol defaultprotocol
- the protocolpublic void setHost(String host, int port, Protocol protocol)
host
- the host(IP or DNS name)port
- The portprotocol
- the protocolpublic 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 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()
null
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |