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 ofHTTPClientConfiguration
.- 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()
-
-
-
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 benull
.
-
DefaultHTTPClientConfiguration
public DefaultHTTPClientConfiguration(String acceptHeader)
Constructor. initialized with defaultDefaultConfiguration
parameters- Parameters:
acceptHeader
- the value to initializeacceptHeader
.
-
DefaultHTTPClientConfiguration
public DefaultHTTPClientConfiguration()
Constructor. initialized with defaultDefaultConfiguration
parameters andacceptHeader=null
.
-
-
Method Detail
-
singleton
public static DefaultHTTPClientConfiguration singleton()
-
getUserAgent
public String getUserAgent()
- Specified by:
getUserAgent
in interfaceHTTPClientConfiguration
- Returns:
- the User Agent to be used for retrieving HTTP contents.
-
getDefaultTimeout
public int getDefaultTimeout()
- Specified by:
getDefaultTimeout
in interfaceHTTPClientConfiguration
- Returns:
- the default timeout in milliseconds.
-
getMaxConnections
public int getMaxConnections()
- Specified by:
getMaxConnections
in interfaceHTTPClientConfiguration
- Returns:
- number of max concurrent connections.
-
getAcceptHeader
public String getAcceptHeader()
- Specified by:
getAcceptHeader
in interfaceHTTPClientConfiguration
- Returns:
- the accept header value.
-
-