Class UseProxyWhiteListSelector


  • public class UseProxyWhiteListSelector
    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 use a proxy as provided by the delegate ProxySelector else it will return DIRECT.
    • Constructor Summary

      Constructors 
      Constructor Description
      UseProxyWhiteListSelector​(java.lang.String whiteList, 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

      • UseProxyWhiteListSelector

        public UseProxyWhiteListSelector​(java.lang.String whiteList,
                                         java.net.ProxySelector proxySelector)
        Constructor
        Parameters:
        whiteList - the whitelist to use.
        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)
      • 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)
      • toString

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