Package com.norconex.importer
Class Importer
java.lang.Object
com.norconex.importer.Importer
- All Implemented Interfaces:
Closeable,AutoCloseable
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 Summary
ConstructorsConstructorDescriptionImporter()Creates a new importer with default configuration.Importer(ImporterConfig importerConfig) Creates a new importer with the given configuration.Importer(ImporterConfig importerConfig, EventManager eventManager) Creates a new importer with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidclose()Closes the importer and its resources.booleanstatic Importerget()Gets the event manager.inthashCode()importDocument(Doc document) Imports a document according to the importer configuration.Imports a document according to the importer configuration.voidinit()Initializes the importer.static voidInvokes the importer from the command line.toString()
-
Constructor Details
-
Importer
public Importer()Creates a new importer with default configuration. -
Importer
Creates a new importer with the given configuration.- Parameters:
importerConfig- Importer configuration
-
Importer
Creates a new importer with the given configuration.- Parameters:
importerConfig- Importer configurationeventManager- event manager
-
-
Method Details
-
get
-
main
Invokes the importer from the command line.- Parameters:
args- Invoke it once without any arguments to get a list of command-line options.
-
getEventManager
Gets the event manager.- Returns:
- event manager
-
importDocument
Imports a document according to the importer configuration.- Parameters:
req- request instructions for importing- Returns:
- importer response
-
importDocument
Imports a document according to the importer configuration.- Parameters:
document- the document to import- Returns:
- importer response
-
init
public void init()Initializes the importer. Invokesiniton 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getConfiguration
-