@Repository(value="blProcessDao") public class ProcessDaoImpl extends Object implements ProcessDao
ProcessDao
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected org.broadleafcommerce.profile.core.service.IdGenerationService |
idGenerationService |
protected DatabaseSystemEventNode |
systemEventNode |
Constructor and Description |
---|
ProcessDaoImpl() |
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. |
ProcessStatus |
findByExecution(Long executionId,
String executionType)
Find a 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.
|
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. |
ProcessStatus |
loadByProcessId(Long processId) |
void |
refresh(ProcessStatus processStatus) |
ProcessStatus |
save(ProcessStatus processStatus) |
ProcessStatus |
unArchive(ProcessStatus processStatus) |
protected javax.persistence.EntityManager em
protected org.broadleafcommerce.profile.core.service.IdGenerationService idGenerationService
protected DatabaseSystemEventNode systemEventNode
public ProcessStatus save(ProcessStatus processStatus)
save
in interface ProcessDao
public void refresh(ProcessStatus processStatus)
refresh
in interface ProcessDao
public void keepAlive(List<Long> processIds)
ProcessDao
ProcessStatus.getLastUpdated()
field
to the current time of the database server.keepAlive
in interface ProcessDao
public void delete(ProcessStatus processStatus)
delete
in interface ProcessDao
public ProcessStatus archive(ProcessStatus processStatus)
archive
in interface ProcessDao
public ProcessStatus unArchive(ProcessStatus processStatus)
unArchive
in interface ProcessDao
public List<Long> getAllPersistedProcessIds()
ProcessDao
getAllPersistedProcessIds
in interface ProcessDao
public ProcessStatus loadByProcessId(Long processId)
loadByProcessId
in interface ProcessDao
public List<ProcessStatus> findAbandonedProcesses(int thresholdSeconds)
ProcessDao
ProcessStatus.getLastUpdated()
time is older than the current database time subtracting the threshold.findAbandonedProcesses
in interface ProcessDao
public Boolean containsRecentlyActiveByExecutionType(int thresholdSeconds, String executionType)
ProcessDao
containsRecentlyActiveByExecutionType
in interface ProcessDao
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)
ProcessDao
findOldArchivedProcesses
in interface ProcessDao
public ProcessStatus findByExecution(Long executionId, String executionType)
ProcessDao
findByExecution
in interface ProcessDao
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)protected Date getCurrentTime()
Copyright © 2019. All rights reserved.