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
ConstructorsConstructorDescriptionProgressPersistenceManagerImpl(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 newProgressBeanobject.voidDelete a Task_execution entity.findLatestLogEntry(String taskId) findLogEntryByState(String state) Find a singleLogEntryfor a given state value.Get progress of all running tasks.voidsaveLogEntry(LogEntry logEntry) Save the givenLogEntry.voidsaveProgress(Progress progress) Save the givenProgress.voidsetupTaskExecutionEnvironment(String taskId, String jobKey, String type, String name, long startDate, String details, TaskExecutionStatus initialStatus) voidSet all Task_execution entities tostoppedstopped, which are still running.voidupdateStartDate(String taskId, long startDate) Update the start date on the Task_execution entity with the given task id.voidupdateTaskExecutionStatus(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, waitMethods 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:
setupTaskExecutionEnvironmentin interfaceProgressPersistenceManager
-
updateStartDate
Description copied from interface:ProgressPersistenceManagerUpdate the start date on the Task_execution entity with the given task id.- Specified by:
updateStartDatein interfaceProgressPersistenceManager- Parameters:
taskId- The task id of the Task_execution to modify.startDate- The new start date to set.
-
delete
Description copied from interface:ProgressPersistenceManagerDelete a Task_execution entity.- Specified by:
deletein interfaceProgressPersistenceManager- Parameters:
taskId- The task id of the Task_execution entity to delete.
-
stopUncompletedTaskExecutions
public void stopUncompletedTaskExecutions()Description copied from interface:ProgressPersistenceManagerSet all Task_execution entities tostoppedstopped, which are still running. Should only be called before the scheduler has been started.- Specified by:
stopUncompletedTaskExecutionsin interfaceProgressPersistenceManager
-
updateTaskExecutionStatus
Description copied from interface:ProgressPersistenceManagerUpdate the status of the Task_execution entity with the given task id.- Specified by:
updateTaskExecutionStatusin interfaceProgressPersistenceManager- Parameters:
taskId- The task id of the Task_execution entity to update.status- The new status to set.
-
createProgress
Description copied from interface:ProgressPersistenceManagerCreate a newProgressBeanobject.- Specified by:
createProgressin interfaceProgressPersistenceManager- Parameters:
taskId- The task id for the ProgressBean.taskName- The task name for ProgressBean.- Returns:
- the created ProgressBean.
-
saveProgress
Description copied from interface:ProgressPersistenceManagerSave the givenProgress.- Specified by:
saveProgressin interfaceProgressPersistenceManager- Parameters:
progress- The progress to save.
-
getProgressOfRunningTasks
Description copied from interface:ProgressPersistenceManagerGet progress of all running tasks.- Specified by:
getProgressOfRunningTasksin interfaceProgressPersistenceManager- Returns:
- progress of all running tasks.
-
saveLogEntry
Description copied from interface:ProgressPersistenceManagerSave the givenLogEntry.- Specified by:
saveLogEntryin interfaceProgressPersistenceManager- Parameters:
logEntry- The log entry to save.
-
findLogEntryByState
Description copied from interface:ProgressPersistenceManagerFind a singleLogEntryfor 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:
findLogEntryByStatein interfaceProgressPersistenceManager
-
findLatestLogEntry
- Specified by:
findLatestLogEntryin interfaceProgressPersistenceManager
-