Class CrawlerCallbacks

java.lang.Object
com.norconex.crawler.core.CrawlerCallbacks
All Implemented Interfaces:
EventListener<Event>, EventListener, Consumer<Event>

public class CrawlerCallbacks extends Object implements EventListener<Event>

Optional callbacks invoked at specific times in the crawler life-cycle. The flow of execution for a crawl is as follow (callbacks are bold):

  • Launch crawler.
  • Invoke beforeSession.
  • Initialize crawl session.
  • For each command:
    • Invoke beforeCommand.
    • Execute command.
    • For each document:
      • Invoke beforeDocumentProcessing.
      • Process document (fetch, parse, transform, etc.)
      • Invoke afterDocumentProcessing.
      • Invoke beforeDocumentFinalizing.
      • Finalize document (upsert/delete, close resources, etc.)
      • Invoke afterDocumentFinalizing.
    • Invoke afterCommand
  • Invoke afterSession