com.ihr.xbrl.util

## Class InternetProxySelector

- java.lang.Object
- - java.net.ProxySelector
  - - com.ihr.xbrl.util.InternetProxySelector

-     public class InternetProxySelector
      extends java.net.ProxySelector

  Configures the internet proxy Based on code form jean-christophe.collet@sun.com see page

  An instance of this class is created when a DTSContainer is created. During the initialization of this class, the static ProxySelector is get and if it is not an instance of this class it is set to the created instance. If the ProxySelector is an instance of this class it is reused, new proxies are added to the existing instance. Existing proxies remains untouched. If a proxy that is banned (due to inactivity) is added it is ignored.

  Adding proxies is done by adding properties to the new DTS being created. Properties are read by this class and proxies are configured accordingly. The following properties are recognized and used:

  - http://www.reportingstandard.com/properties/proxy/address/{n} this is the proxy internet address
  - http://www.reportingstandard.com/properties/proxy/port/{n} this is the proxy port (no default values are inferred at this point)
  - http://www.reportingstandard.com/properties/proxy/type/{n} this is either "HTTP" or "SOCKS" indicating the proxy type
  Where {n} is a sequential number starting with 0. If no property exist, the list of proxies is finished. In order to add a proxy to the list the three properties ending with a number must exist.

  According to the API, the ProxySelector is static, therefore all DTSContainers will share the same

  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `noProxyFor` The Constant noProxyFor.
    `static java.lang.String` | `proxyAddress` The Constant proxyAddress.
    `static java.lang.String` | `proxyPort` The Constant proxyPort.
    `static java.lang.String` | `proxyPropertyHeader` The Constant proxyPropertyHeader.
    `static java.lang.String` | `proxyType` The Constant proxyType.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InternetProxySelector(java.util.Properties props)` Instantiates a new internet proxy selector.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connectFailed(java.net.URI uri, java.net.SocketAddress sa, java.io.IOException ioe)`
    `boolean` | `isRegistered()` During the instance creation, the InternetProxySelector is registered as the default proxy selector if there are properties indicating that it must be registered.
    `java.util.List<java.net.Proxy>` | `select(java.net.URI uri)`

    - ### Methods inherited from class java.net.ProxySelector

      `getDefault, setDefault`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### proxyPropertyHeader

          public static final java.lang.String proxyPropertyHeader

      The Constant proxyPropertyHeader.
      See Also:
        Constant Field Values

    - #### proxyAddress

          public static final java.lang.String proxyAddress

      The Constant proxyAddress.
      See Also:
        Constant Field Values

    - #### proxyPort

          public static final java.lang.String proxyPort

      The Constant proxyPort.
      See Also:
        Constant Field Values

    - #### proxyType

          public static final java.lang.String proxyType

      The Constant proxyType.
      See Also:
        Constant Field Values

    - #### noProxyFor

          public static final java.lang.String noProxyFor

      The Constant noProxyFor.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### InternetProxySelector

          public InternetProxySelector(java.util.Properties props)

      Instantiates a new internet proxy selector.
      Parameters:
        `props` - the props

  - ### Method Detail

    - #### isRegistered

          public boolean isRegistered()

      During the instance creation, the InternetProxySelector is registered as the default proxy selector if there are properties indicating that it must be registered. This method returns true if the InternetProxySelector instance is registered as the default ProxySelector.
      Returns:
        boolean value

    - #### select

          public java.util.List<java.net.Proxy> select(java.net.URI uri)

      Specified by:
        `select` in class `java.net.ProxySelector`

    - #### connectFailed

          public void connectFailed(java.net.URI uri,
                           java.net.SocketAddress sa,
                           java.io.IOException ioe)

      Specified by:
        `connectFailed` in class `java.net.ProxySelector`