@Repository(value="blProcessManagementDao") @Lazy public class ProcessManagementDaoImpl extends Object implements ProcessManagementDao
ProcessManagementDao
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected DatabaseSystemEventNode |
systemEventNode |
Constructor and Description |
---|
ProcessManagementDaoImpl() |
Modifier and Type | Method and Description |
---|---|
ProcessStatus |
archive(ProcessStatus processStatus) |
Boolean |
containsRecentlyActiveByExecutionType(int thresholdSeconds,
String executionType)
Determine if there are currently any active ProcessStatus instances with the given executionType,
or if there are any "recently" archived ProcessStatus instances of the given type.
|
void |
delete(ProcessStatus processStatus) |
List<ProcessStatus> |
findAbandonedProcesses(int thresholdSeconds)
Find the list of ProcessStatus instances whose
ProcessStatus.getLastUpdated()
time is older than the current database time subtracting the threshold. |
List<ProcessStatus> |
findAllByExecution(Long executionId,
String executionType,
int maxResults)
Find all ProcessStatus instances based on information tied to the async process associated.
|
ProcessStatus |
findByExecution(Long executionId,
String executionType)
Find the first active ProcessStatus instance based on information tied to the async process associated.
|
List<ProcessStatus> |
findOldArchivedProcesses(int thresholdSeconds)
Find any processes that are archived and older than the current time - threshold.
|
void |
finish(Long processId)
Records the time when the process finished executing.
|
List<Long> |
getAllPersistedProcessIds()
Retrieve all the processIds for all ProcessStatus instances
|
protected Date |
getCurrentTime() |
void |
keepAlive(List<Long> processIds)
Update the
ProcessStatus.getLastUpdated() field
to the current time of the database server. |
protected void |
keepAliveUpdate(List<Long> processIdsPart) |
ProcessStatus |
loadByProcessId(Long processId) |
void |
refresh(ProcessStatus processStatus) |
ProcessStatus |
save(ProcessStatus processStatus) |
void |
start(Long processId)
Records the time when the process began to execute.
|
ProcessStatus |
unArchive(ProcessStatus processStatus) |
protected javax.persistence.EntityManager em
protected DatabaseSystemEventNode systemEventNode
public ProcessStatus save(ProcessStatus processStatus)
save
in interface ProcessManagementDao
public void refresh(ProcessStatus processStatus)
refresh
in interface ProcessManagementDao
public void keepAlive(List<Long> processIds)
ProcessManagementDao
ProcessStatus.getLastUpdated()
field
to the current time of the database server.keepAlive
in interface ProcessManagementDao
public void start(Long processId)
ProcessManagementDao
start
in interface ProcessManagementDao
public void finish(Long processId)
ProcessManagementDao
finish
in interface ProcessManagementDao
public void delete(ProcessStatus processStatus)
delete
in interface ProcessManagementDao
public ProcessStatus archive(ProcessStatus processStatus)
archive
in interface ProcessManagementDao
public ProcessStatus unArchive(ProcessStatus processStatus)
unArchive
in interface ProcessManagementDao
public List<Long> getAllPersistedProcessIds()
ProcessManagementDao
getAllPersistedProcessIds
in interface ProcessManagementDao
public ProcessStatus loadByProcessId(Long processId)
loadByProcessId
in interface ProcessManagementDao
public List<ProcessStatus> findAbandonedProcesses(int thresholdSeconds)
ProcessManagementDao
ProcessStatus.getLastUpdated()
time is older than the current database time subtracting the threshold.findAbandonedProcesses
in interface ProcessManagementDao
public Boolean containsRecentlyActiveByExecutionType(int thresholdSeconds, String executionType)
ProcessManagementDao
containsRecentlyActiveByExecutionType
in interface ProcessManagementDao
thresholdSeconds
- The number of seconds in the past used to check for ProcessStatus last updated. Any status
older than this threshold is not considered.executionType
- an identifying type value (e.g. the class name from an entity used in the async process)public List<ProcessStatus> findOldArchivedProcesses(int thresholdSeconds)
ProcessManagementDao
findOldArchivedProcesses
in interface ProcessManagementDao
public ProcessStatus findByExecution(Long executionId, String executionType)
ProcessManagementDao
findByExecution
in interface ProcessManagementDao
executionId
- an identifying long id (e.g. the primary key from an entity used in the async process)executionType
- an identifying tyep value (e.g. the class name from an entity used in the async process)public List<ProcessStatus> findAllByExecution(Long executionId, String executionType, int maxResults)
ProcessManagementDao
findAllByExecution
in interface ProcessManagementDao
executionId
- an identifying long id (e.g. the primary key from an entity used in the async process)executionType
- an identifying tyep value (e.g. the class name from an entity used in the async process)maxResults
- maximum quantity of results to acquireprotected Date getCurrentTime()
Copyright © 2020. All rights reserved.