Class HttpProxySettings

java.lang.Object
com.helger.httpclient.HttpProxySettings
All Implemented Interfaces:
com.helger.base.clone.ICloneable<HttpProxySettings>, IHttpProxySettings

@NotThreadSafe public class HttpProxySettings extends Object implements IHttpProxySettings, com.helger.base.clone.ICloneable<HttpProxySettings>
All the easily configurable settings for a single HTTP proxy server
Since:
10.5.0
Author:
Philip Helger
  • Constructor Details

    • HttpProxySettings

      public HttpProxySettings()
      Default constructor.
    • HttpProxySettings

      public HttpProxySettings(@Nonnull IHttpProxySettings aSource)
      "Copy" constructor.
      Parameters:
      aSource - The source settings to copy from. May not be null.
  • Method Details

    • setAllFrom

      @Nonnull public final HttpProxySettings setAllFrom(@Nonnull IHttpProxySettings aSource)
      Apply all settings from the provided HTTP proxy settings
      Parameters:
      aSource - The source settings to copy from. May not be null.
      Returns:
      this for chaining.
    • getProxyHost

      @Nullable public final org.apache.hc.core5.http.HttpHost getProxyHost()
      Specified by:
      getProxyHost in interface IHttpProxySettings
      Returns:
      The proxy host to be used. May be null.
    • setProxyHost

      @Nonnull public final HttpProxySettings setProxyHost(@Nullable org.apache.hc.core5.http.HttpHost aProxyHost)
      Set a proxy host without proxy server credentials.
      Parameters:
      aProxyHost - The proxy host to be used. May be null.
      Returns:
      this for chaining
      See Also:
    • getProxyCredentials

      @Nullable public final org.apache.hc.client5.http.auth.Credentials getProxyCredentials()
      Specified by:
      getProxyCredentials in interface IHttpProxySettings
      Returns:
      The proxy server credentials to be used. May be null.
    • setProxyCredentials

      @Nonnull public final HttpProxySettings setProxyCredentials(@Nullable org.apache.hc.client5.http.auth.Credentials aProxyCredentials)
      Set proxy credentials.
      Parameters:
      aProxyCredentials - The proxy server credentials to be used. May be null. They are only used if a proxy host is present! Usually they are of type UsernamePasswordCredentials.
      Returns:
      this for chaining
      See Also:
    • nonProxyHosts

      @Nonnull @ReturnsMutableObject public final com.helger.collection.commons.ICommonsOrderedSet<String> nonProxyHosts()
      Specified by:
      nonProxyHosts in interface IHttpProxySettings
      Returns:
      The set of all host names and IP addresses for which no proxy should be used. Never null and mutable.
    • addNonProxyHostsFromPipeString

      @Nonnull public final HttpProxySettings addNonProxyHostsFromPipeString(@Nullable String sDefinition)
      Add all non-proxy hosts from a piped string as in 127.0.0.1 | localhost. Every entry must be separated by a pipe, and the values are trimmed.
      Parameters:
      sDefinition - The definition string. May be null or empty or invalid. Every non-empty trimmed text between pipes is interpreted as a host name.
      Returns:
      this for chaining
    • setNonProxyHostsFromPipeString

      @Nonnull public final HttpProxySettings setNonProxyHostsFromPipeString(@Nullable String sDefinition)
      Set all non-proxy hosts from a piped string as in 127.0.0.1 | localhost. Every entry must be separated by a pipe, and the values are trimmed.
      This is a shortcut for first clearing the list and then calling addNonProxyHostsFromPipeString(String)
      Parameters:
      sDefinition - The definition string. May be null or empty or invalid. Every non-empty trimmed text between pipes is interpreted as a host name.
      Returns:
      this for chaining
      Since:
      10.0.0
      See Also:
    • getClone

      @Nonnull @ReturnsMutableCopy public HttpProxySettings getClone()
      Specified by:
      getClone in interface com.helger.base.clone.ICloneable<HttpProxySettings>
    • toString

      public String toString()
      Overrides:
      toString in class Object