org.apache.commons.httpclient
public class HostConfiguration extends Object implements Cloneable
Since: 2.0
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()
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(HttpHost host)
Sets the given host
|
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(String host, int port, Protocol protocol)
Sets the given host, port and protocol.
|
void | setHost(String host, int port)
Sets the given host and port. |
void | setHost(String host)
Set the given host. |
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() |
null
. This value should be treated as immutable and only used in
lookups and other such places to represent "any" host config.Parameters: hostConfiguration the hostConfiguration to copy
See Also: java.lang.Object#clone()
See Also: java.lang.Object#equals(java.lang.Object)
Returns: the host(IP or DNS name), or null
if not set
See Also: isHostSet
Returns: The host url.
Returns: the local address to be used when creating Sockets, or null
Returns: the host port, or -1
if not set
See Also: isHostSet
Returns: The protocol.
Returns: the proxy host, or null
if not set
See Also: isProxySet
Returns: the proxy port, or -1
if not set
See Also: isProxySet
Deprecated: use HostParams
Returns the virtual host.Returns: the virtual host name, or null
if not set
See Also: java.lang.Object#hashCode()
Parameters: connection the connection to test against
Returns: true
if the connection's host information equals that of this
configuration
See Also: proxyEquals
Deprecated: no longer used
Returns true if the host is set.Returns: true
if the host is set.
Deprecated: no longer used
Tests if the proxy host/port have been set.Returns: true
if a proxy server has been set.
Parameters: connection the connection to test against
Returns: true
if the connection's proxy information equals that of this
configuration
See Also: hostEquals
Parameters: host the host
Parameters: host the host(IP or DNS name) port The port protocol The protocol.
Deprecated: #setHost(String, int, Protocol)
Sets the given host, virtual host, port and protocol.Parameters: host the host(IP or DNS name) virtualHost the virtual host name or null
port the host port or -1 to use protocol default protocol the protocol
Parameters: host the host(IP or DNS name) port The port protocol the protocol
Parameters: host the host(IP or DNS name) port The port
Parameters: host The host(IP or DNS name).
Parameters: uri the URI.
Parameters: localAddress the local address to use
Parameters: proxyHost The proxy host proxyPort The proxy port
Parameters: proxyHost the proxy host
See Also: java.lang.Object#toString()