Class HttpSnifferConfig
- java.lang.Object
-
- com.norconex.collector.http.fetch.impl.webdriver.HttpSnifferConfig
-
- All Implemented Interfaces:
IXMLConfigurable
public class HttpSnifferConfig extends Object implements IXMLConfigurable
Configuration for
HttpSniffer
.XML configuration usage:
<port>(default is 0 = random free port)</port> <host>(default is "localhost")</host> <userAgent>(optionally overwrite browser user agent)</userAgent> <maxBufferSize> (Maximum byte size before a request/response content is considered too large. Can be specified using notations, e.g., 25MB. Default is 10MB) </maxBufferSize> <!-- Optional HTTP request headers passed on every HTTP requests --> <headers> <!-- You can repeat this header tag as needed. --> <header name="(header name)"> (header value) </header> </headers> <!-- Optional chained proxy --> <chainedProxy/>
The above XML configurable options can be nested in a supporting parent tag of any name. The expected parent tag name is defined by the consuming classes (e.g. "httpSniffer").
- Since:
- 3.0.0
- Author:
- Pascal Essiembre
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description HttpSnifferConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ProxySettings
getChainedProxy()
Gets chained proxy settings, if any.String
getHost()
Gets the host name passed to the browser pointing to the sniffer proxy.int
getMaxBufferSize()
int
getPort()
Map<String,String>
getRequestHeaders()
String
getUserAgent()
int
hashCode()
void
loadFromXML(XML xml)
void
saveToXML(XML xml)
void
setChainedProxy(ProxySettings chainedProxy)
Sets chained proxy settings, if any.void
setHost(String host)
Sets the host name passed to the browser pointing to the sniffer proxy.void
setMaxBufferSize(int maxBufferSize)
void
setPort(int port)
void
setRequestHeaders(Map<String,String> requestHeaders)
void
setUserAgent(String userAgent)
String
toString()
-
-
-
Method Detail
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
-
getHost
public String getHost()
Gets the host name passed to the browser pointing to the sniffer proxy. Defaults to "localhost".- Returns:
- host name
- Since:
- 3.1.0
-
setHost
public void setHost(String host)
Sets the host name passed to the browser pointing to the sniffer proxy.- Parameters:
host
- host name- Since:
- 3.1.0
-
getUserAgent
public String getUserAgent()
-
setUserAgent
public void setUserAgent(String userAgent)
-
getMaxBufferSize
public int getMaxBufferSize()
-
setMaxBufferSize
public void setMaxBufferSize(int maxBufferSize)
-
getChainedProxy
public ProxySettings getChainedProxy()
Gets chained proxy settings, if any. That is, when the sniffer proxy has to itself use a proxy.- Returns:
- chained proxy settings
- Since:
- 3.1.0
-
setChainedProxy
public void setChainedProxy(ProxySettings chainedProxy)
Sets chained proxy settings, if any. That is, when the sniffer proxy has to itself use a proxy.- Parameters:
chainedProxy
- chained proxy settings- Since:
- 3.1.0
-
loadFromXML
public void loadFromXML(XML xml)
- Specified by:
loadFromXML
in interfaceIXMLConfigurable
-
saveToXML
public void saveToXML(XML xml)
- Specified by:
saveToXML
in interfaceIXMLConfigurable
-
-