Package org.tailormap.api.scheduling
Interface Task
- All Known Implementing Classes:
FailingPocTask
,IndexTask
,InterruptablePocTask
,PocTask
public interface Task
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the description of the task.getType()
Get the type of the task.default boolean
Determine if this task can be stopped on demand (implementsInterruptableJob
).void
setDescription
(String description) Set the description of the task.default void
taskProgress
(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:
-
-
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 emittingServerSentEvent
s. The default is a no-op.- Parameters:
event
- the task progress event
-
isInterruptable
default boolean isInterruptable()Determine if this task can be stopped on demand (implementsInterruptableJob
).- Returns:
true
if the task can be stopped on demand, false otherwise- See Also:
-
InterruptableJob
-