Class FirewallingProxySelector


  • public class FirewallingProxySelector
    extends ProxySelector
    Todo: Document me!

    Date: 11.11.2009 Time: 21:50:46

    Author:
    Thomas Morgner.
    • Constructor Detail

      • FirewallingProxySelector

        public FirewallingProxySelector​(ProxySelector defaultSelector)
    • Method Detail

      • select

        public List<Proxy> select​(URI uri)
        Selects all the applicable proxies based on the protocol to access the resource with and a destination address to access the resource at. The format of the URI is defined as follow:
        • http URI for http connections
        • https URI for https connections
        • ftp URI for ftp connections
        • socket://host:port
          for tcp client sockets connections
        Specified by:
        select in class ProxySelector
        Parameters:
        uri - The URI that a connection is required to
        Returns:
        a List of Proxies. Each element in the the List is of type Proxy; when no proxy is available, the list will contain one element of type Proxy that represents a direct connection.
        Throws:
        IllegalArgumentException - if either argument is null
      • connectFailed

        public void connectFailed​(URI uri,
                                  SocketAddress sa,
                                  IOException ioe)
        Called to indicate that a connection could not be established to a proxy/socks server. An implementation of this method can temporarily remove the proxies or reorder the sequence of proxies returned by select(String, String), using the address and they kind of IOException given.
        Specified by:
        connectFailed in class ProxySelector
        Parameters:
        uri - The URI that the proxy at sa failed to serve.
        sa - The socket address of the proxy/SOCKS server
        ioe - The I/O exception thrown when the connect failed.
        Throws:
        IllegalArgumentException - if either argument is null