Class Importer

java.lang.Object
com.norconex.importer.Importer
All Implemented Interfaces:
Closeable, AutoCloseable

public class Importer extends Object implements Closeable
Principal class responsible for importing documents. Refer to ImporterConfig for configuration options. Thread-safe, and reusing the same instance is highly recommended.
See Also:
  • Constructor Details

    • Importer

      public Importer()
      Creates a new importer with default configuration.
    • Importer

      public Importer(ImporterConfig importerConfig)
      Creates a new importer with the given configuration.
      Parameters:
      importerConfig - Importer configuration
    • Importer

      public Importer(ImporterConfig importerConfig, EventManager eventManager)
      Creates a new importer with the given configuration.
      Parameters:
      importerConfig - Importer configuration
      eventManager - event manager
  • Method Details

    • get

      public static Importer get()
    • main

      public static void main(String[] args)
      Invokes the importer from the command line.
      Parameters:
      args - Invoke it once without any arguments to get a list of command-line options.
    • getEventManager

      public EventManager getEventManager()
      Gets the event manager.
      Returns:
      event manager
    • importDocument

      public ImporterResponse importDocument(ImporterRequest req)
      Imports a document according to the importer configuration.
      Parameters:
      req - request instructions for importing
      Returns:
      importer response
    • importDocument

      public ImporterResponse importDocument(Doc document)
      Imports a document according to the importer configuration.
      Parameters:
      document - the document to import
      Returns:
      importer response
    • init

      public void init()
      Initializes the importer. Invokes init on all handlers. If not explicitly called first, it is called implicitly by one of the import method, only once per importer instance.
    • close

      public void close()
      Closes the importer and its resources. Has to be invoked explicitly when the importer is no longer in use.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getConfiguration

      public ImporterConfig getConfiguration()