public class FileBasedTaskRepository extends Object implements TaskRepository
Constructor and Description |
---|
FileBasedTaskRepository(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) |
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.
|
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 FileBasedTaskRepository(int tenantId, String taskType)
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 static List<TaskManagerId> getAllTenantTaskManagersForType(String taskType) throws org.wso2.carbon.ntask.common.TaskException
org.wso2.carbon.ntask.common.TaskException
public 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 int getTenantId()
TaskRepository
getTenantId
in interface TaskRepository
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 © 2020 WSO2. All rights reserved.