public class RemoteTaskManager extends Object implements TaskManager
Modifier and Type | Class and Description |
---|---|
static class |
RemoteTaskManager.TaskStatusMessage
This class represents the cluster message for retrieving a task status.
|
static class |
RemoteTaskManager.TaskStatusResult
This class represents a clustering message result for task statuses.
|
TaskManager.TaskState
Modifier and Type | Field and Description |
---|---|
static String |
REMOTE_TASK_ID_REPO_PROP |
static String |
REMOTE_TASK_SERVER_ADDRESS |
static String |
REMOTE_TASK_SERVER_PASSWORD |
static String |
REMOTE_TASK_SERVER_USERNAME |
static String |
TASK_CLIENT_DISPATCH_ADDRESS |
Constructor and Description |
---|
RemoteTaskManager(TaskRepository taskRepository,
org.wso2.carbon.remotetasks.stub.admin.common.RemoteTaskAdmin remoteTaskAdmin) |
Modifier and Type | Method and Description |
---|---|
static void |
addRunningTask(String runningTaskId) |
boolean |
deleteTask(String taskName)
Stops and deletes a task with the given name.
|
List<TaskInfo> |
getAllTasks()
Get all task information.
|
org.wso2.carbon.remotetasks.stub.admin.common.RemoteTaskAdmin |
getRemoteTaskAdmin() |
TaskInfo |
getTask(String taskName)
Get task information.
|
TaskRepository |
getTaskRepository() |
TaskManager.TaskState |
getTaskState(String taskName)
Gets tasks state information
|
TaskManager.TaskState |
getTaskStateRemote(String taskName) |
String |
getTaskType() |
int |
getTenantId() |
void |
initStartupTasks()
Initialize the startup tasks.
|
static boolean |
isRunningTaskExist(String runningTaskId) |
boolean |
isTaskRunning(String taskName) |
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.
|
static void |
removeRunningTask(String runningTaskId) |
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 |
runTask(String taskName) |
void |
scheduleTask(String taskName)
Starts a task with the given name.
|
public static final String REMOTE_TASK_SERVER_ADDRESS
public static final String REMOTE_TASK_SERVER_USERNAME
public static final String REMOTE_TASK_SERVER_PASSWORD
public static final String TASK_CLIENT_DISPATCH_ADDRESS
public static final String REMOTE_TASK_ID_REPO_PROP
public RemoteTaskManager(TaskRepository taskRepository, org.wso2.carbon.remotetasks.stub.admin.common.RemoteTaskAdmin remoteTaskAdmin)
public org.wso2.carbon.remotetasks.stub.admin.common.RemoteTaskAdmin getRemoteTaskAdmin()
public TaskRepository getTaskRepository()
public int getTenantId()
public String getTaskType()
public void initStartupTasks() throws org.wso2.carbon.ntask.common.TaskException
TaskManager
initStartupTasks
in interface TaskManager
org.wso2.carbon.ntask.common.TaskException
public void scheduleTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
scheduleTask
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public void rescheduleTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
rescheduleTask
in interface TaskManager
taskName
- The task to be rescheduledorg.wso2.carbon.ntask.common.TaskException
public boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
deleteTask
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public void pauseTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
pauseTask
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public void resumeTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
resumeTask
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public void registerTask(TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
registerTask
in interface TaskManager
taskInfo
- The task informationorg.wso2.carbon.ntask.common.TaskException
public TaskManager.TaskState getTaskStateRemote(String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public TaskManager.TaskState getTaskState(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
getTaskState
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
getTask
in interface TaskManager
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
- if the task cannot be foundpublic List<TaskInfo> getAllTasks() throws org.wso2.carbon.ntask.common.TaskException
TaskManager
getAllTasks
in interface TaskManager
org.wso2.carbon.ntask.common.TaskException
public boolean isTaskScheduled(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
isTaskScheduled
in interface TaskManager
taskName
- The task nameorg.wso2.carbon.ntask.common.TaskException
public void runTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public static void addRunningTask(String runningTaskId)
public static void removeRunningTask(String runningTaskId)
public static boolean isRunningTaskExist(String runningTaskId)
public boolean isTaskRunning(String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void registerLocalTaskActionListener(LocalTaskActionListener listener, String taskName)
TaskManager
registerLocalTaskActionListener
in interface TaskManager
listener
- the listener to be notifiedtaskName
- the name of the task for which the listener should be registeredCopyright © 2022 WSO2. All rights reserved.