public interface TaskManager
| Modifier and Type | Method and Description |
|---|---|
Set<UUID> |
getAllTasks()
Returns a Set of all tasks in the system - this includes Completed, Running, Dead, etc.
|
Set<UUID> |
getTasks(TaskStatus taskStatus)
Return a Set of all tasks with a matching @TaskStatus.
|
TaskState |
getTaskState(UUID uuid)
Return the full TaskState object for a given task, containing full task metadata including the status change messages
and reqesterNames as provided in the stopTask/pauseTask/resumeTask and restartTask methods.
|
UUID |
scheduleRecurringTask(BackgroundTask task,
long delay,
long period)
Schedule a task for recurring execution at every @period interval and after an initial @delay.
|
UUID |
scheduleTask(BackgroundTask task,
long delay)
Schedule a single shot/one off BackgroundTask to run after a @delay in milliseconds.
|
TaskManager |
stopTask(UUID uuid,
String requesterName,
String message)
Stop a Scheduled, Paused or Running task.
|
UUID scheduleTask(BackgroundTask task, long delay)
task - Any object implementing the BackgroundTask interface that is to be scheduled for later execution.delay - Delay after which the @task object should be executed, may be null.UUID scheduleRecurringTask(BackgroundTask task, long delay, long period)
task - Any object implementing the BackgroundTask interface that is to be scheduled for later execution.delay - Long delay after which the @task object should be executed, may be null.period - Long interval between subsequent calls to @task.start().TaskManager stopTask(UUID uuid, String requesterName, String message)
uuid - UUID of task to stop.requesterName - Optional String to denote who requested this call; used for status reporting and may be null.message - Optional String denoting the reason for stopping the task; used for status reporting and may be null.TaskState getTaskState(UUID uuid)
uuid - UUID of task to stop.Set<UUID> getAllTasks()
Set<UUID> getTasks(TaskStatus taskStatus)
taskStatus - See TaskStatus enum.Copyright © 2016 Grakn Labs Ltd. All rights reserved.