public class ClusteredTaskManager extends AbstractQuartzTaskManager
AbstractQuartzTaskManager.TaskTriggerListener
TaskManager.TaskState
Constructor and Description |
---|
ClusteredTaskManager(TaskRepository taskRepository) |
Modifier and Type | Method and Description |
---|---|
void |
deleteLocalTasks() |
boolean |
deleteTask(String taskName)
Stops and deletes a task with the given name.
|
boolean |
deleteTask(String memberId,
String taskName) |
boolean |
finalDeleteTask(String taskName) |
void |
finalPauseTask(String taskName) |
void |
finalRescheduleTask(String taskName) |
void |
finalResumeTask(String taskName) |
void |
finalScheduleTask(String taskName) |
List<TaskInfo> |
getAllRunningTasksInOtherMembers(String memberId)
Gets all the tasks running on the other task server members of the cluster
|
List<List<TaskInfo>> |
getAllRunningTasksInServers() |
List<TaskInfo> |
getAllTasks()
Get all task information.
|
Map<String,TaskManager.TaskState> |
getAllTaskStates() |
ClusterGroupCommunicator |
getClusterComm() |
List<TaskInfo> |
getFinalRunningTasksInServer() |
TaskManager.TaskState |
getFinalTaskState(String taskName) |
String |
getMemberId() |
String |
getMemberIdFromTaskName(String taskName,
boolean createIfNotExists) |
List<String> |
getMemberIds() |
List<TaskInfo> |
getRunningTasksInServer(String memberId) |
int |
getServerCount() |
TaskInfo |
getTask(String taskName)
Get task information.
|
TaskManager.TaskState |
getTaskState(String taskName)
Gets tasks state information
|
TaskManager.TaskState |
getTaskState(String memberId,
String taskName) |
String |
getTaskType() |
int |
getTenantId() |
void |
initStartupTasks()
Initialize the startup tasks.
|
boolean |
isLeader() |
boolean |
isTaskScheduled(String taskName)
Checks if the given task is already scheduled.
|
void |
pauseTask(String taskName)
Pauses a task with the given name.
|
void |
pauseTask(String memberId,
String taskName) |
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 |
rescheduleTask(String memberId,
String taskName) |
void |
resumeTask(String taskName)
Resumes a paused task with the given name.
|
void |
resumeTask(String memberId,
String taskName) |
void |
scheduleMissingTasks() |
void |
scheduleMissingTasks(String memberId)
Schedules tasks for the given member id
|
void |
scheduleTask(String taskName)
Starts a task with the given name.
|
void |
scheduleTask(String memberId,
String taskName) |
<V> V |
sendReceive(String memberId,
TaskCall<V> taskCall) |
deleteLocalTask, getAllFinishedTasks, getAllLocalRunningTasks, getAllLocalTaskStates, getLocalTaskState, getScheduler, getTaskRepository, isLocalTaskScheduled, pauseLocalTask, registerLocalTask, registerLocalTaskActionListener, rescheduleLocalTask, resumeLocalTask, scheduleAllTasks, scheduleLocalTask, scheduleLocalTask
public ClusteredTaskManager(TaskRepository taskRepository) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public int getTenantId()
getTenantId
in class AbstractQuartzTaskManager
public String getTaskType()
getTaskType
in class AbstractQuartzTaskManager
public ClusterGroupCommunicator getClusterComm() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void initStartupTasks() throws org.wso2.carbon.ntask.common.TaskException
TaskManager
org.wso2.carbon.ntask.common.TaskException
public void scheduleMissingTasks() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void scheduleMissingTasks(String memberId) throws org.wso2.carbon.ntask.common.TaskException
memberId
- cluster member identifierorg.wso2.carbon.ntask.common.TaskException
public void scheduleTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
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
taskName
- The task to be rescheduledorg.wso2.carbon.ntask.common.TaskException
public Map<String,TaskManager.TaskState> getAllTaskStates() 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
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
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
taskName
- The name of the taskorg.wso2.carbon.ntask.common.TaskException
public void resumeTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
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
taskInfo
- The task informationorg.wso2.carbon.ntask.common.TaskException
public TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
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
org.wso2.carbon.ntask.common.TaskException
public int getServerCount() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public List<TaskInfo> getAllRunningTasksInOtherMembers(String memberId) throws org.wso2.carbon.ntask.common.TaskException
memberId
- cluster member identifierorg.wso2.carbon.ntask.common.TaskException
public List<List<TaskInfo>> getAllRunningTasksInServers() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public boolean isTaskScheduled(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskManager
taskName
- The task nameorg.wso2.carbon.ntask.common.TaskException
public <V> V sendReceive(String memberId, TaskCall<V> taskCall) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public List<String> getMemberIds() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public String getMemberId() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public boolean isLeader() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public String getMemberIdFromTaskName(String taskName, boolean createIfNotExists) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public List<TaskInfo> getRunningTasksInServer(String memberId) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public List<TaskInfo> getFinalRunningTasksInServer() throws Exception
Exception
public TaskManager.TaskState getTaskState(String memberId, String taskName) throws Exception
Exception
public TaskManager.TaskState getFinalTaskState(String taskName) throws Exception
Exception
public void scheduleTask(String memberId, String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void rescheduleTask(String memberId, String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void finalRescheduleTask(String taskName) throws Exception
Exception
public boolean deleteTask(String memberId, String taskName) throws Exception
Exception
public void pauseTask(String memberId, String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void resumeTask(String memberId, String taskName) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void deleteLocalTasks() throws org.wso2.carbon.ntask.common.TaskException
deleteLocalTasks
in class AbstractQuartzTaskManager
org.wso2.carbon.ntask.common.TaskException
Copyright © 2020 WSO2. All rights reserved.