Interface TaskManager
- All Superinterfaces:
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
Modifier and TypeMethodDescriptionboolean
cancelTask
(Long taskId) Attempts to cancel the execution of a task.createNewTask
(String ownerId, String typeId) Creates a new task definition programmatically.void
deleteTask
(Long taskId) Cancels the task (if possible) and deletes the underlying GatewayTaskRecord and its associated settings record.getRegisteredTypes
(boolean allowPrivate) Returns all of the currently registered tag types.Returns the status of all outstanding tasks.getTaskStatus
(Long taskId) Returns the task status of the provided id, or null if the task is no longer defined.void
registerTaskType
(TaskType type) Registers a new type of task.boolean
resumeTask
(Long taskId) Attempts to resume a previously suspended task.boolean
suspendTask
(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 Details
-
getTaskStatus
List<TaskStatus> getTaskStatus()Returns the status of all outstanding tasks. May return tasks that are not yet active, but will execute soon. -
getTaskEvents
List<TaskStatusEvent> getTaskEvents() -
getTaskStatus
Returns the task status of the provided id, or null if the task is no longer defined. -
registerTaskType
Registers a new type of task. -
unregisterTaskType
Unregisters a previously registered tag type. -
getRegisteredTypes
Returns all of the currently registered tag types. -
getType
-
suspendTask
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
Attempts to resume a previously suspended task. Will return false if the operation fails for some reason (the reason will be logged). -
cancelTask
Attempts to cancel the execution of a task. If the task does not support cancellation, or the operation fails, false will be returned. -
deleteTask
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
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.
-