Package de.jungblut.crawl
Class SequentialCrawler<T extends FetchResult>
- java.lang.Object
-
- de.jungblut.crawl.SequentialCrawler<T>
-
- All Implemented Interfaces:
Crawler<T>
public final class SequentialCrawler<T extends FetchResult> extends java.lang.Object implements Crawler<T>
Sequential crawler, mainly for debugging or development.- Author:
- thomas.jungblut
-
-
Constructor Summary
Constructors Constructor Description SequentialCrawler(int fetches, Extractor<T> extractor, ResultWriter<T> writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocess(java.lang.String... seedUrl)Starts the crawler, starting by the seedURL.voidsetup(int fetches, Extractor<T> extractor, ResultWriter<T> writer)Setups this crawler.
-
-
-
Constructor Detail
-
SequentialCrawler
public SequentialCrawler(int fetches, Extractor<T> extractor, ResultWriter<T> writer) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
setup
public final void setup(int fetches, Extractor<T> extractor, ResultWriter<T> writer) throws java.io.IOExceptionDescription copied from interface:CrawlerSetups this crawler.- Specified by:
setupin interfaceCrawler<T extends FetchResult>- Parameters:
fetches- how many maximum fetches it should do.extractor- the givenExtractorto extract aFetchResult.writer- theResultWriterto write the result to a sink.- Throws:
java.io.IOException
-
process
public final void process(java.lang.String... seedUrl) throws java.lang.InterruptedException, java.util.concurrent.ExecutionExceptionDescription copied from interface:CrawlerStarts the crawler, starting by the seedURL. The real logic is implemented by the crawler itself.- Specified by:
processin interfaceCrawler<T extends FetchResult>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
-
-