Package org.wso2.carbon.ntask.core.impl
Class RegistryBasedTaskRepository
- java.lang.Object
-
- org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository
-
- All Implemented Interfaces:
TaskRepository
public class RegistryBasedTaskRepository extends Object implements TaskRepository
Registry based task repository implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REG_TASK_BASE_PATH
static String
REG_TASK_REPO_BASE_PATH
-
Constructor Summary
Constructors Constructor Description RegistryBasedTaskRepository(int tenantId, String taskType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.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 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.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.
-
-
-
Field Detail
-
REG_TASK_BASE_PATH
public static final String REG_TASK_BASE_PATH
- See Also:
- Constant Field Values
-
REG_TASK_REPO_BASE_PATH
public static final String REG_TASK_REPO_BASE_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RegistryBasedTaskRepository
public RegistryBasedTaskRepository(int tenantId, String taskType) throws org.wso2.carbon.ntask.common.TaskException
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
-
Method Detail
-
getTenantId
public int getTenantId()
Description copied from interface:TaskRepository
Returns the tenant domain of the tasks represented by this task manager.- Specified by:
getTenantId
in interfaceTaskRepository
- Returns:
- The tenant domain of the tasks
-
getRegistry
public static org.wso2.carbon.registry.core.Registry getRegistry() throws org.wso2.carbon.ntask.common.TaskException
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTaskType
public String getTaskType()
-
getAllTasks
public List<TaskInfo> getAllTasks() throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Returns all the task information data in the repository.- Specified by:
getAllTasks
in interfaceTaskRepository
- Returns:
- A list of TaskInfo objects
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTask
public TaskInfo getTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Returns task information of a given task name- Specified by:
getTask
in interfaceTaskRepository
- Parameters:
taskName
- The task name- Returns:
- The task information object
- Throws:
org.wso2.carbon.ntask.common.TaskException
- if the task cannot be found
-
addTask
public void addTask(TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Adds given task information to the repository.- Specified by:
addTask
in interfaceTaskRepository
- Parameters:
taskInfo
- The task information object- Throws:
org.wso2.carbon.ntask.common.TaskException
-
deleteTask
public boolean deleteTask(String taskName) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Deletes existing task information from the repository.- Specified by:
deleteTask
in interfaceTaskRepository
- Parameters:
taskName
- The task name- Returns:
- true if the task was found and deleted
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getTasksType
public String getTasksType()
Description copied from interface:TaskRepository
Returns the type of the tasks represented by this task manager.- Specified by:
getTasksType
in interfaceTaskRepository
- Returns:
- The type of the tasks
-
getAvailableTenantTasksInRepo
public static List<TaskManagerId> getAvailableTenantTasksInRepo() throws org.wso2.carbon.ntask.common.TaskException
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getAllTenantTaskManagersForType
public static List<TaskManagerId> getAllTenantTaskManagersForType(String taskType) throws org.wso2.carbon.ntask.common.TaskException
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
setTaskMetadataProp
public void setTaskMetadataProp(String taskName, String key, String value) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Sets a task metadata property to a given task name with a given property key.- Specified by:
setTaskMetadataProp
in interfaceTaskRepository
- 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
public String getTaskMetadataProp(String taskName, String key) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskRepository
Returns the task metadata property value, if the task does not exist, this will return null.- Specified by:
getTaskMetadataProp
in interfaceTaskRepository
- 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
-
-