public class HostConfiguration
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static HostConfiguration |
ANY_HOST_CONFIGURATION
A value to represent any host configuration, instead of using something like
null . |
Constructor and Description |
---|
HostConfiguration()
Constructor for HostConfiguration.
|
HostConfiguration(HostConfiguration hostConfiguration)
Copy constructor for HostConfiguration
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getHost()
Returns the host.
|
java.lang.String |
getHostURL()
Return the host url.
|
java.net.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.
|
java.lang.String |
getProxyHost()
Returns the proxyHost.
|
int |
getProxyPort()
Returns the proxyPort.
|
java.lang.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(java.lang.String host)
Set the given host.
|
void |
setHost(java.lang.String host,
int port)
Sets the given host and port.
|
void |
setHost(java.lang.String host,
int port,
Protocol protocol)
Sets the given host, port and protocol.
|
void |
setHost(java.lang.String host,
int port,
java.lang.String protocol)
Sets the given host, port and protocol
|
void |
setHost(java.lang.String host,
java.lang.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(java.net.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(java.lang.String proxyHost,
int proxyPort)
Set the proxy settings.
|
void |
setProxyHost(ProxyHost proxyHost)
Sets the given proxy host
|
java.lang.String |
toString() |
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.public HostConfiguration()
public HostConfiguration(HostConfiguration hostConfiguration)
hostConfiguration
- the hostConfiguration to copypublic java.lang.Object clone()
clone
in class java.lang.Object
Object.clone()
public java.lang.String toString()
toString
in class java.lang.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)
public boolean proxyEquals(HttpConnection connection)
connection
- the connection to test againsttrue
if the connection's proxy information equals that of this
configurationhostEquals(HttpConnection)
@Deprecated public boolean isHostSet()
true
if the host is set.public void setHost(HttpHost host)
host
- the hostpublic void setHost(java.lang.String host, int port, java.lang.String protocol)
host
- the host(IP or DNS name)port
- The portprotocol
- The protocol.@Deprecated public void setHost(java.lang.String host, java.lang.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(java.lang.String host, int port, Protocol protocol)
host
- the host(IP or DNS name)port
- The portprotocol
- the protocolpublic void setHost(java.lang.String host, int port)
host
- the host(IP or DNS name)port
- The portpublic void setHost(java.lang.String host)
host
- The host(IP or DNS name).public void setHost(URI uri)
uri
- the URI.public java.lang.String getHostURL()
public java.lang.String getHost()
null
if not setisHostSet()
@Deprecated public java.lang.String getVirtualHost()
null
if not setpublic int getPort()
-1
if not setisHostSet()
public Protocol getProtocol()
@Deprecated public boolean isProxySet()
true
if a proxy server has been set.setProxy(String, int)
public void setProxyHost(ProxyHost proxyHost)
proxyHost
- the proxy hostpublic void setProxy(java.lang.String proxyHost, int proxyPort)
proxyHost
- The proxy hostproxyPort
- The proxy portpublic java.lang.String getProxyHost()
null
if not setisProxySet()
public int getProxyPort()
-1
if not setisProxySet()
public void setLocalAddress(java.net.InetAddress localAddress)
localAddress
- the local address to usepublic java.net.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.HostParams
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"