Interface ImportProcessor
- All Known Implementing Classes:
DefaultImportProcessor
public interface ImportProcessor
Parses and handles a particular import file.
Note that ImportManager will delegate processing to the first ImportProcessor for
which canProcess(Import) returns true.
- Author:
- Phillip Verheyden (phillipuniverse), Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(Import metadata) Whether or not this processor can handle the given import.voidprocess(ImportProcessingContext<? extends FileReaderContext> context) Performs the operations required to transform the givenfileinto persisting into a backing data store.
-
Method Details
-
canProcess
Whether or not this processor can handle the given import.- Parameters:
metadata- details about a particular import that needs to be processed- Returns:
trueif this processor should handle the import,falseotherwise
-
process
Performs the operations required to transform the givenfileinto persisting into a backing data store. The actual persistence will usually be remote and so this processor's main job is to convert the file to a JSON representation and publish batch messages for resource tiers to persist to their data store.Any records which are detected to have errors (ex: invalid row types) are pruned from the published batches, and a new
BatchItemCompletionis created in the data store for each. TheImport.errorCountis updated accordingly.If at the end of this processing, the processor detects that the
Import.successCountandImport.errorCountsum toImport.totalItems, it will mark the import as complete.- Parameters:
context- the current import being executed- Throws:
ImportProcessingException- if there was a problem such as not being able to read the file, could not convert the contents, etc
-