Class HttpProxy

  • All Implemented Interfaces:
    ConfigurationObject

    public final class HttpProxy
    extends HttpCredential
    This configuration object configures the proxies to be used by the system. This is configured as one of the root elements of the config.yaml

    Example - Proxy all requests except localhost and www.camptocamp.org:

    
     proxies:
       - !proxy
         scheme: http
         host: proxy.host.com
         port: 8888
         username: username
         password: xyzpassword
         matchers:
           - !localMatch
             reject: true
           - !dnsMatch
             host: www.camptocamp.org
             reject: true
           - !acceptAll {}
     
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpProxy()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.http.HttpHost getHttpHost()  
      void setHost​(java.lang.String host)
      The host of the proxy.
      void setMatchers​(java.util.List<? extends URIMatcher> matchers)
      Matchers are used to choose which requests this proxy applies to.
      void setPassword​(java.lang.String password)
      The password for authenticating with the proxy.
      void setPort​(int port)
      The host of the proxy.
      void setScheme​(java.lang.String scheme)
      The scheme (http, https) of the proxy.
      void setUsername​(java.lang.String username)
      The username for authenticating with the proxy.
      void validate​(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
      validate that the configuration was correct.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpProxy

        public HttpProxy()
    • Method Detail

      • getHttpHost

        public org.apache.http.HttpHost getHttpHost()
      • setScheme

        public void setScheme​(java.lang.String scheme)
        The scheme (http, https) of the proxy.

        This is optional, default is http if no username and https if there is a password

        Parameters:
        scheme - the scheme of the proxy
      • setMatchers

        public void setMatchers​(java.util.List<? extends URIMatcher> matchers)
        Matchers are used to choose which requests this proxy applies to.
        Overrides:
        setMatchers in class HttpCredential
        Parameters:
        matchers - the matchers to use to determine which requests the applies can be used for
        See Also:
        URIMatcher, RestrictUrisProcessor
      • setHost

        public void setHost​(java.lang.String host)
        The host of the proxy. Can be a hostname or ip address.

        This is required.

        Parameters:
        host - the host of the proxy
      • setUsername

        public void setUsername​(java.lang.String username)
        The username for authenticating with the proxy.

        This is optional

        Overrides:
        setUsername in class HttpCredential
        Parameters:
        username - the username for authenticating with the proxy
      • setPassword

        public void setPassword​(java.lang.String password)
        The password for authenticating with the proxy.

        This is optional

        Overrides:
        setPassword in class HttpCredential
        Parameters:
        password - the password for authenticating with the proxy
      • setPort

        public void setPort​(int port)
        The host of the proxy. Can be a hostname or ip address.

        This is optional. The default value is 80.

        Parameters:
        port - the port of the proxy
      • validate

        public void validate​(java.util.List<java.lang.Throwable> validationErrors,
                             Configuration configuration)
        Description copied from interface: ConfigurationObject
        validate that the configuration was correct.
        Specified by:
        validate in interface ConfigurationObject
        Overrides:
        validate in class HttpCredential
        Parameters:
        validationErrors - a list to add any detected errors to.
        configuration - the containing configuration