Package cdc.impex.imports
Class BatchSheetImporter
java.lang.Object
cdc.impex.imports.BatchSheetImporter
- All Implemented Interfaces:
SheetImporter
Utility class that implements SheetImporter, delegating all the work, and adds batch notifications.
This class can be used to commit data every batch size rows.
- Author:
- Damien Carbonne
-
Field Summary
Fields inherited from interface cdc.impex.imports.SheetImporter
QUIET_VOID, VERBOSE_VOID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbatch()Method that is invoked every batch size data in a sheet, and if necessary when ending the sheet.final voidbeginSheetImport(String systemId, String sheetName, SheetTemplate template, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Invoked to notify the beginning of the import of a sheet.final voidendSheetImport(String systemId, String sheetName, SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Invoked to notify the end of the import of a sheet.final intfinal voidimportHeader(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) final voidInvoked to notify the import a row.setBatchSize(int batchSize) Sets the batch size.
-
Constructor Details
-
BatchSheetImporter
-
-
Method Details
-
getDelegate
-
getBatchSize
public final int getBatchSize() -
setBatchSize
Sets the batch size.WARNING: MUST not be called during execution.
- Parameters:
batchSize- The batch size. IfbatchSize <= 0, batch is never called.- Returns:
- This object.
- Throws:
AssertionError- If this method is called during execution.
-
batch
public void batch()Method that is invoked every batch size data in a sheet, and if necessary when ending the sheet.Its default implementation does nothing and should be overridden.
-
beginSheetImport
public final void beginSheetImport(String systemId, String sheetName, SheetTemplate template, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Description copied from interface:SheetImporterInvoked to notify the beginning of the import of a sheet.- Specified by:
beginSheetImportin interfaceSheetImporter- Parameters:
systemId- The system if of the imported data.sheetName- The sheet name.template- The sheet template associated to this import.issuesHandler- The issues handler that should be used by the application to generate new issues.
-
importHeader
public final void importHeader(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) - Specified by:
importHeaderin interfaceSheetImporter
-
importRow
public final void importRow(ImportRow row, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Description copied from interface:SheetImporterInvoked to notify the import a row.- Specified by:
importRowin interfaceSheetImporter- Parameters:
row- The imported row.issuesHandler- The issues handler that should be used by the application to generate new issues.
-
endSheetImport
public final void endSheetImport(String systemId, String sheetName, SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Description copied from interface:SheetImporterInvoked to notify the end of the import of a sheet.- Specified by:
endSheetImportin interfaceSheetImporter- Parameters:
systemId- The system if of the imported data.sheetName- The sheet name.templateInstance- The sheet template instance associated to this import.issuesHandler- The issues handler that should be used by the application to generate new issues.
-