Package org.apache.commons.httpclient
Class HostConfiguration
- java.lang.Object
-
- org.apache.commons.httpclient.HostConfiguration
-
- All Implemented Interfaces:
java.lang.Cloneable
@Deprecated public class HostConfiguration extends java.lang.Object implements java.lang.Cloneable
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.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.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static HostConfiguration
ANY_HOST_CONFIGURATION
Deprecated.A value to represent any host configuration, instead of using something likenull
.
-
Constructor Summary
Constructors Constructor Description HostConfiguration()
Deprecated.Constructor for HostConfiguration.HostConfiguration(HostConfiguration hostConfiguration)
Deprecated.Copy constructor for HostConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
clone()
Deprecated.boolean
equals(java.lang.Object o)
Deprecated.java.lang.String
getHost()
Deprecated.Returns the host.java.lang.String
getHostURL()
Deprecated.Return the host url.java.net.InetAddress
getLocalAddress()
Deprecated.Return the local address to be used when creating connections.HostParams
getParams()
Deprecated.ReturnsHTTP protocol parameters
associated with this host.int
getPort()
Deprecated.Returns the port.Protocol
getProtocol()
Deprecated.Returns the protocol.java.lang.String
getProxyHost()
Deprecated.Returns the proxyHost.int
getProxyPort()
Deprecated.Returns the proxyPort.java.lang.String
getVirtualHost()
Deprecated.use HostParamsint
hashCode()
Deprecated.boolean
hostEquals(HttpConnection connection)
Deprecated.Tests if the host configuration equals the configuration set on the connection.boolean
isHostSet()
Deprecated.no longer usedboolean
isProxySet()
Deprecated.no longer usedboolean
proxyEquals(HttpConnection connection)
Deprecated.Tests if the proxy configuration equals the configuration set on the connection.void
setHost(java.lang.String host)
Deprecated.Set the given host.void
setHost(java.lang.String host, int port)
Deprecated.Sets the given host and port.void
setHost(java.lang.String host, int port, java.lang.String protocol)
Deprecated.Sets the given host, port and protocolvoid
setHost(java.lang.String host, int port, Protocol protocol)
Deprecated.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(HttpHost host)
Deprecated.Sets the given hostvoid
setHost(URI uri)
Deprecated.Sets the protocol, host and port from the given URI.void
setLocalAddress(java.net.InetAddress localAddress)
Deprecated.Set the local address to be used when creating connections.void
setParams(HostParams params)
Deprecated.AssignsHTTP protocol parameters
specific to this host.void
setProxy(java.lang.String proxyHost, int proxyPort)
Deprecated.Set the proxy settings.void
setProxyHost(ProxyHost proxyHost)
Deprecated.Sets the given proxy hostjava.lang.String
toString()
Deprecated.
-
-
-
Field Detail
-
ANY_HOST_CONFIGURATION
public static final HostConfiguration ANY_HOST_CONFIGURATION
Deprecated.A value to represent any host configuration, instead of using something likenull
. This value should be treated as immutable and only used in lookups and other such places to represent "any" host config.
-
-
Constructor Detail
-
HostConfiguration
public HostConfiguration()
Deprecated.Constructor for HostConfiguration.
-
HostConfiguration
public HostConfiguration(HostConfiguration hostConfiguration)
Deprecated.Copy constructor for HostConfiguration- Parameters:
hostConfiguration
- the hostConfiguration to copy
-
-
Method Detail
-
clone
public java.lang.Object clone()
Deprecated.- See Also:
Object.clone()
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
hostEquals
public boolean hostEquals(HttpConnection connection)
Deprecated.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- Returns:
true
if the connection's host information equals that of this configuration- See Also:
proxyEquals(HttpConnection)
-
proxyEquals
public boolean proxyEquals(HttpConnection connection)
Deprecated.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- Returns:
true
if the connection's proxy information equals that of this configuration- See Also:
hostEquals(HttpConnection)
-
isHostSet
public boolean isHostSet()
Deprecated.no longer usedReturns true if the host is set.- Returns:
true
if the host is set.
-
setHost
public void setHost(HttpHost host)
Deprecated.Sets the given host- Parameters:
host
- the host
-
setHost
public void setHost(java.lang.String host, int port, java.lang.String protocol)
Deprecated.Sets the given host, port and protocol- Parameters:
host
- the host(IP or DNS name)port
- The portprotocol
- The protocol.
-
setHost
public void setHost(java.lang.String host, java.lang.String virtualHost, int port, Protocol 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 ornull
port
- the host port or -1 to use protocol defaultprotocol
- the protocol
-
setHost
public void setHost(java.lang.String host, int port, Protocol protocol)
Deprecated.Sets the given host, port and protocol.- Parameters:
host
- the host(IP or DNS name)port
- The portprotocol
- the protocol
-
setHost
public void setHost(java.lang.String host, int port)
Deprecated.Sets the given host and port. Uses the default protocol "http".- Parameters:
host
- the host(IP or DNS name)port
- The port
-
setHost
public void setHost(java.lang.String host)
Deprecated.Set the given host. Uses the default protocol("http") and its port.- Parameters:
host
- The host(IP or DNS name).
-
setHost
public void setHost(URI uri)
Deprecated.Sets the protocol, host and port from the given URI.- Parameters:
uri
- the URI.
-
getHostURL
public java.lang.String getHostURL()
Deprecated.Return the host url.- Returns:
- The host url.
-
getHost
public java.lang.String getHost()
Deprecated.Returns the host.- Returns:
- the host(IP or DNS name), or
null
if not set - See Also:
isHostSet()
-
getVirtualHost
public java.lang.String getVirtualHost()
Deprecated.use HostParamsReturns the virtual host.- Returns:
- the virtual host name, or
null
if not set
-
getPort
public int getPort()
Deprecated.Returns the port.- Returns:
- the host port, or
-1
if not set - See Also:
isHostSet()
-
getProtocol
public Protocol getProtocol()
Deprecated.Returns the protocol.- Returns:
- The protocol.
-
isProxySet
public boolean isProxySet()
Deprecated.no longer usedTests if the proxy host/port have been set.- Returns:
true
if a proxy server has been set.- See Also:
setProxy(String, int)
-
setProxyHost
public void setProxyHost(ProxyHost proxyHost)
Deprecated.Sets the given proxy host- Parameters:
proxyHost
- the proxy host
-
setProxy
public void setProxy(java.lang.String proxyHost, int proxyPort)
Deprecated.Set the proxy settings.- Parameters:
proxyHost
- The proxy hostproxyPort
- The proxy port
-
getProxyHost
public java.lang.String getProxyHost()
Deprecated.Returns the proxyHost.- Returns:
- the proxy host, or
null
if not set - See Also:
isProxySet()
-
getProxyPort
public int getProxyPort()
Deprecated.Returns the proxyPort.- Returns:
- the proxy port, or
-1
if not set - See Also:
isProxySet()
-
setLocalAddress
public void setLocalAddress(java.net.InetAddress localAddress)
Deprecated.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
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
Deprecated.Return the local address to be used when creating connections. If this is unset, the default address should be used.- Returns:
- the local address to be used when creating Sockets, or
null
-
getParams
public HostParams getParams()
Deprecated.ReturnsHTTP protocol parameters
associated with this host.- Returns:
- HTTP parameters.
- Since:
- 3.0
-
setParams
public void setParams(HostParams params)
Deprecated.AssignsHTTP protocol parameters
specific to this host.- Since:
- 3.0
- See Also:
HostParams
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
-