Class ProxyBypassListSelector


  • public class ProxyBypassListSelector
    extends java.net.ProxySelector
    Special purpose ProxySelector used as Facade on top of a normal ProxySelector. A wrapper that will first check the URI against a white list and if it matches it will return DIRECT else it will pass the URI to an delegate for inspection.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyBypassListSelector​(java.lang.String whiteList, java.net.ProxySelector proxySelector)
      Constructor
      ProxyBypassListSelector​(java.util.List<UriFilter> whiteListFilter, java.net.ProxySelector proxySelector)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connectFailed​(java.net.URI uri, java.net.SocketAddress sa, java.io.IOException ioe)
      connectFailed
      java.util.List<java.net.Proxy> select​(java.net.URI uri)
      select
      java.lang.String toString()  
      • Methods inherited from class java.net.ProxySelector

        getDefault, of, setDefault
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • delegate

        private java.net.ProxySelector delegate
      • whiteListFilter

        private java.util.List<UriFilter> whiteListFilter
    • Constructor Detail

      • ProxyBypassListSelector

        public ProxyBypassListSelector​(java.util.List<UriFilter> whiteListFilter,
                                       java.net.ProxySelector proxySelector)
        Constructor
        Parameters:
        whiteListFilter - a list of filters for whitelist URLs.
        proxySelector - the proxy selector to use.
      • ProxyBypassListSelector

        public ProxyBypassListSelector​(java.lang.String whiteList,
                                       java.net.ProxySelector proxySelector)
        Constructor
        Parameters:
        whiteList - a list of filters for whitelist URLs as comma/space separated string.
        proxySelector - the proxy selector to use.
    • Method Detail

      • connectFailed

        public void connectFailed​(java.net.URI uri,
                                  java.net.SocketAddress sa,
                                  java.io.IOException ioe)
        connectFailed
        Specified by:
        connectFailed in class java.net.ProxySelector
        See Also:
        ProxySelector.connectFailed(java.net.URI, java.net.SocketAddress, java.io.IOException)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • select

        public java.util.List<java.net.Proxy> select​(java.net.URI uri)
        select
        Specified by:
        select in class java.net.ProxySelector
        See Also:
        ProxySelector.select(java.net.URI)