Interface TaskManager
-
- All Superinterfaces:
ExtensionPointManager
public interface TaskManager extends ExtensionPointManager
This system manages arbitrary gateway Tasks. Tasks are registered by various systems, and can be configured to execute once, in the future, or on a timer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancelTask(java.lang.Long taskId)
Attempts to cancel the execution of a task.TaskSettings
createNewTask(java.lang.String ownerId, java.lang.String typeId)
Creates a new task definition programmatically.void
deleteTask(java.lang.Long taskId)
Cancels the task (if possible) and deletes the underlying GatewayTaskRecord and its associated settings record.java.util.List<TaskType>
getRegisteredTypes(boolean allowPrivate)
Returns all of the currently registered tag types.java.util.List<TaskStatusEvent>
getTaskEvents()
java.util.List<TaskStatus>
getTaskStatus()
Returns the status of all outstanding tasks.TaskStatus
getTaskStatus(java.lang.Long taskId)
Returns the task status of the provided id, or null if the task is no longer defined.TaskType
getType(java.lang.String owner, java.lang.String typeId)
void
registerTaskType(TaskType type)
Registers a new type of task.boolean
resumeTask(java.lang.Long taskId)
Attempts to resume a previously suspended task.boolean
suspendTask(java.lang.Long taskId)
Attempts to suspend (pause) a running or waiting task.void
unregisterTaskType(TaskType type)
Unregisters a previously registered tag type.-
Methods inherited from interface com.inductiveautomation.ignition.gateway.model.ExtensionPointManager
getExtensionPoint, getExtensionPoints
-
-
-
-
Method Detail
-
getTaskStatus
java.util.List<TaskStatus> getTaskStatus()
Returns the status of all outstanding tasks. May return tasks that are not yet active, but will execute soon.
-
getTaskEvents
java.util.List<TaskStatusEvent> getTaskEvents()
-
getTaskStatus
TaskStatus getTaskStatus(java.lang.Long taskId)
Returns the task status of the provided id, or null if the task is no longer defined.
-
registerTaskType
void registerTaskType(TaskType type)
Registers a new type of task.
-
unregisterTaskType
void unregisterTaskType(TaskType type)
Unregisters a previously registered tag type.
-
getRegisteredTypes
java.util.List<TaskType> getRegisteredTypes(boolean allowPrivate)
Returns all of the currently registered tag types.
-
getType
TaskType getType(java.lang.String owner, java.lang.String typeId)
-
suspendTask
boolean suspendTask(java.lang.Long taskId)
Attempts to suspend (pause) a running or waiting task. If the task does not support the suspend operation, or the operation times out, the function will return false.
-
resumeTask
boolean resumeTask(java.lang.Long taskId)
Attempts to resume a previously suspended task. Will return false if the operation fails for some reason (the reason will be logged).
-
cancelTask
boolean cancelTask(java.lang.Long taskId)
Attempts to cancel the execution of a task. If the task does not support cancellation, or the operation fails, false will be returned.
-
deleteTask
void deleteTask(java.lang.Long taskId)
Cancels the task (if possible) and deletes the underlying GatewayTaskRecord and its associated settings record. This action will destroy the task permanently. Only use this method if you are sure the task will never get reused. As an alternative, use cancelTask() to stop a scheduled task and keep the GatewayTaskRecord intact.
-
createNewTask
TaskSettings createNewTask(java.lang.String ownerId, java.lang.String typeId)
Creates a new task definition programmatically. Given the task owner and type ids, it returns a structure with settings for the overall task. The task is not actually created until save() is called on the settings structure.
-
-