Class JNLPProxySelector

java.lang.Object
java.net.ProxySelector
net.sourceforge.jnlp.proxy.JNLPProxySelector
Direct Known Subclasses:
FirefoxProxySelector

public abstract class JNLPProxySelector extends ProxySelector
A ProxySelector specific to JNLPs. This proxy uses the deployment configuration to determine what to do.
See Also:
  • Field Details

    • LOG

      private static final Logger LOG
    • pacEvaluator

      private PacEvaluator pacEvaluator
    • autoConfigUrl

      private URL autoConfigUrl
      the URL to the PAC file
    • bypassLocal

      private boolean bypassLocal
      whether localhost should be bypassed for proxy purposes
    • proxyType

      private final ProxyType proxyType
      The proxy type. See PROXY_TYPE_* constants
    • proxyHttpHost

      private final String proxyHttpHost
    • proxyHttpPort

      private final int proxyHttpPort
    • proxyHttpsHost

      private final String proxyHttpsHost
    • proxyHttpsPort

      private final int proxyHttpsPort
    • proxyFtpHost

      private final String proxyFtpHost
    • proxyFtpPort

      private final int proxyFtpPort
    • proxySocks4Host

      private final String proxySocks4Host
    • proxySocks4Port

      private final int proxySocks4Port
    • bypassList

      private final List<String> bypassList
      a list of URLs that should be bypassed for proxy purposes
    • sameProxy

      private final boolean sameProxy
      whether the http proxy should be used for https and ftp protocols as well
  • Constructor Details

  • Method Details

    • getHost

      private String getHost(DeploymentConfiguration config, String key)
      Uses the given key to get a host from the configuration
    • getPort

      private int getPort(DeploymentConfiguration config, String key)
      Uses the given key to get a port from the configuration
    • connectFailed

      public void connectFailed(URI uri, SocketAddress sa, IOException ioe)
      Specified by:
      connectFailed in class ProxySelector
    • select

      public List<Proxy> select(URI uri)
      Specified by:
      select in class ProxySelector
      Returns:
      list of proxies on URI
    • inBypassList

      private boolean inBypassList(URI uri)
      Returns true if the uri should be bypassed for proxy purposes
    • getFromConfiguration

      private List<Proxy> getFromConfiguration(URI uri)
      Returns a list of proxies by using the information in the deployment configuration
      Parameters:
      uri - uri to read
      Returns:
      a List of Proxy objects
    • getFromArguments

      protected static List<Proxy> getFromArguments(URI uri, boolean sameProxy, boolean sameProxyIncludesSocket, String proxyHttpsHost, int proxyHttpsPort, String proxyHttpHost, int proxyHttpPort, String proxyFtpHost, int proxyFtpPort, String proxySocks4Host, int proxySocks4Port)
      Returns a list of proxies by using the arguments
      Parameters:
      uri - name and code says it all
      sameProxy - name and code says it all
      sameProxyIncludesSocket - name and code says it all
      proxyHttpsHost - name and code says it all
      proxyHttpsPort - name and code says it all
      proxyHttpHost - name and code says it all
      proxyHttpPort - name and code says it all
      proxyFtpHost - name and code says it all
      proxyFtpPort - name and code says it all
      proxySocks4Host - name and code says it all
      proxySocks4Port - name and code says it all
      Returns:
      a List of Proxy objects
    • getFromPAC

      private List<Proxy> getFromPAC(URI uri)
      Returns a list of proxies by using the Proxy Auto Config (PAC) file. See http://en.wikipedia.org/wiki/Proxy_auto-config#The_PAC_file for more information.
      Parameters:
      uri - uri to PAC
      Returns:
      a List of valid Proxy objects
    • getFromBrowser

      protected abstract List<Proxy> getFromBrowser(URI uri)
      Returns a list of proxies by querying the browser
      Parameters:
      uri - the uri to get proxies for
      Returns:
      a list of proxies