public abstract class AbstractCollector extends Object implements ICollector
Constructor and Description |
---|
AbstractCollector(ICollectorConfig collectorConfig)
Creates and configure a Collector with the provided
configuration.
|
Modifier and Type | Method and Description |
---|---|
protected abstract ICrawler |
createCrawler(ICrawlerConfig config)
Creates a new crawler instance.
|
JobSuite |
createJobSuite() |
ICollectorConfig |
getCollectorConfig()
Gets the collector configuration
|
ICrawler[] |
getCrawlers()
Gets all crawler instances in this collector.
|
String |
getId() |
JobSuite |
getJobSuite()
Gets the job suite or
null if the the collector
was not yet started or is no longer running. |
JobState |
getState()
Gets the state of this collector.
|
void |
setCrawlers(ICrawler[] crawlers)
Add the provided crawlers to this collector.
|
void |
start(boolean resumeNonCompleted)
Start all crawlers defined in configuration.
|
void |
stop()
Stops a running instance of this Collector.
|
public AbstractCollector(ICollectorConfig collectorConfig)
collectorConfig
- Collector configurationpublic JobSuite getJobSuite()
null
if the the collector
was not yet started or is no longer running.getJobSuite
in interface ICollector
public JobState getState()
JobState.UNKNOWN
is returned.public void start(boolean resumeNonCompleted)
start
in interface ICollector
resumeNonCompleted
- whether to resume where previous crawler
aborted (if applicable)public void stop()
stop
in interface ICollector
public JobSuite createJobSuite()
createJobSuite
in interface IJobSuiteFactory
protected abstract ICrawler createCrawler(ICrawlerConfig config)
config
- crawler configurationpublic ICollectorConfig getCollectorConfig()
getCollectorConfig
in interface ICollector
public String getId()
getId
in interface ICollector
public void setCrawlers(ICrawler[] crawlers)
crawlers
- crawlers to addpublic ICrawler[] getCrawlers()
Copyright © 2014–2021 Norconex Inc.. All rights reserved.