Package com.norconex.crawler.core
Class CrawlerCallbacks.CrawlerCallbacksBuilder
java.lang.Object
com.norconex.crawler.core.CrawlerCallbacks.CrawlerCallbacksBuilder
- Enclosing class:
CrawlerCallbacks
-
Method Summary
Modifier and TypeMethodDescriptionafterCommand(BiConsumer<CrawlerSession, Class<? extends Command>> afterCommand) Invoked after a command has been executed, but before resources are closed.afterDocumentFinalizing(BiConsumer<CrawlerSession, Doc> afterDocumentFinalizing) afterDocumentProcessing(BiConsumer<CrawlerSession, Doc> afterDocumentProcessing) afterSession(Consumer<CrawlerConfig> afterSession) Invoked after a crawl session has been destroyed and resources closed.beforeCommand(BiConsumer<CrawlerSession, Class<? extends Command>> beforeCommand) Invoked before a command is executed, after the session and crawl context have been initialized.beforeDocumentFinalizing(BiConsumer<CrawlerSession, Doc> beforeDocumentFinalizing) beforeDocumentProcessing(BiConsumer<CrawlerSession, Doc> beforeDocumentProcessing) beforeSession(Consumer<CrawlerConfig> beforeSession) Invoked before the crawl session gets initialized (which is also before any command gets executed).build()toString()
-
Method Details
-
beforeSession
public CrawlerCallbacks.CrawlerCallbacksBuilder beforeSession(Consumer<CrawlerConfig> beforeSession) Invoked before the crawl session gets initialized (which is also before any command gets executed). Modifying the CrawlerConfig is generally safe here.- Returns:
this.
-
afterSession
Invoked after a crawl session has been destroyed and resources closed.- Returns:
this.
-
beforeCommand
public CrawlerCallbacks.CrawlerCallbacksBuilder beforeCommand(BiConsumer<CrawlerSession, Class<? extends Command>> beforeCommand) Invoked before a command is executed, after the session and crawl context have been initialized. Rely on the supplied command class to know which command.- Returns:
this.- See Also:
-
afterCommand
public CrawlerCallbacks.CrawlerCallbacksBuilder afterCommand(BiConsumer<CrawlerSession, Class<? extends Command>> afterCommand) Invoked after a command has been executed, but before resources are closed. Rely on the supplied command class to know which command.- Returns:
this.- See Also:
-
beforeDocumentProcessing
public CrawlerCallbacks.CrawlerCallbacksBuilder beforeDocumentProcessing(BiConsumer<CrawlerSession, Doc> beforeDocumentProcessing) - Returns:
this.
-
afterDocumentProcessing
public CrawlerCallbacks.CrawlerCallbacksBuilder afterDocumentProcessing(BiConsumer<CrawlerSession, Doc> afterDocumentProcessing) - Returns:
this.
-
beforeDocumentFinalizing
public CrawlerCallbacks.CrawlerCallbacksBuilder beforeDocumentFinalizing(BiConsumer<CrawlerSession, Doc> beforeDocumentFinalizing) - Returns:
this.
-
afterDocumentFinalizing
public CrawlerCallbacks.CrawlerCallbacksBuilder afterDocumentFinalizing(BiConsumer<CrawlerSession, Doc> afterDocumentFinalizing) - Returns:
this.
-
build
-
toString
-