public class CommandSender extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
CommandSender.CommandHandler |
static interface |
CommandSender.ReplyHandler |
| Constructor and Description |
|---|
CommandSender(String dest)
Constructor
|
CommandSender(String dest,
CommandSender.ReplyHandler handler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(CommandSender.ReplyHandler handler)
Adds a reply handler
|
void |
removeHandler(CommandSender.ReplyHandler handler)
Removes a reply handler
|
void |
sendCommand(boolean reply,
int timeout,
String path,
String cmnd,
Object... args)
Sends a command.
|
void |
sendCommand(boolean reply,
String path,
String cmnd,
Object... args)
Sends a command.
|
void |
sendCommand(int timeout,
String path,
String cmnd,
Object... args)
Sends a command without expecting a reply.
|
void |
sendCommand(String path,
String cmnd,
Object... args)
Sends a command without expecting a reply.
|
void |
setTimeout(int timeout)
Sets the default timeout.
|
public CommandSender(String dest)
dest - The name of the destination subsystem for the commandspublic CommandSender(String dest, CommandSender.ReplyHandler handler)
dest - The name of the destination subsystem for the commandshandler - The handler for command repliespublic void sendCommand(String path, String cmnd, Object... args)
path - The path within the destination to receive the command,
or null if the top levelcmnd - The command to executeargs - The command argumentspublic void sendCommand(int timeout,
String path,
String cmnd,
Object... args)
timeout - The command timeout (ms)path - The path within the destination to receive the command,
or null if the top levelcmnd - The command to executeargs - The command argumentspublic void sendCommand(boolean reply,
String path,
String cmnd,
Object... args)
reply - Whether to handle the command replypath - The path within the destination to receive the command,
or null if the top levelcmnd - The command to executeargs - The command argumentspublic void sendCommand(boolean reply,
int timeout,
String path,
String cmnd,
Object... args)
reply - Whether to handle the command replytimeout - The command timeout (ms)path - The path within the destination to receive the command,
or null if the top levelcmnd - The command to executeargs - The command argumentspublic void setTimeout(int timeout)
timeout - The default timeout (ms). If zero, the command waits forever.
If positive, the maximum of this value and the ACK custom timeout is used.
If negative, its absolute value is used. The initial value is 5000.public void addHandler(CommandSender.ReplyHandler handler)
handler - The handler to addpublic void removeHandler(CommandSender.ReplyHandler handler)
handler - The handler to removeCopyright © 2021 LSST. All rights reserved.