Package ca.uhn.fhir.jpa.batch2
Class JpaJobPersistenceImpl
java.lang.Object
ca.uhn.fhir.jpa.batch2.JpaJobPersistenceImpl
- All Implemented Interfaces:
IJobPersistence,IWorkChunkPersistence
-
Nested Class Summary
Nested classes/interfaces inherited from interface ca.uhn.fhir.batch2.api.IJobPersistence
IJobPersistence.CreateResult, IJobPersistence.JobInstanceUpdateCallback -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJpaJobPersistenceImpl(IBatch2JobInstanceRepository theJobInstanceRepository, IBatch2WorkChunkRepository theWorkChunkRepository, IHapiTransactionService theTransactionService, javax.persistence.EntityManager theEntityManager) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAdvanceInstanceToNextStep(String theInstanceId, String theCurrentStepId) cancelInstance(String theInstanceId) voiddeleteChunksAndMarkInstanceAsChunksPurged(String theInstanceId) voiddeleteInstanceAndChunks(String theInstanceId) fetchAllChunkIdsForStepWithStatus(String theInstanceId, String theStepId, WorkChunkStatusEnum theStatusEnum) fetchAllWorkChunksForStepStream(String theInstanceId, String theStepId) fetchAllWorkChunksIterator(String theInstanceId, boolean theWithData) Note: Not @Transactional because the transaction happens in a lambda that's called outside of this method's scopefetchInstance(String theInstanceId) fetchInstances(int thePageSize, int thePageIndex) fetchInstances(FetchJobInstancesRequest theRequest, int thePage, int theBatchSize) fetchInstances(String theJobDefinitionId, Set<StatusEnum> theStatuses, Date theCutoff, org.springframework.data.domain.Pageable thePageable) fetchInstancesByJobDefinitionId(String theJobDefinitionId, int thePageSize, int thePageIndex) fetchInstancesByJobDefinitionIdAndStatus(String theJobDefinitionId, Set<StatusEnum> theRequestedStatuses, int thePageSize, int thePageIndex) org.springframework.data.domain.Page<JobInstance>fetchJobInstances(JobInstanceFetchRequest theRequest) fetchRecentInstances(int thePageSize, int thePageIndex) booleanmarkInstanceAsStatusWhenStatusIn(String theInstanceId, StatusEnum theStatusEnum, Set<StatusEnum> thePriorStates) voidmarkWorkChunksWithStatusAndWipeData(String theInstanceId, List<String> theChunkIds, WorkChunkStatusEnum theStatus, String theErrorMessage) voidonWorkChunkCreate(WorkChunkCreateEvent theBatchWorkChunk) onWorkChunkDequeue(String theChunkId) onWorkChunkError(WorkChunkErrorEvent theParameters) voidonWorkChunkFailed(String theChunkId, String theErrorMessage) storeNewInstance(JobInstance theInstance) booleanupdateInstance(String theInstanceId, IJobPersistence.JobInstanceUpdateCallback theModifier) voidupdateInstanceUpdateTime(String theInstanceId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.batch2.api.IJobPersistence
onChunkDequeued, onCreateWithFirstChunk
-
Field Details
-
CREATE_TIME
- See Also:
-
-
Constructor Details
-
JpaJobPersistenceImpl
public JpaJobPersistenceImpl(IBatch2JobInstanceRepository theJobInstanceRepository, IBatch2WorkChunkRepository theWorkChunkRepository, IHapiTransactionService theTransactionService, javax.persistence.EntityManager theEntityManager) Constructor
-
-
Method Details
-
onWorkChunkCreate
- Specified by:
onWorkChunkCreatein interfaceIWorkChunkPersistence
-
onWorkChunkDequeue
@Transactional(propagation=REQUIRED) public Optional<WorkChunk> onWorkChunkDequeue(String theChunkId) - Specified by:
onWorkChunkDequeuein interfaceIWorkChunkPersistence
-
storeNewInstance
- Specified by:
storeNewInstancein interfaceIJobPersistence
-
fetchInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstances(String theJobDefinitionId, Set<StatusEnum> theStatuses, Date theCutoff, org.springframework.data.domain.Pageable thePageable) - Specified by:
fetchInstancesin interfaceIJobPersistence
-
fetchInstancesByJobDefinitionIdAndStatus
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstancesByJobDefinitionIdAndStatus(String theJobDefinitionId, Set<StatusEnum> theRequestedStatuses, int thePageSize, int thePageIndex) - Specified by:
fetchInstancesByJobDefinitionIdAndStatusin interfaceIJobPersistence
-
fetchInstancesByJobDefinitionId
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstancesByJobDefinitionId(String theJobDefinitionId, int thePageSize, int thePageIndex) - Specified by:
fetchInstancesByJobDefinitionIdin interfaceIJobPersistence
-
fetchJobInstances
@Transactional(propagation=REQUIRES_NEW) public org.springframework.data.domain.Page<JobInstance> fetchJobInstances(JobInstanceFetchRequest theRequest) - Specified by:
fetchJobInstancesin interfaceIJobPersistence
-
fetchInstance
- Specified by:
fetchInstancein interfaceIJobPersistence
-
fetchInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstances(FetchJobInstancesRequest theRequest, int thePage, int theBatchSize) - Specified by:
fetchInstancesin interfaceIJobPersistence
-
fetchInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstances(int thePageSize, int thePageIndex) - Specified by:
fetchInstancesin interfaceIJobPersistence
-
fetchRecentInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchRecentInstances(int thePageSize, int thePageIndex) - Specified by:
fetchRecentInstancesin interfaceIJobPersistence
-
onWorkChunkError
@Transactional(propagation=REQUIRES_NEW) public WorkChunkStatusEnum onWorkChunkError(WorkChunkErrorEvent theParameters) - Specified by:
onWorkChunkErrorin interfaceIWorkChunkPersistence
-
onWorkChunkFailed
- Specified by:
onWorkChunkFailedin interfaceIWorkChunkPersistence
-
onWorkChunkCompletion
- Specified by:
onWorkChunkCompletionin interfaceIWorkChunkPersistence
-
markWorkChunksWithStatusAndWipeData
public void markWorkChunksWithStatusAndWipeData(String theInstanceId, List<String> theChunkIds, WorkChunkStatusEnum theStatus, String theErrorMessage) - Specified by:
markWorkChunksWithStatusAndWipeDatain interfaceIWorkChunkPersistence
-
canAdvanceInstanceToNextStep
@Transactional(propagation=REQUIRES_NEW) public boolean canAdvanceInstanceToNextStep(String theInstanceId, String theCurrentStepId) - Specified by:
canAdvanceInstanceToNextStepin interfaceIJobPersistence
-
fetchAllChunkIdsForStepWithStatus
public List<String> fetchAllChunkIdsForStepWithStatus(String theInstanceId, String theStepId, WorkChunkStatusEnum theStatusEnum) - Specified by:
fetchAllChunkIdsForStepWithStatusin interfaceIWorkChunkPersistence
-
updateInstanceUpdateTime
- Specified by:
updateInstanceUpdateTimein interfaceIJobPersistence
-
fetchAllWorkChunksIterator
Note: Not @Transactional because the transaction happens in a lambda that's called outside of this method's scope- Specified by:
fetchAllWorkChunksIteratorin interfaceIJobPersistence- Specified by:
fetchAllWorkChunksIteratorin interfaceIWorkChunkPersistence
-
fetchAllWorkChunksForStepStream
- Specified by:
fetchAllWorkChunksForStepStreamin interfaceIJobPersistence- Specified by:
fetchAllWorkChunksForStepStreamin interfaceIWorkChunkPersistence
-
updateInstance
public boolean updateInstance(String theInstanceId, IJobPersistence.JobInstanceUpdateCallback theModifier) - Specified by:
updateInstancein interfaceIJobPersistence
-
deleteInstanceAndChunks
- Specified by:
deleteInstanceAndChunksin interfaceIJobPersistence
-
deleteChunksAndMarkInstanceAsChunksPurged
@Transactional(propagation=REQUIRES_NEW) public void deleteChunksAndMarkInstanceAsChunksPurged(String theInstanceId) - Specified by:
deleteChunksAndMarkInstanceAsChunksPurgedin interfaceIJobPersistence
-
markInstanceAsStatusWhenStatusIn
public boolean markInstanceAsStatusWhenStatusIn(String theInstanceId, StatusEnum theStatusEnum, Set<StatusEnum> thePriorStates) - Specified by:
markInstanceAsStatusWhenStatusInin interfaceIJobPersistence
-
cancelInstance
@Transactional(propagation=REQUIRES_NEW) public JobOperationResultJson cancelInstance(String theInstanceId) - Specified by:
cancelInstancein interfaceIJobPersistence
-