Interface ProgressPersistenceManager
- All Known Implementing Classes:
ProgressPersistenceManagerImpl
public interface ProgressPersistenceManager
This service provides methods to fetch and save Task_execution and Log_entry entities.
-
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
.default void
setupTaskExecutionEnvironment
(String taskId, String jobId, String type, String name, long startDate, String details) Create a Task_execution entity.void
setupTaskExecutionEnvironment
(String taskId, String jobId, 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.
-
Method Details
-
setupTaskExecutionEnvironment
default void setupTaskExecutionEnvironment(String taskId, String jobId, String type, String name, long startDate, String details) Create a Task_execution entity.- Parameters:
taskId
- The id of the task.type
- The type of the task.name
- The name of the task.startDate
- The start date of the task.details
- Detail informations.
-
setupTaskExecutionEnvironment
-
updateStartDate
Update the start date on the Task_execution entity with the given task id.- Parameters:
taskId
- The task id of the Task_execution to modify.startDate
- The new start date to set.
-
delete
Delete a Task_execution entity.- Parameters:
taskId
- The task id of the Task_execution entity to delete.
-
stopUncompletedTaskExecutions
void stopUncompletedTaskExecutions()Set all Task_execution entities tostopped
stopped, which are still running. Should only be called before the scheduler has been started. -
updateTaskExecutionStatus
Update the status of the Task_execution entity with the given task id.- Parameters:
taskId
- The task id of the Task_execution entity to update.status
- The new status to set.
-
createProgress
Create a newProgressBean
object.- Parameters:
taskId
- The task id for the ProgressBean.taskName
- The task name for ProgressBean.- Returns:
- the created ProgressBean.
-
saveProgress
Save the givenProgress
.- Parameters:
progress
- The progress to save.
-
getProgressOfRunningTasks
List<ProgressBean> getProgressOfRunningTasks()Get progress of all running tasks.- Returns:
- progress of all running tasks.
-
saveLogEntry
Save the givenLogEntry
.- Parameters:
logEntry
- The log entry to save.
-
findLogEntryByState
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.
-
findLatestLogEntry
-