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
-
Constructor Summary
ConstructorDescriptionJpaJobPersistenceImpl
(IBatch2JobInstanceRepository theJobInstanceRepository, IBatch2WorkChunkRepository theWorkChunkRepository, IHapiTransactionService theTransactionService, jakarta.persistence.EntityManager theEntityManager, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
canAdvanceInstanceToNextStep
(String theInstanceId, String theCurrentStepId) cancelInstance
(String theInstanceId) void
deleteChunksAndMarkInstanceAsChunksPurged
(String theInstanceId) void
deleteInstanceAndChunks
(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) boolean
markInstanceAsStatusWhenStatusIn
(String theInstanceId, StatusEnum theStatusEnum, Set<StatusEnum> thePriorStates) void
markWorkChunksWithStatusAndWipeData
(String theInstanceId, List<String> theChunkIds, WorkChunkStatusEnum theStatus, String theErrorMessage) void
onWorkChunkCreate
(WorkChunkCreateEvent theBatchWorkChunk) onWorkChunkDequeue
(String theChunkId) onWorkChunkError
(WorkChunkErrorEvent theParameters) void
onWorkChunkFailed
(String theChunkId, String theErrorMessage) storeNewInstance
(JobInstance theInstance) boolean
updateInstance
(String theInstanceId, IJobPersistence.JobInstanceUpdateCallback theModifier) void
updateInstanceUpdateTime
(String theInstanceId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, jakarta.persistence.EntityManager theEntityManager, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster) Constructor
-
-
Method Details
-
onWorkChunkCreate
@Transactional(propagation=REQUIRED) public String onWorkChunkCreate(WorkChunkCreateEvent theBatchWorkChunk) - Specified by:
onWorkChunkCreate
in interfaceIWorkChunkPersistence
-
onWorkChunkDequeue
@Transactional(propagation=REQUIRED) public Optional<WorkChunk> onWorkChunkDequeue(String theChunkId) - Specified by:
onWorkChunkDequeue
in interfaceIWorkChunkPersistence
-
storeNewInstance
- Specified by:
storeNewInstance
in 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:
fetchInstances
in interfaceIJobPersistence
-
fetchInstancesByJobDefinitionIdAndStatus
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstancesByJobDefinitionIdAndStatus(String theJobDefinitionId, Set<StatusEnum> theRequestedStatuses, int thePageSize, int thePageIndex) - Specified by:
fetchInstancesByJobDefinitionIdAndStatus
in interfaceIJobPersistence
-
fetchInstancesByJobDefinitionId
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstancesByJobDefinitionId(String theJobDefinitionId, int thePageSize, int thePageIndex) - Specified by:
fetchInstancesByJobDefinitionId
in interfaceIJobPersistence
-
fetchJobInstances
@Transactional(propagation=REQUIRES_NEW) public org.springframework.data.domain.Page<JobInstance> fetchJobInstances(JobInstanceFetchRequest theRequest) - Specified by:
fetchJobInstances
in interfaceIJobPersistence
-
fetchInstance
- Specified by:
fetchInstance
in interfaceIJobPersistence
-
fetchInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstances(FetchJobInstancesRequest theRequest, int thePage, int theBatchSize) - Specified by:
fetchInstances
in interfaceIJobPersistence
-
fetchInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchInstances(int thePageSize, int thePageIndex) - Specified by:
fetchInstances
in interfaceIJobPersistence
-
fetchRecentInstances
@Transactional(propagation=REQUIRES_NEW) public List<JobInstance> fetchRecentInstances(int thePageSize, int thePageIndex) - Specified by:
fetchRecentInstances
in interfaceIJobPersistence
-
onWorkChunkError
- Specified by:
onWorkChunkError
in interfaceIWorkChunkPersistence
-
onWorkChunkFailed
- Specified by:
onWorkChunkFailed
in interfaceIWorkChunkPersistence
-
onWorkChunkCompletion
- Specified by:
onWorkChunkCompletion
in interfaceIWorkChunkPersistence
-
markWorkChunksWithStatusAndWipeData
public void markWorkChunksWithStatusAndWipeData(String theInstanceId, List<String> theChunkIds, WorkChunkStatusEnum theStatus, String theErrorMessage) - Specified by:
markWorkChunksWithStatusAndWipeData
in interfaceIWorkChunkPersistence
-
canAdvanceInstanceToNextStep
@Transactional(propagation=REQUIRES_NEW) public boolean canAdvanceInstanceToNextStep(String theInstanceId, String theCurrentStepId) - Specified by:
canAdvanceInstanceToNextStep
in interfaceIJobPersistence
-
fetchAllChunkIdsForStepWithStatus
public List<String> fetchAllChunkIdsForStepWithStatus(String theInstanceId, String theStepId, WorkChunkStatusEnum theStatusEnum) - Specified by:
fetchAllChunkIdsForStepWithStatus
in interfaceIWorkChunkPersistence
-
updateInstanceUpdateTime
- Specified by:
updateInstanceUpdateTime
in interfaceIJobPersistence
-
fetchAllWorkChunksIterator
Note: Not @Transactional because the transaction happens in a lambda that's called outside of this method's scope- Specified by:
fetchAllWorkChunksIterator
in interfaceIJobPersistence
- Specified by:
fetchAllWorkChunksIterator
in interfaceIWorkChunkPersistence
-
fetchAllWorkChunksForStepStream
- Specified by:
fetchAllWorkChunksForStepStream
in interfaceIJobPersistence
- Specified by:
fetchAllWorkChunksForStepStream
in interfaceIWorkChunkPersistence
-
updateInstance
public boolean updateInstance(String theInstanceId, IJobPersistence.JobInstanceUpdateCallback theModifier) - Specified by:
updateInstance
in interfaceIJobPersistence
-
deleteInstanceAndChunks
- Specified by:
deleteInstanceAndChunks
in interfaceIJobPersistence
-
deleteChunksAndMarkInstanceAsChunksPurged
@Transactional(propagation=REQUIRES_NEW) public void deleteChunksAndMarkInstanceAsChunksPurged(String theInstanceId) - Specified by:
deleteChunksAndMarkInstanceAsChunksPurged
in interfaceIJobPersistence
-
markInstanceAsStatusWhenStatusIn
public boolean markInstanceAsStatusWhenStatusIn(String theInstanceId, StatusEnum theStatusEnum, Set<StatusEnum> thePriorStates) - Specified by:
markInstanceAsStatusWhenStatusIn
in interfaceIJobPersistence
-
cancelInstance
@Transactional(propagation=REQUIRES_NEW) public JobOperationResultJson cancelInstance(String theInstanceId) - Specified by:
cancelInstance
in interfaceIJobPersistence
-