Class ProgressPersistenceManagerImpl
java.lang.Object
ch.tocco.nice2.tasks.impl.progress.ProgressPersistenceManagerImpl
- All Implemented Interfaces:
ProgressPersistenceManager
@Component
public class ProgressPersistenceManagerImpl
extends Object
implements ProgressPersistenceManager
-
Constructor Summary
ConstructorDescriptionProgressPersistenceManagerImpl
(CommandExecutor commandExecutor, org.slf4j.Logger log, TextResources textResources, PrincipalService principalService, CascadingDeleteService cascadingDeleteService, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateProgress
(String taskId, String taskName) Create a newProgressBean
object.void
Delete a Task_execution entity.findLatestLogEntry
(String taskId) findLogEntryByState
(String state) Find a singleLogEntry
for a given state value.Get progress of all running tasks.void
saveLogEntry
(LogEntry logEntry) Save the givenLogEntry
.void
saveProgress
(Progress progress) Save the givenProgress
.void
setupTaskExecutionEnvironment
(String taskId, String jobKey, String type, String name, long startDate, String details, TaskExecutionStatus initialStatus) void
Set all Task_execution entities tostopped
stopped, which are still running.void
updateStartDate
(String taskId, long startDate) Update the start date on the Task_execution entity with the given task id.void
updateTaskExecutionStatus
(String taskId, TaskExecutionStatus status) Update the status of the Task_execution entity with the given task id.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.tasks.impl.progress.ProgressPersistenceManager
setupTaskExecutionEnvironment
-
Constructor Details
-
ProgressPersistenceManagerImpl
public ProgressPersistenceManagerImpl(CommandExecutor commandExecutor, org.slf4j.Logger log, TextResources textResources, PrincipalService principalService, CascadingDeleteService cascadingDeleteService, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
setupTaskExecutionEnvironment
public void setupTaskExecutionEnvironment(String taskId, String jobKey, String type, String name, long startDate, String details, TaskExecutionStatus initialStatus) - Specified by:
setupTaskExecutionEnvironment
in interfaceProgressPersistenceManager
-
updateStartDate
Description copied from interface:ProgressPersistenceManager
Update the start date on the Task_execution entity with the given task id.- Specified by:
updateStartDate
in interfaceProgressPersistenceManager
- Parameters:
taskId
- The task id of the Task_execution to modify.startDate
- The new start date to set.
-
delete
Description copied from interface:ProgressPersistenceManager
Delete a Task_execution entity.- Specified by:
delete
in interfaceProgressPersistenceManager
- Parameters:
taskId
- The task id of the Task_execution entity to delete.
-
stopUncompletedTaskExecutions
public void stopUncompletedTaskExecutions()Description copied from interface:ProgressPersistenceManager
Set all Task_execution entities tostopped
stopped, which are still running. Should only be called before the scheduler has been started.- Specified by:
stopUncompletedTaskExecutions
in interfaceProgressPersistenceManager
-
updateTaskExecutionStatus
Description copied from interface:ProgressPersistenceManager
Update the status of the Task_execution entity with the given task id.- Specified by:
updateTaskExecutionStatus
in interfaceProgressPersistenceManager
- Parameters:
taskId
- The task id of the Task_execution entity to update.status
- The new status to set.
-
createProgress
Description copied from interface:ProgressPersistenceManager
Create a newProgressBean
object.- Specified by:
createProgress
in interfaceProgressPersistenceManager
- Parameters:
taskId
- The task id for the ProgressBean.taskName
- The task name for ProgressBean.- Returns:
- the created ProgressBean.
-
saveProgress
Description copied from interface:ProgressPersistenceManager
Save the givenProgress
.- Specified by:
saveProgress
in interfaceProgressPersistenceManager
- Parameters:
progress
- The progress to save.
-
getProgressOfRunningTasks
Description copied from interface:ProgressPersistenceManager
Get progress of all running tasks.- Specified by:
getProgressOfRunningTasks
in interfaceProgressPersistenceManager
- Returns:
- progress of all running tasks.
-
saveLogEntry
Description copied from interface:ProgressPersistenceManager
Save the givenLogEntry
.- Specified by:
saveLogEntry
in interfaceProgressPersistenceManager
- Parameters:
logEntry
- The log entry to save.
-
findLogEntryByState
Description copied from interface:ProgressPersistenceManager
Find a singleLogEntry
for a given state value. This value must uniquely identify the log entry!If more than one result is found, an exception is thrown. Otherwise either the single result is returned or none.
- Specified by:
findLogEntryByState
in interfaceProgressPersistenceManager
-
findLatestLogEntry
- Specified by:
findLatestLogEntry
in interfaceProgressPersistenceManager
-