Class ChunkWriter

  • All Implemented Interfaces:
    javax.batch.api.chunk.ItemWriter

    @Dependent
    public class ChunkWriter
    extends javax.batch.api.chunk.AbstractItemWriter
    BulkData $import ChunkWriter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) javax.batch.runtime.context.JobContext jobCtx  
      (package private) javax.batch.runtime.context.StepContext stepCtx  
    • Constructor Summary

      Constructors 
      Constructor Description
      ChunkWriter()  
    • Field Detail

      • stepCtx

        @Inject
        javax.batch.runtime.context.StepContext stepCtx
      • jobCtx

        @Inject
        javax.batch.runtime.context.JobContext jobCtx
    • Constructor Detail

      • ChunkWriter

        public ChunkWriter()
    • Method Detail

      • open

        public void open​(java.io.Serializable checkpoint)
                  throws java.lang.Exception
        Specified by:
        open in interface javax.batch.api.chunk.ItemWriter
        Overrides:
        open in class javax.batch.api.chunk.AbstractItemWriter
        Throws:
        java.lang.Exception
      • writeItems

        public void writeItems​(java.util.List<java.lang.Object> arg0)
                        throws java.lang.Exception
        Specified by:
        writeItems in interface javax.batch.api.chunk.ItemWriter
        Specified by:
        writeItems in class javax.batch.api.chunk.AbstractItemWriter
        Throws:
        java.lang.Exception
      • conditionalFingerprintUpdate

        public OperationOutcome conditionalFingerprintUpdate​(ImportTransientUserData chunkData,
                                                             boolean skip,
                                                             FHIRPersistence persistence,
                                                             FHIRPersistenceContext context,
                                                             java.lang.String logicalId,
                                                             Resource resource,
                                                             BulkDataContext ctx,
                                                             long line)
                                                      throws java.lang.Exception
        conditional update checks to see if our cache contains the key, if not reads from the db, and calculates the cache. The cache is saved within the context of this particular execution, and then destroyed.
        Parameters:
        chunkData - the transient user data used increment the number of skips
        skip - should skip the resource if it matches
        persistence - used to facilitate the calls to the underlying db
        context - used in db calls
        logicalId - the logical id of the FHIR resource (e.g. 1-2-3-4)
        resource - the FHIR Resource
        ctx - the bulk data context
        line - the line number
        Returns:
        outcomes including information or warnings
        Throws:
        java.lang.Exception