Class FixedProxySelector

  • Direct Known Subclasses:
    FixedSocksSelector

    public class FixedProxySelector
    extends java.net.ProxySelector
    This proxy selector is configured with a fixed proxy. This proxy will be returned for all URIs passed to the select method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.net.Proxy> proxyList  
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedProxySelector​(java.lang.String proxyHost, int proxyPort)
      Constructor
      FixedProxySelector​(java.net.Proxy proxy)
      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

      • proxyList

        private final java.util.List<java.net.Proxy> proxyList
    • Constructor Detail

      • FixedProxySelector

        public FixedProxySelector​(java.net.Proxy proxy)
        Constructor
        Parameters:
        proxy - the proxy to use.
      • FixedProxySelector

        public FixedProxySelector​(java.lang.String proxyHost,
                                  int proxyPort)
        Constructor
        Parameters:
        proxyHost - the host name or IP address of the proxy to use.
        proxyPort - the port of the proxy.
    • 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