protected static class ThrottledFetcher.ThrottledConnection extends java.lang.Object implements IThrottledConnection
| Modifier and Type | Field and Description |
|---|---|
protected ThrottledFetcher.AbortChecker |
abortChecker
Abort checker
|
protected org.apache.http.conn.HttpClientConnectionManager |
connectionManager
The client connection manager
|
protected org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler |
connectionThrottler
The throttling object we use to track connections
|
protected int |
connectionTimeoutMilliseconds
Connection timeout in milliseconds
|
protected org.apache.http.client.methods.HttpRequestBase |
executeMethod
The method object
|
protected long |
fetchCounter
The current bytes in the current fetch
|
protected org.apache.manifoldcf.connectorcommon.interfaces.IFetchThrottler |
fetchThrottler
The throttling object we use to track fetches
|
protected java.lang.String |
fetchType
The kind of fetch we are doing
|
protected org.apache.http.client.HttpClient |
httpClient
The httpclient
|
protected ThrottledFetcher.ExecuteMethodThread |
methodThread
The thread that is actually doing the work
|
protected java.lang.String |
myUrl
The current URL being fetched
|
protected java.lang.String |
serverName
The server fqdn
|
protected long |
startFetchTime
The start-fetch time
|
protected int |
statusCode
The status code fetched, if any
|
protected boolean |
threadStarted
Set if thread has been started
|
protected java.lang.Throwable |
throwable
The error trace, if any
|
_rcsid, FETCH_BAD_URI, FETCH_CIRCULAR_REDIRECT, FETCH_IO_ERROR, FETCH_NOT_TRIED, FETCH_SEQUENCE_ERROR, FETCH_UNKNOWN_ERROR, STATUS_NOCHANGE, STATUS_OK, STATUS_PAGEERROR, STATUS_SITEERROR| Constructor and Description |
|---|
ThrottledConnection(java.lang.String serverName,
org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler connectionThrottler,
int connectionTimeoutMilliseconds,
int connectionLimit,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyAuthDomain,
java.lang.String proxyAuthUsername,
java.lang.String proxyAuthPassword,
org.apache.manifoldcf.crawler.interfaces.IAbortActivity activities)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginFetch(java.lang.String fetchType)
Begin the fetch process.
|
void |
close()
Close the connection.
|
void |
doneFetch(org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities)
Done with the fetch.
|
int |
executeFetch(java.lang.String protocol,
int port,
java.lang.String urlPath,
java.lang.String userAgent,
java.lang.String from,
java.lang.String lastETag,
java.lang.String lastModified)
Execute the fetch and get the return code.
|
java.io.InputStream |
getResponseBodyStream()
Get the response input stream.
|
int |
getResponseCode()
Get the http response code.
|
java.lang.String |
getResponseHeader(java.lang.String headerName)
Get a specified response header, if it exists.
|
void |
logFetchCount(int count)
Log the fetch of a number of bytes.
|
protected final java.lang.String serverName
protected final org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler connectionThrottler
protected final org.apache.manifoldcf.connectorcommon.interfaces.IFetchThrottler fetchThrottler
protected final int connectionTimeoutMilliseconds
protected final org.apache.http.conn.HttpClientConnectionManager connectionManager
protected final org.apache.http.client.HttpClient httpClient
protected org.apache.http.client.methods.HttpRequestBase executeMethod
protected long startFetchTime
protected java.lang.Throwable throwable
protected java.lang.String myUrl
protected int statusCode
protected java.lang.String fetchType
protected long fetchCounter
protected ThrottledFetcher.ExecuteMethodThread methodThread
protected boolean threadStarted
protected final ThrottledFetcher.AbortChecker abortChecker
public ThrottledConnection(java.lang.String serverName,
org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler connectionThrottler,
int connectionTimeoutMilliseconds,
int connectionLimit,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyAuthDomain,
java.lang.String proxyAuthUsername,
java.lang.String proxyAuthPassword,
org.apache.manifoldcf.crawler.interfaces.IAbortActivity activities)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void beginFetch(java.lang.String fetchType)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
beginFetch in interface IThrottledConnectionfetchType - is a short descriptive string describing the kind of fetch being requested. This
is used solely for logging purposes.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void logFetchCount(int count)
public int executeFetch(java.lang.String protocol,
int port,
java.lang.String urlPath,
java.lang.String userAgent,
java.lang.String from,
java.lang.String lastETag,
java.lang.String lastModified)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
executeFetch in interface IThrottledConnectionprotocol - is the protocol to use to perform the access, e.g. "http"port - is the port to use to perform the access, where -1 means "use the default"urlPath - is the path part of the url, e.g. "/robots.txt"userAgent - is the value of the userAgent header to use.from - is the value of the from header to use.lastETag - is the requested lastETag header value.lastModified - is the requested lastModified header value.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic int getResponseCode()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
getResponseCode in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic java.io.InputStream getResponseBodyStream()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
getResponseBodyStream in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic java.lang.String getResponseHeader(java.lang.String headerName)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
getResponseHeader in interface IThrottledConnectionheaderName - is the name of the header.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void doneFetch(org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
doneFetch in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionpublic void close()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
close in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFException