|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.manifoldcf.crawler.connectors.webcrawler.ThrottledFetcher.ThrottledConnection
protected static class ThrottledFetcher.ThrottledConnection
Throttled connections. Each instance of a connection describes the bins to which it belongs, along with the actual open connection itself, and the last time the connection was used.
| Nested Class Summary | |
|---|---|
protected static class |
ThrottledFetcher.ThrottledConnection.ExecuteMethodThread
|
| Field Summary | |
|---|---|
protected PageCredentials |
authentication
Authentication |
protected ThrottledFetcher.ConnectionBin[] |
connectionBinArray
The connection has resolved pointers to the ConnectionBin structures that manage pool maximums. |
protected org.apache.commons.httpclient.MultiThreadedHttpConnectionManager |
connManager
The http connection manager. |
protected ThrottledFetcher.DataSession |
dataSession
Hack added to record all access data from current crawler |
protected long |
fetchCounter
The current bytes in the current fetch |
protected org.apache.commons.httpclient.HttpMethodBase |
fetchMethod
The method object |
protected java.lang.String |
fetchType
The kind of fetch we are doing |
protected long |
inactiveTime
If not active, this is when it went inactive |
protected boolean |
isActive
Is the connection considered "active"? |
protected LoginCookies |
lastFetchCookies
The cookies from the last fetch |
protected double[] |
minMillisecondsPerByte
These are the bandwidth limits, per bin |
protected org.apache.commons.httpclient.protocol.ProtocolFactory |
myFactory
|
protected java.lang.String |
myUrl
The current URL being fetched |
protected int |
port
Port |
protected java.lang.String |
protocol
Protocol |
protected org.apache.commons.httpclient.protocol.ProtocolSocketFactory |
secureSocketFactory
Protocol socket factory |
protected java.lang.String |
server
Server |
protected long |
startFetchTime
The start of the current fetch |
protected int |
statusCode
The status code fetched, if any |
protected ThrottledFetcher.ThrottleBin[] |
throttleBinArray
The connection has resolved pointers to the ThrottleBin structures that help manage bandwidth throttling. |
protected java.lang.Throwable |
throwable
The error trace, if any |
protected org.apache.manifoldcf.core.interfaces.IKeystoreManager |
trustStore
Trust store |
protected java.lang.String |
trustStoreString
Trust store string |
| Fields inherited from interface org.apache.manifoldcf.crawler.connectors.webcrawler.IThrottledConnection |
|---|
_rcsid, FETCH_BAD_URI, FETCH_CIRCULAR_REDIRECT, FETCH_INTERRUPTED, FETCH_IO_ERROR, FETCH_NOT_TRIED, FETCH_SEQUENCE_ERROR, FETCH_UNKNOWN_ERROR |
| Constructor Summary | |
|---|---|
ThrottledFetcher.ThrottledConnection(java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
org.apache.commons.httpclient.protocol.ProtocolFactory myFactory,
java.lang.String trustStoreString,
ThrottledFetcher.ConnectionBin[] connectionBins)
Constructor. |
|
| Method Summary | |
|---|---|
void |
activate()
Activate the connection. |
void |
beginFetch(java.lang.String fetchType)
Begin the fetch process. |
void |
beginRead(int len)
Begin a read operation, from within a stream |
void |
close()
Close the connection. |
protected void |
destroy()
Destroy the connection forever |
void |
doneFetch(org.apache.manifoldcf.crawler.interfaces.IVersionActivity activities)
Done with the fetch. |
void |
endRead(int origLen,
int actualAmt)
End a read operation, from within a stream |
void |
executeFetch(java.lang.String urlPath,
java.lang.String userAgent,
java.lang.String from,
int connectionTimeoutMilliseconds,
int socketTimeoutMilliseconds,
boolean redirectOK,
java.lang.String host,
FormData formData,
LoginCookies loginCookies)
Execute the fetch and get the return code. |
boolean |
flushIdleConnections(long idleTimeout)
Do periodic bookkeeping. |
LoginCookies |
getLastFetchCookies()
Get the last fetch cookies. |
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, from within a stream. |
boolean |
matches(ThrottledFetcher.ConnectionBin[] bins,
java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
java.lang.String trustStoreString)
See if this instances matches a given server and port. |
void |
mustHaveReference(ThrottledFetcher.ConnectionBin cb)
|
void |
noteInterrupted(java.lang.Throwable e)
Note that the connection fetch was interrupted by something. |
void |
setup(ThrottleDescription description)
Set up the connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ThrottledFetcher.ConnectionBin[] connectionBinArray
protected ThrottledFetcher.ThrottleBin[] throttleBinArray
protected double[] minMillisecondsPerByte
protected boolean isActive
protected long inactiveTime
protected java.lang.String protocol
protected java.lang.String server
protected int port
protected PageCredentials authentication
protected org.apache.manifoldcf.core.interfaces.IKeystoreManager trustStore
protected java.lang.String trustStoreString
protected org.apache.commons.httpclient.MultiThreadedHttpConnectionManager connManager
protected org.apache.commons.httpclient.HttpMethodBase fetchMethod
protected java.lang.Throwable throwable
protected java.lang.String myUrl
protected int statusCode
protected java.lang.String fetchType
protected long fetchCounter
protected long startFetchTime
protected LoginCookies lastFetchCookies
protected org.apache.commons.httpclient.protocol.ProtocolSocketFactory secureSocketFactory
protected org.apache.commons.httpclient.protocol.ProtocolFactory myFactory
protected ThrottledFetcher.DataSession dataSession
| Constructor Detail |
|---|
public ThrottledFetcher.ThrottledConnection(java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
org.apache.commons.httpclient.protocol.ProtocolFactory myFactory,
java.lang.String trustStoreString,
ThrottledFetcher.ConnectionBin[] connectionBins)
| Method Detail |
|---|
public void mustHaveReference(ThrottledFetcher.ConnectionBin cb)
public boolean matches(ThrottledFetcher.ConnectionBin[] bins,
java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
java.lang.String trustStoreString)
public void activate()
public void setup(ThrottleDescription description)
public boolean flushIdleConnections(long idleTimeout)
public void logFetchCount(int count)
public void beginRead(int len)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void endRead(int origLen,
int actualAmt)
protected void destroy()
public void beginFetch(java.lang.String fetchType)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
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.ManifoldCFException
public void executeFetch(java.lang.String urlPath,
java.lang.String userAgent,
java.lang.String from,
int connectionTimeoutMilliseconds,
int socketTimeoutMilliseconds,
boolean redirectOK,
java.lang.String host,
FormData formData,
LoginCookies loginCookies)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
executeFetch in interface IThrottledConnectionurlPath - 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.connectionTimeoutMilliseconds - is the maximum number of milliseconds to wait on socket connect.redirectOK - should be set to true if you want redirects to be automatically followed.host - is the value to use as the "Host" header, or null to use the default.formData - describes additional form arguments and how to fetch the page.loginCookies - describes the cookies that should be in effect for this page fetch.
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public int getResponseCode()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
getResponseCode in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public LoginCookies getLastFetchCookies()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
getLastFetchCookies in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public 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.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
public 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.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void noteInterrupted(java.lang.Throwable e)
noteInterrupted in interface IThrottledConnection
public void doneFetch(org.apache.manifoldcf.crawler.interfaces.IVersionActivity activities)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
doneFetch in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFException
public void close()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
close in interface IThrottledConnectionorg.apache.manifoldcf.core.interfaces.ManifoldCFException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||