Package com.openkm.dao
Class TaskDao
- java.lang.Object
-
- com.openkm.dao.AbstractDao
-
- com.openkm.dao.TaskDao
-
@Service public class TaskDao extends AbstractDao
Task dao.- Author:
- jabad
-
-
Field Summary
-
Fields inherited from class com.openkm.dao.AbstractDao
connection, dateFormat
-
-
Constructor Summary
Constructors Constructor Description TaskDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteExecutionEvents(long id)Delete execution events method.voiddeleteTask(long id)Delete task method.Set<Long>findExecutionWithErrorsNotRevised()Find all executions not revised.List<TaskExecutionEvent>getExecutionEvents(long taskExecutionId)Get execution events.List<TaskExecution>getExecutions(long taskId)Get executions for a task.TaskExecutiongetTaskExecutionById(String taskExecutionId)Get task execution by id.longinsertTask(FormProperties taskProperties)Insert task.longinsertTaskExecution(long taskId)Insert task execution.voidinsertTaskExecutionEvent(long taskExecutionId, String description, String type)Insert task execution event.List<FormProperties>loadAllTasks()Load all tasks from database.FormPropertiesloadTaskById(long id)Load task by idvoidmarkAllAsRevised(String id)Mark every execution of a task as revised.voidmarkAsRevised(String id)Mark an execution as revised.voidstopAllTasks()Stop all tasks.voidupdateTask(FormProperties taskProperties)Update task data.voidupdateTaskExecution(long taskId, String state)Update task execution.voidupdateTaskRunningState(long id, boolean running)Update task running state.voidupdateTaskScheduledState(long id, boolean scheduled)Update task scheduled state.
-
-
-
Method Detail
-
insertTask
public long insertTask(FormProperties taskProperties) throws SQLException
Insert task.- Parameters:
taskProperties- task properties- Throws:
SQLException
-
insertTaskExecutionEvent
public void insertTaskExecutionEvent(long taskExecutionId, String description, String type) throws SQLExceptionInsert task execution event.- Parameters:
taskExecutionId- task execution idtype- type- Throws:
SQLException
-
loadAllTasks
public List<FormProperties> loadAllTasks() throws SQLException
Load all tasks from database.- Returns:
- all tasks
- Throws:
SQLException
-
loadTaskById
public FormProperties loadTaskById(long id) throws SQLException
Load task by id- Parameters:
id- task id- Returns:
- task
- Throws:
SQLException
-
updateTaskExecution
public void updateTaskExecution(long taskId, String state) throws SQLExceptionUpdate task execution.- Parameters:
taskId- task idstate- execution state- Throws:
SQLException
-
stopAllTasks
public void stopAllTasks() throws SQLExceptionStop all tasks.- Throws:
SQLException
-
insertTaskExecution
public long insertTaskExecution(long taskId) throws SQLExceptionInsert task execution.- Parameters:
taskId- task id- Returns:
- the id for the new value stored
- Throws:
SQLException- exception
-
getExecutions
public List<TaskExecution> getExecutions(long taskId) throws SQLException, ParseException
Get executions for a task.- Parameters:
taskId- task id- Returns:
- the list of executions
- Throws:
SQLExceptionParseException
-
getTaskExecutionById
public TaskExecution getTaskExecutionById(String taskExecutionId) throws SQLException, ParseException
Get task execution by id.- Parameters:
taskExecutionId- task execution id- Returns:
- the execution data
- Throws:
SQLExceptionParseException
-
getExecutionEvents
public List<TaskExecutionEvent> getExecutionEvents(long taskExecutionId) throws SQLException
Get execution events.- Parameters:
taskExecutionId- execution id- Returns:
- a list of events for an execution
- Throws:
SQLException
-
updateTaskRunningState
public void updateTaskRunningState(long id, boolean running) throws SQLExceptionUpdate task running state.- Parameters:
id- task idrunning- running state- Throws:
SQLException
-
updateTaskScheduledState
public void updateTaskScheduledState(long id, boolean scheduled) throws SQLExceptionUpdate task scheduled state.- Parameters:
id- task idscheduled- scheduled state- Throws:
SQLException- exception
-
updateTask
public void updateTask(FormProperties taskProperties) throws SQLException
Update task data.- Parameters:
taskProperties- task properties- Throws:
SQLException
-
markAsRevised
public void markAsRevised(String id) throws SQLException
Mark an execution as revised.- Parameters:
id- execution id- Throws:
SQLException
-
findExecutionWithErrorsNotRevised
public Set<Long> findExecutionWithErrorsNotRevised() throws SQLException
Find all executions not revised.- Returns:
- a list of executions
- Throws:
SQLException
-
markAllAsRevised
public void markAllAsRevised(String id) throws SQLException
Mark every execution of a task as revised.- Parameters:
id- task id- Throws:
SQLException
-
deleteTask
public void deleteTask(long id) throws SQLExceptionDelete task method.- Parameters:
id- task id- Throws:
SQLException
-
deleteExecutionEvents
public void deleteExecutionEvents(long id) throws SQLExceptionDelete execution events method.- Parameters:
id- task id- Throws:
SQLException
-
-