Class NihmsTransformLoadService

java.lang.Object
org.eclipse.pass.loader.nihms.NihmsTransformLoadService

public class NihmsTransformLoadService extends Object
Service that takes a filepath, gets the csvs there, and transforms/loads the data according to a list of statuses to be processed.
Author:
Karen Hanson
  • Constructor Details

    • NihmsTransformLoadService

      public NihmsTransformLoadService()
      Default constructor for NihmsTransformLoadService
    • NihmsTransformLoadService

      public NihmsTransformLoadService(NihmsPassClientService passClientService, PmidLookup pmidLookup, SubmissionStatusService statusService)
      Option to inject dependencies
      Parameters:
      passClientService - the NihmsPassClientService instance to use
      pmidLookup - the PmidLookup instance to use
      statusService - the SubmissionStatusService instance to use
  • Method Details

    • transformAndLoadFiles

      public void transformAndLoadFiles(Set<NihmsStatus> statusesToProcess)
      Goes through list of files in directory specified and processes those that have a NihmsStatus that matches a row in statusesToProcess. If statuseseToProcess is null/empty, it will process all statuses
      Parameters:
      statusesToProcess - if null or empty, all statuses will be processed.
    • transformAndLoadNihmsPub

      public void transformAndLoadNihmsPub(NihmsPublication pub) throws IOException
      Takes pub record from CSV loader, transforms it then passes transformed record to the loader. Exceptions generally should not be caught here, they should be caught by CSV processor which tallies the successes/failures. The only Exception caught is UpdateConflictException, which is easy to recover from. On catching an UpdateConflictException, it will attempt several retries before failing and moving on
      Parameters:
      pub - the NihmsPublication object
      Throws:
      IOException - if there is an error transforming or loading the publication