Package org.wso2.carbon.ntask.core
Interface TaskManager
-
- All Known Implementing Classes:
AbstractQuartzTaskManager
,ClusteredTaskManager
,RemoteTaskManager
,StandaloneTaskManager
public interface TaskManager
This interface represents the task manager functionalities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TaskManager.TaskState
Task states.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
deleteTask(String taskName)
Stops and deletes a task with the given name.List<TaskInfo>
getAllTasks()
Get all task information.TaskInfo
getTask(String taskName)
Get task information.TaskManager.TaskState
getTaskState(String taskName)
Gets tasks state informationvoid
initStartupTasks()
Initialize the startup tasks.boolean
isTaskScheduled(String taskName)
Checks if the given task is already scheduled.void
pauseTask(String taskName)
Pauses a task with the given name.void
registerLocalTaskActionListener(LocalTaskActionListener listener, String taskName)
Registers a listener to be notified when an action is performed on a task.void
registerTask(TaskInfo taskInfo)
Registers a new task or updates if one already exists.void
rescheduleTask(String taskName)
Reschedules a task with the given name, only the trigger information will be updated in the reschedule.void
resumeTask(String taskName)
Resumes a paused task with the given name.void
scheduleTask(String taskName)
Starts a task with the given name.
-
-
-
Method Detail
-
initStartupTasks
void initStartupTasks() throws org.wso2.carbon.ntask.common.TaskException
Initialize the startup tasks.- Throws:
org.wso2.carbon.ntask.common.TaskException
-
scheduleTask
void scheduleTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Starts a task with the given name.- Parameters:
taskName
- The name of the task- Throws:
org.wso2.carbon.ntask.common.TaskException
-
rescheduleTask
void rescheduleTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Reschedules a task with the given name, only the trigger information will be updated in the reschedule.- Parameters:
taskName
- The task to be rescheduled- Throws:
org.wso2.carbon.ntask.common.TaskException
-
deleteTask
boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Stops and deletes a task with the given name.- Parameters:
taskName
- The name of the task- Returns:
- true if the task was found and deleted
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
pauseTask
void pauseTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Pauses a task with the given name.- Parameters:
taskName
- The name of the task- Throws:
org.wso2.carbon.ntask.common.TaskException
-
resumeTask
void resumeTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Resumes a paused task with the given name.- Parameters:
taskName
- The name of the task- Throws:
org.wso2.carbon.ntask.common.TaskException
-
registerTask
void registerTask(TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
Registers a new task or updates if one already exists.- Parameters:
taskInfo
- The task information- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTaskState
TaskManager.TaskState getTaskState(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Gets tasks state information- Parameters:
taskName
- The name of the task- Returns:
- State of the task
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTask
TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Get task information.- Parameters:
taskName
- The name of the task- Returns:
- The task information
- Throws:
org.wso2.carbon.ntask.common.TaskException
- if the task cannot be found
-
getAllTasks
List<TaskInfo> getAllTasks() throws org.wso2.carbon.ntask.common.TaskException
Get all task information.- Returns:
- Task information list
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
isTaskScheduled
boolean isTaskScheduled(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Checks if the given task is already scheduled.- Parameters:
taskName
- The task name- Returns:
- true if already scheduled
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
registerLocalTaskActionListener
void registerLocalTaskActionListener(LocalTaskActionListener listener, String taskName)
Registers a listener to be notified when an action is performed on a task.- Parameters:
listener
- the listener to be notifiedtaskName
- the name of the task for which the listener should be registered
-
-