public interface CommandHandle
| Modifier and Type | Field and Description |
|---|---|
static CommandHandle |
NONE
Empty
CommandHandle that does no processing. |
| Modifier and Type | Method and Description |
|---|---|
default void |
onAck(org.lsst.ccs.bus.messages.CommandAck ack,
CommandTask source)
Called when an ACK is received.
|
default void |
onCancel(CancellationException exception,
CommandTask source)
Called if the command is successfully canceled.
|
default void |
onExecutionFailure(Throwable exception,
CommandTask source)
Called when the target subsystem either throws an uncaught exception while trying
to execute the command, or returns an exception as the result of execution.
|
default void |
onNack(org.lsst.ccs.bus.messages.CommandNack nack,
CommandTask source)
Called when the command is rejected.
|
default void |
onResult(CommandCode code,
Object result,
CommandTask source)
Called when either the result of the command execution is received, or
the command is canceled or times out.
|
default void |
onResult(Object result,
CommandTask source)
Deprecated.
Use
onResult(CommandCode, Object, CommandTask) instead. |
default void |
onSendingFailure(Throwable exception,
CommandTask source)
Called if the command cannot be sent to the target subsystem.
|
default void |
onSuccess(Object result,
CommandTask source)
Called when the command result that is not an exception is received.
|
default void |
onTimeout(TimeoutException exception,
CommandTask source)
Called if the command times out.
|
default String |
shorten(String message)
Shortens messages longer than 200 characters.
|
static final CommandHandle NONE
CommandHandle that does no processing.default void onSendingFailure(Throwable exception, CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).exception - Exception thrown while attempting to send the command.source - CommandTask that executed the command.default void onAck(org.lsst.ccs.bus.messages.CommandAck ack,
CommandTask source)
ack - ACK.source - CommandTask that executed the command.default void onNack(org.lsst.ccs.bus.messages.CommandNack nack,
CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).nack - NACK.source - CommandTask that executed the command.default void onSuccess(Object result, CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).result - Result.source - CommandTask that executed the command.default void onExecutionFailure(Throwable exception, CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).exception - Exception thrown while attempting to execute the command.source - CommandTask that executed the command.default void onTimeout(TimeoutException exception, CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).exception - Exception thrown.source - CommandTask that executed the command.default void onCancel(CancellationException exception, CommandTask source)
onResult(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask).exception - Exception thrown.source - CommandTask that executed the command.@Deprecated default void onResult(Object result, CommandTask source)
onResult(CommandCode, Object, CommandTask) instead.onNack(org.lsst.ccs.bus.messages.CommandNack, org.lsst.ccs.gconsole.agent.command.CommandTask), onSuccess(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask), onExecutionFailure(java.lang.Throwable, org.lsst.ccs.gconsole.agent.command.CommandTask), onTimeout(java.util.concurrent.TimeoutException, org.lsst.ccs.gconsole.agent.command.CommandTask), onCancel(java.util.concurrent.CancellationException, org.lsst.ccs.gconsole.agent.command.CommandTask)
- is implemented.
The default implementation does nothing.result - Result of the command submission. Either an object returned by the
target subsystem, or a locally generated TimeoutException or CancellationException.source - CommandTask that executed the command.default void onResult(CommandCode code, Object result, CommandTask source)
onNack(org.lsst.ccs.bus.messages.CommandNack, org.lsst.ccs.gconsole.agent.command.CommandTask), onSuccess(java.lang.Object, org.lsst.ccs.gconsole.agent.command.CommandTask), onExecutionFailure(java.lang.Throwable, org.lsst.ccs.gconsole.agent.command.CommandTask), onTimeout(java.util.concurrent.TimeoutException, org.lsst.ccs.gconsole.agent.command.CommandTask), onCancel(java.util.concurrent.CancellationException, org.lsst.ccs.gconsole.agent.command.CommandTask)
- is implemented.
The default implementation does nothing.code - Exit code.result - Result of the command submission. Either an object returned
by the target subsystem, or a locally generated TimeoutException
or CancellationException.source - CommandTask that executed the command.Copyright © 2023 LSST. All rights reserved.