Package org.apache.any23.http

## Class DefaultHTTPClientConfiguration

- java.lang.Object
- - org.apache.any23.http.DefaultHTTPClientConfiguration

- All Implemented Interfaces:
    `HTTPClientConfiguration`

      public class DefaultHTTPClientConfiguration
      extends Object
      implements HTTPClientConfiguration

  Default implementation of `HTTPClientConfiguration`.
  Author:
    Michele Mostarda (mostarda@fbk.eu)

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultHTTPClientConfiguration()` | Constructor.
    `DefaultHTTPClientConfiguration​(String acceptHeader)` | Constructor.
    `DefaultHTTPClientConfiguration​(String userAgent, int defaultTimeout, int maxConnections, String acceptHeader)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getAcceptHeader()` |
    `int` | `getDefaultTimeout()` |
    `int` | `getMaxConnections()` |
    `String` | `getUserAgent()` |
    `static DefaultHTTPClientConfiguration` | `singleton()` |

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

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

- - ### Constructor Detail

    - #### DefaultHTTPClientConfiguration

          public DefaultHTTPClientConfiguration​(String userAgent,
                                                int defaultTimeout,
                                                int maxConnections,
                                                String acceptHeader)

      Constructor.
      Parameters:
        `userAgent` - the user agent descriptor string.
        `defaultTimeout` - the default timeout, cannot be `<= to 0`
        `maxConnections` - the default max connections, cannot be `<= to 0`
        `acceptHeader` - the accept header string, can be `null`.

    - #### DefaultHTTPClientConfiguration

          public DefaultHTTPClientConfiguration​(String acceptHeader)

      Constructor. initialized with default `DefaultConfiguration` parameters
      Parameters:
        `acceptHeader` - the value to initialize `acceptHeader`.

    - #### DefaultHTTPClientConfiguration

          public DefaultHTTPClientConfiguration()

      Constructor. initialized with default `DefaultConfiguration` parameters and `acceptHeader=null`.

  - ### Method Detail

    - #### singleton

          public static DefaultHTTPClientConfiguration singleton()

    - #### getUserAgent

          public String getUserAgent()

      Specified by:
        `getUserAgent` in interface `HTTPClientConfiguration`
      Returns:
        the User Agent to be used for retrieving HTTP contents.

    - #### getDefaultTimeout

          public int getDefaultTimeout()

      Specified by:
        `getDefaultTimeout` in interface `HTTPClientConfiguration`
      Returns:
        the default timeout in milliseconds.

    - #### getMaxConnections

          public int getMaxConnections()

      Specified by:
        `getMaxConnections` in interface `HTTPClientConfiguration`
      Returns:
        number of max concurrent connections.

    - #### getAcceptHeader

          public String getAcceptHeader()

      Specified by:
        `getAcceptHeader` in interface `HTTPClientConfiguration`
      Returns:
        the accept header value.