|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface WorkloadManager
WorkloadManager: This interface defines a workload manager. A workload manager handles the lists of URLs that have been processed, resulted in an error, and are waiting to be processed.
| Method Summary | |
|---|---|
boolean |
add(java.net.URL url,
java.net.URL source,
int depth)
Add the specified URL to the workload. |
void |
clear()
Clear the workload. |
boolean |
contains(java.net.URL url)
Determine if the workload contains the specified URL. |
java.net.URL |
convertURL(java.lang.String url)
Convert the specified String to a URL. |
java.lang.String |
getCurrentHost()
Get the current host. |
int |
getDepth(java.net.URL url)
Get the depth of the specified URL. |
java.net.URL |
getSource(java.net.URL url)
Get the source page that contains the specified URL. |
java.net.URL |
getWork()
Get a new URL to work on. |
void |
init(Spider spider)
Setup this workload manager for the specified spider. |
void |
markError(java.net.URL url)
Mark the specified URL as error. |
void |
markProcessed(java.net.URL url)
Mark the specified URL as successfully processed. |
java.lang.String |
nextHost()
Move on to process the next host. |
void |
resume()
Setup the workload so that it can be resumed from where the last spider left the workload. |
void |
waitForWork(int time,
java.util.concurrent.TimeUnit length)
If there is currently no work available, then wait until a new URL has been added to the workload. |
boolean |
workloadEmpty()
Return true if there are no more workload units. |
| Method Detail |
|---|
boolean add(java.net.URL url,
java.net.URL source,
int depth)
url - The URL to be added.source - The page that contains this URL.depth - The depth of this URL.
WorkloadExceptionvoid clear()
boolean contains(java.net.URL url)
url - The URL to search for.
WorkloadExceptionjava.net.URL convertURL(java.lang.String url)
url - A String to convert into a URL.
java.lang.String getCurrentHost()
int getDepth(java.net.URL url)
url - The URL to get the depth of.
java.net.URL getSource(java.net.URL url)
url - The URL to seek the source for.
java.net.URL getWork()
void init(Spider spider)
spider - The spider using this workload manager.void markError(java.net.URL url)
url - The URL that had an error.void markProcessed(java.net.URL url)
url - The URL to mark as processed.java.lang.String nextHost()
void resume()
void waitForWork(int time,
java.util.concurrent.TimeUnit length)
time - The amount of time to wait.length - What time unit is being used.boolean workloadEmpty()
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||