Package se.ikama.bauta.batch.tasklet
Class SqlValidationTasklet
- java.lang.Object
-
- se.ikama.bauta.batch.tasklet.ReportTasklet
-
- se.ikama.bauta.batch.tasklet.ThymeleafReportTasklet
-
- se.ikama.bauta.batch.tasklet.SqlValidationTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.Tasklet,org.springframework.beans.factory.InitializingBean,ReportGenerator
public class SqlValidationTasklet extends ThymeleafReportTasklet implements ReportGenerator, org.springframework.beans.factory.InitializingBean
Validates the content of the staging database using sql queries and validation rules
-
-
Field Summary
-
Fields inherited from class se.ikama.bauta.batch.tasklet.ThymeleafReportTasklet
templateEngine
-
Fields inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
failIfValidationFailures, reportDir
-
-
Constructor Summary
Constructors Constructor Description SqlValidationTasklet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()ReportGenerationResultgenerateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc)Generate a reportjava.lang.StringgetReportFilename()Name for the generated report file-
Methods inherited from class se.ikama.bauta.batch.tasklet.ThymeleafReportTasklet
getTemplateEngine, setTemplateEngine
-
Methods inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
addReportGenerator, execute, setReportGenerators
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.ikama.bauta.batch.tasklet.ReportGenerator
getReportName
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
generateReport
@Transactional(readOnly=true, transactionManager="stagingTransactionManager") public ReportGenerationResult generateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc) throws java.lang.ExceptionDescription copied from interface:ReportGeneratorGenerate a report- Specified by:
generateReportin interfaceReportGenerator- Parameters:
reportFile- The file to write the report tosc- The current step contributioncc- The current ChunkContext- Returns:
- A ReportGenerationResult. Typically with the status OK.
For certain types of report generators with a notion of "failure", it may make sense to return Failed, to support. See @
SqlValidationTasklet - Throws:
java.lang.Exception
-
getReportFilename
public java.lang.String getReportFilename()
Description copied from interface:ReportGeneratorName for the generated report file- Specified by:
getReportFilenamein interfaceReportGenerator
-
-