Package org.wso2.carbon.ntask.core
Interface TaskRepository
-
- All Known Implementing Classes:
FileBasedTaskRepository
,RegistryBasedTaskRepository
public interface TaskRepository
This interface represents a task repository, which can be used to store and load tasks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.TaskInfo
getTask(String taskName)
Returns task information of a given task nameString
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.
-
-
-
Method Detail
-
getAllTasks
List<TaskInfo> getAllTasks() throws org.wso2.carbon.ntask.common.TaskException
Returns all the task information data in the repository.- Returns:
- A list of TaskInfo objects
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTask
TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Returns task information of a given task name- Parameters:
taskName
- The task name- Returns:
- The task information object
- Throws:
org.wso2.carbon.ntask.common.TaskException
- if the task cannot be found
-
addTask
void addTask(TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
Adds given task information to the repository.- Parameters:
taskInfo
- The task information object- Throws:
org.wso2.carbon.ntask.common.TaskException
-
deleteTask
boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Deletes existing task information from the repository.- Parameters:
taskName
- The task name- Returns:
- true if the task was found and deleted
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTasksType
String getTasksType()
Returns the type of the tasks represented by this task manager.- Returns:
- The type of the tasks
-
getTenantId
int getTenantId()
Returns the tenant domain of the tasks represented by this task manager.- Returns:
- The tenant domain of the tasks
-
setTaskMetadataProp
void setTaskMetadataProp(String taskName, String key, String value) throws org.wso2.carbon.ntask.common.TaskException
Sets a task metadata property to a given task name with a given property key.- Parameters:
taskName
- The name of the task the metadata property to be assigned tokey
- The key of the metadata propertyvalue
- The value of the metadata property- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTaskMetadataProp
String getTaskMetadataProp(String taskName, String key) throws org.wso2.carbon.ntask.common.TaskException
Returns the task metadata property value, if the task does not exist, this will return null.- Parameters:
taskName
- The name of the task to retrieve the metadata property fromkey
- The key of the metadata propery- Returns:
- The metadata property value
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
-