Package com.norconex.commons.lang.net
Class ProxySettings
java.lang.Object
com.norconex.commons.lang.net.ProxySettings
- All Implemented Interfaces:
Serializable
Convenience class for implementation requiring proxy settings.
- Since:
- 1.14.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidcopyFrom(ProxySettings another) Copy properties of the supplied instance to this instance.voidcopyTo(ProxySettings another) Copy properties of this instance to the supplied instance.booleanProxy credentials, when required or applicable.getHost()Proxy host (name and port), ornullwhen not set.getRealm()Proxy authentication realm, when required or applicable.Proxy scheme (default is "http").inthashCode()booleanisSet()Wether this proxy is configured.setCredentials(Credentials credentials) Sets the proxy credentials.Proxy host (name and port), ornullwhen not set.Proxy authentication realm, when required or applicable.Proxy scheme (default is "http").toProxy()Converts this proxy settings to aProxy.toString()
-
Constructor Details
-
ProxySettings
public ProxySettings() -
ProxySettings
-
ProxySettings
-
-
Method Details
-
setCredentials
Sets the proxy credentials.- Parameters:
credentials- proxy credentials- Returns:
- this
- Since:
- 2.0.0
-
isSet
public boolean isSet()Wether this proxy is configured. That is, if the host is notnulland also configured.- Returns:
trueif set- See Also:
-
copyTo
Copy properties of this instance to the supplied instance.- Parameters:
another- another proxy settings instance
-
copyFrom
Copy properties of the supplied instance to this instance.- Parameters:
another- another proxy settings instance
-
toProxy
Converts this proxy settings to aProxy. The scheme is used to establish the proxy type. IfisSet()returns false, this method returnsnull.- Returns:
- proxy or
null - Since:
- 3.0.0
-
getHost
Proxy host (name and port), ornullwhen not set. -
getScheme
Proxy scheme (default is "http").- Since:
- 2.0.0
-
getCredentials
Proxy credentials, when required or applicable. Nevernull.- Since:
- 2.0.0
-
getRealm
Proxy authentication realm, when required or applicable.- Since:
- 2.0.0
-
setHost
Proxy host (name and port), ornullwhen not set.- Returns:
this.
-
setScheme
Proxy scheme (default is "http").- Returns:
this.- Since:
- 2.0.0
-
setRealm
Proxy authentication realm, when required or applicable.- Returns:
this.- Since:
- 2.0.0
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-