Class StandaloneTaskManager

  • All Implemented Interfaces:
    TaskManager

    public class StandaloneTaskManager
    extends AbstractQuartzTaskManager
    This class represents a single node task server manager, which is created when the server is run in standalone mode.
    • Constructor Detail

      • StandaloneTaskManager

        public StandaloneTaskManager​(TaskRepository taskRepository)
                              throws org.wso2.carbon.ntask.common.TaskException
        Throws:
        org.wso2.carbon.ntask.common.TaskException
    • Method Detail

      • initStartupTasks

        public void initStartupTasks()
                              throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Initialize the startup tasks.
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • scheduleTask

        public void scheduleTask​(String taskName)
                          throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Starts a task with the given name.
        Parameters:
        taskName - The name of the task
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • deleteTask

        public boolean deleteTask​(String taskName)
                           throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        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

        public void pauseTask​(String taskName)
                       throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Pauses a task with the given name.
        Parameters:
        taskName - The name of the task
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • registerTask

        public void registerTask​(TaskInfo taskInfo)
                          throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Registers a new task or updates if one already exists.
        Parameters:
        taskInfo - The task information
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • getTaskState

        public TaskManager.TaskState getTaskState​(String taskName)
                                           throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Gets tasks state information
        Parameters:
        taskName - The name of the task
        Returns:
        State of the task
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • getTask

        public TaskInfo getTask​(String taskName)
                         throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        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

        public List<TaskInfo> getAllTasks()
                                   throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Get all task information.
        Returns:
        Task information list
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • rescheduleTask

        public void rescheduleTask​(String taskName)
                            throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        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
      • resumeTask

        public void resumeTask​(String taskName)
                        throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        Resumes a paused task with the given name.
        Parameters:
        taskName - The name of the task
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • isTaskScheduled

        public boolean isTaskScheduled​(String taskName)
                                throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskManager
        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