Package org.eclipse.pass.loader.nihms
Class NihmsTransformLoadService
java.lang.Object
org.eclipse.pass.loader.nihms.NihmsTransformLoadService
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 Summary
ConstructorsConstructorDescriptionDefault constructor for NihmsTransformLoadServiceNihmsTransformLoadService(NihmsPassClientService passClientService, PmidLookup pmidLookup, SubmissionStatusService statusService) Option to inject dependencies -
Method Summary
Modifier and TypeMethodDescriptionvoidtransformAndLoadFiles(Set<NihmsStatus> statusesToProcess) Goes through list of files in directory specified and processes those that have a NihmsStatus that matches a row in statusesToProcess.voidTakes pub record from CSV loader, transforms it then passes transformed record to the loader.
-
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 usepmidLookup- the PmidLookup instance to usestatusService- the SubmissionStatusService instance to use
-
-
Method Details
-
transformAndLoadFiles
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
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
-