@Plugin(name="Command Service Plugin", id="command-service", description="Command service utility.") public final class CommandService extends ConsolePlugin implements ConsoleService
| Constructor and Description |
|---|
CommandService() |
| Modifier and Type | Method and Description |
|---|---|
CommandTask |
execute(CommandHandle handle,
Duration timeout,
String command,
Object... args)
Sends a command to a remote subsystem.
|
CommandTask |
execute(CommandHandle handle,
String command,
Object... args)
Sends a command to a remote subsystem with the default timeout.
|
CommandTask |
execute(Duration timeout,
String command,
Object... args)
Sends a command to a remote subsystem, and displays a message if the command fails.
|
CommandTask |
execute(String command,
Object... args)
Sends a command to a remote subsystem with the default timeout, and displays a message if the command fails.
|
CommandSender |
getSender()
Creates a new customizable instance of
CommandSender configured for use in the graphical console environment. |
static CommandService |
getService() |
void |
watch(Consumer<Boolean> watcher,
String command,
int numberOfArguments)
Not yet implemented.
Registers a component that should be notified whenever the availability of the specified command changes.
|
getConsole, getServices, initialize, propertiesChanged, restore, save, setServicesProvider, shutdown, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstartService, stopServicepublic static CommandService getService()
public CommandSender getSender()
CommandSender configured for use in the graphical console environment.
For any commands sent through the CommandSender created by this method,
CommandHandle methods will be called on the AWT Event Dispatching Thread.
The sender created by this method can be further customized.CommandSender.public CommandTask execute(CommandHandle handle, Duration timeout, String command, Object... args)
This method returns immediately, without waiting for the command to be processed
by the messaging service or the target subsystem. Synchronous command execution can
be done by calling get() or getResult()
on the CommandTask returned by this method.
handle - Handle for processing the command responses. May be null if no processing is required.
All callbacks are executed on the AWT Event Dispatching Thread.timeout - Timeout. Cannot be null.
Zero duration means the command will never time out.
Negative duration means its absolute value will be used and the custom timeout
suggested by the target subsystem through an ACK will be ignored.command - Command in subsystem/path format.args - Command arguments.public CommandTask execute(CommandHandle handle, String command, Object... args)
This method returns immediately, without waiting for the command to be processed
by the messaging service or the target subsystem. Synchronous command execution can
be done by calling get() or getResult()
on the CommandTask returned by this method.
handle - Handle for processing the command responses.
Cannot be null. If no processing is required, use CommandHandle.NONE.
All callbacks are executed on the AWT Event Dispatching Thread.command - Command in subsystem/path format.args - Command arguments.public CommandTask execute(Duration timeout, String command, Object... args)
This method returns immediately, without waiting for the command to be processed
by the messaging service or the target subsystem. Synchronous command execution can
be done by calling get() or getResult()
on the CommandTask returned by this method.
timeout - Timeout. Cannot be null.
Zero duration means the command will never time out.
Negative duration means its absolute value will be used and the custom timeout
suggested by the target subsystem through an ACK will be ignored.command - Command in subsystem/path format.args - Command arguments.public CommandTask execute(String command, Object... args)
This method returns immediately, without waiting for the command to be processed
by the messaging service or the target subsystem. Synchronous command execution can
be done by calling get() or getResult()
on the CommandTask returned by this method.
command - Command in subsystem/path format.args - Command arguments.public void watch(Consumer<Boolean> watcher, String command, int numberOfArguments)
watcher - Component to be notified.command - Command in subsystem/path format.numberOfArguments - Number of arguments accepted by the command.Copyright © 2020 LSST. All rights reserved.