@Transactional public interface SchedulerService extends OpenmrsService
| Modifier and Type | Method and Description | 
|---|---|
void | 
deleteTask(java.lang.Integer id)
Delete the task with the given identifier. 
 | 
java.util.Collection<TaskDefinition> | 
getRegisteredTasks()
Get the list of tasks that are available to be scheduled. 
 | 
java.util.Collection<TaskDefinition> | 
getScheduledTasks()
Get scheduled tasks. 
 | 
java.lang.String | 
getStatus(java.lang.Integer id)
Checks the status of a scheduled task. 
 | 
java.util.SortedMap<java.lang.String,java.lang.String> | 
getSystemVariables()
Return SchedulerConstants 
 | 
TaskDefinition | 
getTask(java.lang.Integer id)
Get the task with the given identifier. 
 | 
TaskDefinition | 
getTaskByName(java.lang.String name)
Get the task with the given name. 
 | 
void | 
onShutdown()
Stop all tasks and clean up the scheduler instance. 
 | 
void | 
onStartup()
Start all tasks that are scheduled to run on startup. 
 | 
void | 
rescheduleAllTasks()
Loop over all currently started tasks and cycle them. 
 | 
Task | 
rescheduleTask(TaskDefinition task)
Stop and start a scheduled task. 
 | 
void | 
restoreFromMemento(OpenmrsMemento memento)
Restore the scheduler service to state defined by Memento 
 | 
void | 
saveTask(TaskDefinition task)
Create the given task 
 | 
void | 
saveTaskDefinition(TaskDefinition task)
Create the given task 
 | 
OpenmrsMemento | 
saveToMemento()
Save the state of the scheduler service to Memento 
 | 
Task | 
scheduleTask(TaskDefinition task)
Start a scheduled task as specified in a TaskDefinition. 
 | 
void | 
shutdownTask(TaskDefinition task)
Cancel a scheduled task. 
 | 
@Authorized(value="Manage Scheduler") java.lang.String getStatus(java.lang.Integer id)
id - String status of the task with the given identifier@Authorized(value="Manage Scheduler") void onStartup()
onStartup in interface OpenmrsService@Authorized(value="Manage Scheduler") void onShutdown()
onShutdown in interface OpenmrsService@Authorized(value="Manage Scheduler") void shutdownTask(TaskDefinition task) throws SchedulerException
task - the TaskDefinition for the task to cancelSchedulerException@Authorized(value="Manage Scheduler") Task scheduleTask(TaskDefinition task) throws SchedulerException
task - TaskDefinition to startTask, or null if there was a problem instantiating or
         scheduling the taskSchedulerException@Authorized(value="Manage Scheduler") Task rescheduleTask(TaskDefinition task) throws SchedulerException
task - the TaskDefinition to rescheduleSchedulerException@Authorized(value="Manage Scheduler") void rescheduleAllTasks() throws SchedulerException
SchedulerException@Authorized(value="Manage Scheduler") @Transactional(readOnly=true) java.util.Collection<TaskDefinition> getScheduledTasks()
@Authorized(value="Manage Scheduler") @Transactional(readOnly=true) java.util.Collection<TaskDefinition> getRegisteredTasks()
@Authorized(value="Manage Scheduler") @Transactional(readOnly=true) TaskDefinition getTask(java.lang.Integer id)
id - the identifier of the task@Authorized(value="Manage Scheduler") @Transactional(readOnly=true) TaskDefinition getTaskByName(java.lang.String name)
name - name of the task@Authorized(value="Manage Scheduler") void deleteTask(java.lang.Integer id)
id - the identifier of the task@Authorized(value="Manage Scheduler") @Logging(ignore=true) void saveTask(TaskDefinition task)
task - the task to be created@Authorized(value="Manage Scheduler") @Logging(ignore=true) void saveTaskDefinition(TaskDefinition task)
taskDefinition - the task to be created@Transactional(readOnly=true) java.util.SortedMap<java.lang.String,java.lang.String> getSystemVariables()
OpenmrsMemento saveToMemento()
void restoreFromMemento(OpenmrsMemento memento)
memento - Copyright © 2018 OpenMRS Inc.. All Rights Reserved.