public interface TaskControlProtocol
extends org.ametiste.laplatform.protocol.Protocol
Defines protocol to control tasks termination lifecycle.
Note, clients of this protocol may affect termination of tasks, so if it is required, setup access grants for this protocol usage.
| Modifier and Type | Method and Description |
|---|---|
default void |
terminateTask(java.util.UUID taskId)
Terminates task if possible, in case where task already in
terminated or done state doing nothing.
|
default void |
terminateTask(java.util.UUID taskId,
java.util.function.Consumer<java.lang.Exception> failure)
Terminates task if possible, in case where task already in
terminated or done state doing nothing.
|
void |
terminateTask(java.util.UUID taskId,
java.util.Optional<java.lang.String> message,
java.util.Optional<java.util.function.Consumer<java.lang.Exception>> failure)
Terminates task if possible, in case where task already in
terminated or done state doing nothing.
|
default void |
terminateTask(java.util.UUID taskId,
java.lang.String message)
Terminates task if possible, in case where task already in
terminated or done state doing nothing.
|
default void |
terminateTask(java.util.UUID taskId,
java.lang.String message,
java.util.function.Consumer<java.lang.Exception> failure)
Terminates task if possible, in case where task already in
terminated or done state doing nothing.
|
void terminateTask(java.util.UUID taskId,
java.util.Optional<java.lang.String> message,
java.util.Optional<java.util.function.Consumer<java.lang.Exception>> failure)
Terminates task if possible, in case where task already in terminated or done state doing nothing.
Note, if task termination failed the cause exeption may be acquired through
failure consumer object.
taskId - identifier of task to be terminated, must be not nullmessage - reason of termination, may be nullfailure - consumer of failure reasons, may be nulldefault void terminateTask(java.util.UUID taskId,
java.lang.String message)
Terminates task if possible, in case where task already in terminated or done state doing nothing.
taskId - identifier of task to be terminated, must be not nullmessage - reason of termination, may be nulldefault void terminateTask(java.util.UUID taskId,
java.lang.String message,
java.util.function.Consumer<java.lang.Exception> failure)
Terminates task if possible, in case where task already in terminated or done state doing nothing.
taskId - identifier of task to be terminated, must be not nullmessage - reason of termination, may be nullfailure - consumer of failure reasons, may be nulldefault void terminateTask(java.util.UUID taskId,
java.util.function.Consumer<java.lang.Exception> failure)
Terminates task if possible, in case where task already in terminated or done state doing nothing.
taskId - identifier of task to be terminated, must be not nullfailure - consumer of failure reasons, may be nulldefault void terminateTask(java.util.UUID taskId)
Terminates task if possible, in case where task already in terminated or done state doing nothing.
taskId - identifier of task to be terminated, must be not null