| java.lang.Object org.apache.commons.httpclient.HostConfiguration
All known Subclasses: org.apache.commons.httpclient.contrib.ssl.HostConfigurationWithHostFactory, org.apache.commons.httpclient.contrib.ssl.HostConfigurationWithStickyProtocol,
HostConfiguration | public class HostConfiguration implements Cloneable(Code) | | 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.
author: Michael Becke author: Mike Bowler author: Oleg Kalnichevski author: Laura Werner since: 2.0 |
Method Summary | |
public Object | clone() | public synchronized boolean | equals(Object o) | public synchronized String | getHost() Returns the host. | public synchronized String | getHostURL() Return the host url. | public synchronized InetAddress | getLocalAddress() Return the local address to be used when creating connections. | public HostParams | getParams() Returns
HostParams HTTP protocol parameters associated with this host. | public synchronized int | getPort() Returns the port. | public synchronized Protocol | getProtocol() Returns the protocol. | public synchronized String | getProxyHost() Returns the proxyHost. | public synchronized int | getProxyPort() Returns the proxyPort. | public synchronized String | getVirtualHost() Returns the virtual host. | public synchronized int | hashCode() | public synchronized boolean | hostEquals(HttpConnection connection) Tests if the host configuration equals the configuration set on the
connection. | public synchronized boolean | isHostSet() Returns true if the host is set. | public synchronized boolean | isProxySet() Tests if the proxy host/port have been set. | public synchronized boolean | proxyEquals(HttpConnection connection) Tests if the proxy configuration equals the configuration set on the
connection. | public synchronized void | setHost(HttpHost host) | public synchronized void | setHost(String host, int port, String protocol) | public synchronized void | setHost(String host, String virtualHost, int port, Protocol protocol) Sets the given host, virtual host, port and protocol. | public synchronized void | setHost(String host, int port, Protocol protocol) Sets the given host, port and protocol. | public synchronized void | setHost(String host, int port) Sets the given host and port. | public synchronized void | setHost(String host) Set the given host. | public synchronized void | setHost(URI uri) Sets the protocol, host and port from the given URI. | public synchronized void | setLocalAddress(InetAddress localAddress) Set the local address to be used when creating connections. | public void | setParams(HostParams params) Assigns
HostParams HTTP protocol parameters specific to this host. | public synchronized void | setProxy(String proxyHost, int proxyPort) Set the proxy settings. | public synchronized void | setProxyHost(ProxyHost proxyHost) | public synchronized String | toString() |
ANY_HOST_CONFIGURATION | final public static HostConfiguration ANY_HOST_CONFIGURATION(Code) | | A value to represent any host configuration, instead of using something like
null . This value should be treated as immutable and only used in
lookups and other such places to represent "any" host config.
|
HostConfiguration | public HostConfiguration()(Code) | | Constructor for HostConfiguration.
|
HostConfiguration | public HostConfiguration(HostConfiguration hostConfiguration)(Code) | | Copy constructor for HostConfiguration
Parameters: hostConfiguration - the hostConfiguration to copy |
getHostURL | public synchronized String getHostURL()(Code) | | Return the host url.
The host url. |
getLocalAddress | public synchronized InetAddress getLocalAddress()(Code) | | Return the local address to be used when creating connections.
If this is unset, the default address should be used.
the local address to be used when creating Sockets, or null |
getParams | public HostParams getParams()(Code) | | Returns
HostParams HTTP protocol parameters associated with this host.
HTTP parameters. since: 3.0 |
getProtocol | public synchronized Protocol getProtocol()(Code) | | Returns the protocol.
The protocol. |
getVirtualHost | public synchronized String getVirtualHost()(Code) | | Returns the virtual host.
the virtual host name, or null if not set |
hostEquals | public synchronized boolean hostEquals(HttpConnection connection)(Code) | | Tests if the host configuration equals the configuration set on the
connection. True only if the host, port, protocol, local address and virtual address
are equal. If no host configuration has been set false will be returned.
Parameters: connection - the connection to test against true if the connection's host information equals that of thisconfiguration See Also: HostConfiguration.proxyEquals(HttpConnection) |
isHostSet | public synchronized boolean isHostSet()(Code) | | Returns true if the host is set.
true if the host is set. |
proxyEquals | public synchronized boolean proxyEquals(HttpConnection connection)(Code) | | Tests if the proxy configuration equals the configuration set on the
connection. True only if the proxyHost and proxyPort are equal.
Parameters: connection - the connection to test against true if the connection's proxy information equals that of thisconfiguration See Also: HostConfiguration.hostEquals(HttpConnection) |
setHost | public synchronized void setHost(HttpHost host)(Code) | | Sets the given host
Parameters: host - the host |
setHost | public synchronized void setHost(String host, int port, String protocol)(Code) | | Sets the given host, port and protocol
Parameters: host - the host(IP or DNS name) Parameters: port - The port Parameters: protocol - The protocol. |
setHost | public synchronized void setHost(String host, String virtualHost, int port, Protocol protocol)(Code) | | Sets the given host, virtual host, port and protocol.
Parameters: host - the host(IP or DNS name) Parameters: virtualHost - the virtual host name or null Parameters: port - the host port or -1 to use protocol default Parameters: protocol - the protocol |
setHost | public synchronized void setHost(String host, int port, Protocol protocol)(Code) | | Sets the given host, port and protocol.
Parameters: host - the host(IP or DNS name) Parameters: port - The port Parameters: protocol - the protocol |
setHost | public synchronized void setHost(String host, int port)(Code) | | Sets the given host and port. Uses the default protocol "http".
Parameters: host - the host(IP or DNS name) Parameters: port - The port |
setHost | public synchronized void setHost(String host)(Code) | | Set the given host. Uses the default protocol("http") and its port.
Parameters: host - The host(IP or DNS name). |
setHost | public synchronized void setHost(URI uri)(Code) | | Sets the protocol, host and port from the given URI.
Parameters: uri - the URI. |
setLocalAddress | public synchronized void setLocalAddress(InetAddress localAddress)(Code) | | Set the local address to be used when creating connections.
If this is unset, the default address will be used.
This is useful for specifying the interface to use on multi-homed or clustered systems.
Parameters: localAddress - the local address to use |
setProxy | public synchronized void setProxy(String proxyHost, int proxyPort)(Code) | | Set the proxy settings.
Parameters: proxyHost - The proxy host Parameters: proxyPort - The proxy port |
setProxyHost | public synchronized void setProxyHost(ProxyHost proxyHost)(Code) | | Sets the given proxy host
Parameters: proxyHost - the proxy host |
|
|