@Service @DependsOn(value="liquibase") public class PruneServiceImpl extends PruningCommon implements PruneService
Modifier and Type | Class and Description |
---|---|
class |
PruneServiceImpl.PruneTask
Runnable scheduled task that runs in future and executes pruning of logs.
|
Constructor and Description |
---|
PruneServiceImpl(WorkflowExecutionDAO workflowExecutionDAO,
double pruneAfter,
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler threadPoolTaskScheduler,
ErrorDefinitionDAO errorDefinitionDAO,
ErrorMetadataDAO errorMetadataDAO,
LogDAO logDAO)
Instantiates a new Prune service.
|
Modifier and Type | Method and Description |
---|---|
void |
dropPruning()
Cancels all pruning tasks.
|
void |
dropPruningFor(WorkflowExecution workflowExecution)
Drop pruning for a given workflow execution
|
Map<PruneServiceImpl.PruneTask,ScheduledFuture<?>> |
getScheduledTasks()
Get currently scheduled pruning tasks
|
PruneServiceImpl.PruneTask |
newPruningTask(WorkflowExecution workflowExecution,
Date date)
Creates a new pruning task, which is then registered in the spring task scheduler.
|
protected void |
prune(WorkflowExecution workflowExecution) |
void |
pruneNonExecutionLogs()
Spring scheduled method pruning expired logs that don't belong to a workflow execution.
|
void |
schedulePruning()
Initial prune scheduling.
|
void |
schedulePruning(WorkflowExecution workflowExecution)
Schedules pruning for a single workflow execution.
|
void |
updateScheduledPruning(double updatedValue)
Changes times of the scheduled prunings.
|
updateErrors
@Autowired public PruneServiceImpl(WorkflowExecutionDAO workflowExecutionDAO, @Value(value="${logviewer.pruneAfter}") double pruneAfter, org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler threadPoolTaskScheduler, ErrorDefinitionDAO errorDefinitionDAO, ErrorMetadataDAO errorMetadataDAO, LogDAO logDAO)
workflowExecutionDAO
- the workflow execution daopruneAfter
- the prune afterthreadPoolTaskScheduler
- the thread pool task schedulererrorDefinitionDAO
- the error definition daoerrorMetadataDAO
- the error metadata daologDAO
- the log daopublic void dropPruning()
PruneService
dropPruning
in interface PruneService
public void dropPruningFor(WorkflowExecution workflowExecution)
PruneService
dropPruningFor
in interface PruneService
workflowExecution
- workflow executionpublic void schedulePruning(WorkflowExecution workflowExecution)
PruneService
schedulePruning
in interface PruneService
workflowExecution
- workflow execution that should be pruned@Transactional @PostConstruct public void schedulePruning()
PruneService
schedulePruning
in interface PruneService
public void updateScheduledPruning(double updatedValue)
PruneService
updateScheduledPruning
in interface PruneService
updatedValue
- new pruning expiry valuepublic Map<PruneServiceImpl.PruneTask,ScheduledFuture<?>> getScheduledTasks()
PruneService
getScheduledTasks
in interface PruneService
@Transactional protected void prune(WorkflowExecution workflowExecution)
@Scheduled(cron="0 0 * ? * *") @Transactional public void pruneNonExecutionLogs()
PruneService
pruneNonExecutionLogs
in interface PruneService
public PruneServiceImpl.PruneTask newPruningTask(WorkflowExecution workflowExecution, Date date)
PruneService
newPruningTask
in interface PruneService
workflowExecution
- workflow execution that should be pruneddate
- time of pruningCopyright © 2020. All rights reserved.