|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
int |
hashCode()
|
boolean |
hostEquals(HttpConnection connection)
Tests if the host configuration equals the configuration set on the connection. |
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(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 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 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 void setHost(HttpHost host)
host
- the hostpublic 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, 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 setpublic int getPort()
-1
if not setpublic Protocol getProtocol()
public void setProxyHost(ProxyHost proxyHost)
proxyHost
- the proxy hostpublic void setProxy(String proxyHost, int proxyPort)
proxyHost
- The proxy hostproxyPort
- The proxy portpublic String getProxyHost()
null
if not setpublic int getProxyPort()
-1
if not setpublic void setLocalAddress(InetAddress localAddress)
localAddress
- the local address to usepublic InetAddress getLocalAddress()
null
public HostParams getParams()
HTTP protocol parameters
associated with this host.
public void setParams(HostParams params)
HTTP protocol parameters
specific to this host.
params
- params to set. Cannot be null
HostParams
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |