Interface SchedulerRepository
-
- All Known Implementing Classes:
SchedulerRepositoryImpl
public interface SchedulerRepository
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleaninsertTask(Task task)Save task on databasebooleaninsertTask(Task task, boolean picked, java.lang.String server)Save task on databasejava.util.List<Task>loadTasksToRun(java.lang.String server, long pollingInterval)Load tasks to runbooleanupdateNotRunnedTask(java.lang.String server)Update not runned tasks to make them available to be picked by another serversbooleanupdateRecurringTask(RecurringTask task, boolean picked, java.lang.String pickedBy)Update recurring task data after run This update running fields to put task available to run another time Changed fields: picked = false, picked_by = null and end_run = nullbooleanupdateTask(java.lang.String key, java.time.Instant end)Update task data after run
-
-
-
Method Detail
-
insertTask
boolean insertTask(Task task) throws DatabaseException
Save task on database- Parameters:
task- to save on database- Returns:
- result of operation
- Throws:
DatabaseException- thrown when database not configured well
-
insertTask
boolean insertTask(Task task, boolean picked, java.lang.String server) throws DatabaseException
Save task on database- Parameters:
task- to save on databasepicked- boolean with picked statusserver- is the name/identifier of server- Returns:
- result of operation
- Throws:
DatabaseException- thrown when database not configured well
-
loadTasksToRun
java.util.List<Task> loadTasksToRun(java.lang.String server, long pollingInterval) throws DatabaseException
Load tasks to run- Parameters:
server- identifierpollingInterval- interval in milliseconds to pull tasks- Returns:
- list of tasks to run
- Throws:
DatabaseException- exception thrown when database no configured well
-
updateTask
boolean updateTask(java.lang.String key, java.time.Instant end) throws DatabaseExceptionUpdate task data after run- Parameters:
key- task identifierend- time- Returns:
- result of operation
- Throws:
DatabaseException- thrown when database not configured well
-
updateRecurringTask
boolean updateRecurringTask(RecurringTask task, boolean picked, java.lang.String pickedBy) throws DatabaseException
Update recurring task data after run This update running fields to put task available to run another time Changed fields: picked = false, picked_by = null and end_run = null- Parameters:
task- to updatepicked- if task was picked by this instancepickedBy- server name- Returns:
- result of operation
- Throws:
DatabaseException- thrown when database not configured well
-
updateNotRunnedTask
boolean updateNotRunnedTask(java.lang.String server) throws DatabaseExceptionUpdate not runned tasks to make them available to be picked by another servers- Parameters:
server- identifier- Returns:
- result of operation
- Throws:
DatabaseException- thrown when database not configured well
-
-