public class ProxySettings extends Object implements IXMLConfigurable, Serializable
Convenience class for implementation requiring proxy settings.
Passwords can be encrypted using EncryptionUtil
(or
command-line "encrypt.bat" or "encrypt.sh" if those are available to you).
In order for the password to be decrypted properly, you need
to specify the encryption key used to encrypt it. The key can obtained
from a few supported locations. The combination of the password key
"value" and "source" is used to properly locate the key.
The supported sources are:
key |
The actual encryption key. |
file |
Path to a file containing the encryption key. |
environment |
Name of an environment variable containing the key. |
property |
Name of a JVM system property containing the key. |
<host>
<name>(host name)</name>
<port>(host port)</port>
</host>
<scheme>(Default is "http")</scheme>
<realm>(Authentication realm. Default is any.)</realm>
<credentials>
<username>(the username)</username>
<password>(the optionally encrypted password)</password>
<passwordKey>
<value>(The actual password encryption key or a reference to it.)</value>
<source>[key|file|environment|property]</source>
<size>(Size in bits of encryption key. Default is 128.)</size>
</passwordKey>
</credentials>
The above can be found under any parent tag. See consuming class documentation for exact usage.
Constructor and Description |
---|
ProxySettings() |
ProxySettings(Host host) |
ProxySettings(String name,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(ProxySettings another) |
void |
copyTo(ProxySettings another) |
boolean |
equals(Object other) |
Credentials |
getCredentials()
Gets the proxy credentials.
|
Host |
getHost()
Gets the proxy host.
|
String |
getProxyHost()
Deprecated.
Since 2.0.0, use
getHost() . |
String |
getProxyPassword()
Deprecated.
Since 2.0.0, use
getCredentials() . |
EncryptionKey |
getProxyPasswordKey()
Deprecated.
Since 2.0.0, use
getCredentials() . |
int |
getProxyPort()
Deprecated.
Since 2.0.0, use
getHost() . |
String |
getProxyRealm()
Deprecated.
Since 2.0.0, use
getRealm() . |
String |
getProxyScheme()
Deprecated.
Since 2.0.0, use
getScheme() . |
String |
getProxyUsername()
Deprecated.
Since 2.0.0, use
getCredentials() . |
String |
getRealm()
Gets the proxy realm.
|
String |
getScheme()
Gets the proxy scheme.
|
int |
hashCode() |
boolean |
isSet() |
void |
loadFromXML(XML xml)
Load XML configuration values and initialized this object with them.
|
void |
saveToXML(XML xml)
Saves this object as XML.
|
ProxySettings |
setCredentials(Credentials credentials)
Sets the proxy credentials.
|
ProxySettings |
setHost(Host host)
Sets the proxy host.
|
ProxySettings |
setProxyHost(String proxyHost)
Deprecated.
Since 2.0.0, use
setHost(Host) . |
ProxySettings |
setProxyPassword(String proxyPassword)
Deprecated.
Since 2.0.0,
use
setCredentials(Credentials) . |
ProxySettings |
setProxyPasswordKey(EncryptionKey proxyPasswordKey)
Deprecated.
Since 2.0.0, use
setCredentials(Credentials) . |
ProxySettings |
setProxyPort(int proxyPort)
Deprecated.
Since 2.0.0, use
setHost(Host) . |
ProxySettings |
setProxyRealm(String proxyRealm)
Deprecated.
Since 2.0.0, use
setRealm(String) . |
ProxySettings |
setProxyScheme(String proxyScheme)
Deprecated.
Since 2.0.0, use
setScheme(String) . |
ProxySettings |
setProxyUsername(String proxyUsername)
Deprecated.
Since 2.0.0, use
setCredentials(Credentials) . |
ProxySettings |
setRealm(String realm)
Sets the proxy realm.
|
ProxySettings |
setScheme(String scheme)
Sets the proxy scheme.
|
String |
toString() |
public ProxySettings()
public ProxySettings(String name, int port)
public ProxySettings(Host host)
public Host getHost()
null
if not setisSet()
public ProxySettings setHost(Host host)
host
- proxy hostpublic String getScheme()
public ProxySettings setScheme(String scheme)
scheme
- proxy schemepublic Credentials getCredentials()
null
)public ProxySettings setCredentials(Credentials credentials)
credentials
- proxy credentialspublic String getRealm()
public ProxySettings setRealm(String realm)
realm
- proxy realm@Deprecated public String getProxyHost()
getHost()
.@Deprecated public ProxySettings setProxyHost(String proxyHost)
setHost(Host)
.proxyHost
- proxy host@Deprecated public int getProxyPort()
getHost()
.@Deprecated public ProxySettings setProxyPort(int proxyPort)
setHost(Host)
.proxyPort
- proxy port@Deprecated public String getProxyScheme()
getScheme()
.@Deprecated public ProxySettings setProxyScheme(String proxyScheme)
setScheme(String)
.proxyScheme
- proxy scheme@Deprecated public String getProxyUsername()
getCredentials()
.@Deprecated public ProxySettings setProxyUsername(String proxyUsername)
setCredentials(Credentials)
.proxyUsername
- proxy username@Deprecated public String getProxyPassword()
getCredentials()
.@Deprecated public ProxySettings setProxyPassword(String proxyPassword)
setCredentials(Credentials)
.proxyPassword
- proxy password@Deprecated public EncryptionKey getProxyPasswordKey()
getCredentials()
.@Deprecated public ProxySettings setProxyPasswordKey(EncryptionKey proxyPasswordKey)
setCredentials(Credentials)
.proxyPasswordKey
- proxy password key@Deprecated public String getProxyRealm()
getRealm()
.@Deprecated public ProxySettings setProxyRealm(String proxyRealm)
setRealm(String)
.proxyRealm
- proxy realmpublic boolean isSet()
public void copyTo(ProxySettings another)
public void copyFrom(ProxySettings another)
public void loadFromXML(XML xml)
IXMLConfigurable
loadFromXML
in interface IXMLConfigurable
xml
- the XML to load into this objectpublic void saveToXML(XML xml)
IXMLConfigurable
saveToXML
in interface IXMLConfigurable
xml
- the XML that will representing this objectCopyright © 2008–2023 Norconex Inc.. All rights reserved.