Package org.tailormap.api.scheduling
Interface Task
- All Known Implementing Classes:
FailingPocTask,IndexTask,InterruptablePocTask,PocTask,PrometheusPingTask
public interface Task
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet the description of the task.getType()Get the type of the task.default booleanDetermine if this task can be stopped on demand (implementsInterruptableJob).voidsetDescription(String description) Set the description of the task.default voidtaskProgress(TaskProgressEvent event) Handle the task progress event.
-
Field Details
-
TYPE_KEY
- See Also:
-
DESCRIPTION_KEY
- See Also:
-
UUID_KEY
- See Also:
-
CRON_EXPRESSION_KEY
- See Also:
-
PRIORITY_KEY
- See Also:
-
STATE_KEY
- See Also:
-
LAST_RESULT_KEY
- See Also:
-
INTERRUPTABLE_KEY
- See Also:
-
EXECUTION_COUNT_KEY
- See Also:
-
EXECUTION_FINISHED_KEY
- See Also:
-
-
Method Details
-
getType
TaskType getType()Get the type of the task. Implement this method to return the key for the type of task. This must be a read-only property.- Returns:
- the type of task
-
getDescription
String getDescription()Get the description of the task.- Returns:
- the description
-
setDescription
Set the description of the task.- Parameters:
description- the description
-
taskProgress
Handle the task progress event. Override this method to handle the progress of the task, e.g. by emittingServerSentEvents. The default is a no-op, which means no progress events will be emitted.- Parameters:
event- the task progress event
-
isInterruptable
default boolean isInterruptable()Determine if this task can be stopped on demand (implementsInterruptableJob).- Returns:
trueif the task can be stopped on demand, false otherwise- See Also:
-
InterruptableJob
-