public class RegistryBasedTaskRepository extends Object implements TaskRepository
Modifier and Type | Field and Description |
---|---|
static String |
REG_TASK_BASE_PATH |
static String |
REG_TASK_REPO_BASE_PATH |
Constructor and Description |
---|
RegistryBasedTaskRepository(int tenantId,
String taskType) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(TaskInfo taskInfo)
Adds given task information to the repository.
|
boolean |
deleteTask(String taskName)
Deletes existing task information from the repository.
|
List<TaskInfo> |
getAllTasks()
Returns all the task information data in the repository.
|
static List<TaskManagerId> |
getAllTenantTaskManagersForType(String taskType) |
static List<TaskManagerId> |
getAvailableTenantTasksInRepo() |
static org.wso2.carbon.registry.core.Registry |
getRegistry() |
TaskInfo |
getTask(String taskName)
Returns task information of a given task name
|
String |
getTaskMetadataProp(String taskName,
String key)
Returns the task metadata property value, if the task does not exist, this will return null.
|
String |
getTasksType()
Returns the type of the tasks represented by this task manager.
|
String |
getTaskType() |
int |
getTenantId()
Returns the tenant domain of the tasks represented by this task manager.
|
void |
setTaskMetadataProp(String taskName,
String key,
String value)
Sets a task metadata property to a given task name with a given property key.
|
public static final String REG_TASK_BASE_PATH
public static final String REG_TASK_REPO_BASE_PATH
public RegistryBasedTaskRepository(int tenantId, String taskType) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public int getTenantId()
TaskRepository
getTenantId
in interface TaskRepository
public static org.wso2.carbon.registry.core.Registry getRegistry() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public String getTaskType()
public List<TaskInfo> getAllTasks() throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
getAllTasks
in interface TaskRepository
org.wso2.carbon.ntask.common.TaskException
public TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
getTask
in interface TaskRepository
taskName
- The task nameorg.wso2.carbon.ntask.common.TaskException
- if the task cannot be foundpublic void addTask(TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
addTask
in interface TaskRepository
taskInfo
- The task information objectorg.wso2.carbon.ntask.common.TaskException
public boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
deleteTask
in interface TaskRepository
taskName
- The task nameorg.wso2.carbon.ntask.common.TaskException
public String getTasksType()
TaskRepository
getTasksType
in interface TaskRepository
public static List<TaskManagerId> getAvailableTenantTasksInRepo() throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public static List<TaskManagerId> getAllTenantTaskManagersForType(String taskType) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public void setTaskMetadataProp(String taskName, String key, String value) throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
setTaskMetadataProp
in interface TaskRepository
taskName
- The name of the task the metadata property to be assigned tokey
- The key of the metadata propertyvalue
- The value of the metadata propertyorg.wso2.carbon.ntask.common.TaskException
public String getTaskMetadataProp(String taskName, String key) throws org.wso2.carbon.ntask.common.TaskException
TaskRepository
getTaskMetadataProp
in interface TaskRepository
taskName
- The name of the task to retrieve the metadata property fromkey
- The key of the metadata properyorg.wso2.carbon.ntask.common.TaskException
Copyright © 2017 WSO2. All rights reserved.