public abstract class CommandEvent extends MessageEvent
TelescopeCommand.
Concrete subclasses of this class will carry additional parameter.
Example:
MOVE_TELESCOPE 1 965054152000 131.130.36.73 314.745655 -12.983457In the example above, computer 131.130.36.73 sends a position command 105 to 131.130.36.79.
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandEvent.Create
Test.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMANDPACKAGE
The package name of the commands to prepend to the class name.
|
static String |
JVIEWPACKAGE
The package name of the commands to prepend to the class name.
|
static char |
TYPESEPARATOR
The separator between the command name and the command server.
|
SEPCHARlocalHost, sourceNamesource| Modifier | Constructor and Description |
|---|---|
protected |
CommandEvent(Object src,
String type,
long time)
A fully qualified command.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
classNameToTemplate(String cname)
Converts a class name to the command string.
|
static CommandEvent |
createCommand(MessageBin bin)
Creates a full command event from a message bin.
|
static CommandEvent |
createCommand(Object src,
String template)
Creates a new command event from a template string.
|
static CommandEvent |
createJCommand(Object src,
String template)
Creates a new jcommand event from a template string.
|
static String |
extractType(Class command)
Converts a concrete command class to the class type as found in the
command event header.
|
private static Constructor |
getConstructor(String cname)
Tries to locate the class with the given name.
|
int |
getExpectedAcknowledgeNumber()
Returns the number of acknowledge evnets this command is expected to
follow.
|
private static CommandEvent |
instantiateCommand(Constructor construct,
Object src,
String type,
long time)
Uses the argument constructor to
instantiate a new command event class.
|
protected static String[] |
parseForStrings(String line)
Parses a command line into an array of strings.
|
static String |
templateToClassName(String template)
Converts a template name into a valid class name.
|
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getLine, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, parseLine, readFromBufferedStream, setNr, setTime, setType, setValid, toSkippedString, toStringgetHost, getSourceName, setSourceNamegetSourcepublic static final String COMMANDPACKAGE
public static final String JVIEWPACKAGE
public static final char TYPESEPARATOR
public static CommandEvent createCommand(MessageBin bin)
public static CommandEvent createCommand(Object src, String template)
CommandRendering instance is than needed to fill in the
command line.public static CommandEvent createJCommand(Object src, String template)
public static String extractType(Class command)
command - A class object denoting a command classpublic static String classNameToTemplate(String cname)
TYPESEPARATOR is inserted right before
this capital letter.public static String templateToClassName(String template)
TYPESEPARATOR is ereased,
the following letter is capitalized.protected static String[] parseForStrings(String line)
private static Constructor getConstructor(String cname)
private static CommandEvent instantiateCommand(Constructor construct, Object src, String type, long time)
public int getExpectedAcknowledgeNumber()