|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.cockpit.CommandTemplate | +--com.ls.cockpit.InternalCommand
this class is used to disjoin external and internal commands
Field Summary | |
protected String |
revisionInformation
revision information string, managed by our version control system. |
Constructor Summary | |
InternalCommand()
the default constuctor |
|
InternalCommand(Map parameters,
Map dependencies,
Map description)
the constructor containing initialize parameters |
Method Summary | |
protected static String |
createReplyId()
creates a cockpit definite replyId for sending messages |
Object |
executeCommand(String command,
Object arguments)
executes a command with the specified command (depends on the specified String) and the specified arguments object. |
Object |
executeCommand(String command,
Object[] arguments)
executes a command with the specified command (depends on the specified String) and the specified arguments object. |
protected String[] |
generateCommandArguments(String arguments,
String[] validKeys)
generate the command's arguments from the arguments String by checking the key values of validity and by ignoring the key values between an xml content. |
protected abstract Map |
getAlias()
initializes all aliases if it's implemented in the commands class You have to imlement this method that it can be called by run method. |
protected Map |
getFlippedQosMap()
gets the flipped Map of the description's Map from the Quality of Service. |
protected abstract Map |
getHelp()
initializes all description's if it's implemented in the commands class You have to imlement this method that it can be called by run method. |
protected abstract void |
init()
initializes all the needed commands |
boolean |
interpret(Message currentMessage)
interprets the incoming messages from the lars platform connected to |
void |
run()
runs the thread |
protected void |
setAlias(Map aliasesMap)
sets the aliases the commands containing this command class |
protected void |
setDependencies(Map dependencies)
sets the dependencies for the specified commands for executing them. |
protected void |
setDescription(Map description)
sets the description for this command class |
void |
setUserInterfaceReference(IUserInterface uiReference)
sets the reference to the user interface for the commandTemplate |
boolean |
startClass(String className,
Map parameters,
Map dependencies,
Map description)
tries to instantiate a command class by using the given parameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String revisionInformation
Constructor Detail |
public InternalCommand()
public InternalCommand(Map parameters, Map dependencies, Map description)
parameters
- containing initialize parametersdependencies
- containing dependencies to execute an commanddescription
- containing the description for each commandMethod Detail |
protected abstract void init()
init
in class com.ls.cockpit.CommandTemplate
protected abstract Map getHelp()
getHelp
in class com.ls.cockpit.CommandTemplate
protected abstract Map getAlias()
getAlias
in class com.ls.cockpit.CommandTemplate
public void run()
run
in interface ICommand
protected void setDependencies(Map dependencies)
dependencies
- containing all dependencies for each command to execute themprotected void setDescription(Map description)
description
- containing all descriptions (short, long) for all
commands in this command's classprotected void setAlias(Map aliasesMap)
aliasesMap
- containing all aliases for commands containing this command's classpublic void setUserInterfaceReference(IUserInterface uiReference)
setUserInterfaceReference
in interface ICommand
uiReference
- the reference to the user interfaceprotected Map getFlippedQosMap()
protected String[] generateCommandArguments(String arguments, String[] validKeys) throws InvalidArgumentException
arguments
- contains the complete arguments String specified by uservalidKeys
- contains all valid keys for the specified commandInvalidArgumentException
- If the arguments aren't correctpublic boolean startClass(String className, Map parameters, Map dependencies, Map description) throws InvocationTargetException, InstantiationException, IllegalAccessException, LinkageError, ClassNotFoundException, NoSuchMethodException, SecurityException
startClass
in interface ICommand
className
- the class to be instantiatedparameters
- containing all parameters needed by this classdependencies
- containing all dependencies to execute a commanddescription
- containing all command's descriptionInvocationTargetException
- If the class can't be invokedInstantiationException
- If the class can't be instantiatedIllegalAccessException
- If the class can't be accessed cause of an access violationLinkageError
- If the class can't be linked with the current ClassLoaderClassNotFoundException
- If the class can't be foundNoSuchMethodException
- If the needed constructor isn't presentSecurityException
- If there is a security violationprotected static String createReplyId()
public boolean interpret(Message currentMessage)
interpret
in interface IFromLars
currentMessage
- contains the messages sent from lars platformpublic final Object executeCommand(String command, Object arguments) throws CommandNotFoundException, CommandNotAvailableException, InvalidArgumentException
executeCommand
in interface ICommand
command
- the commands namearguments
- the arguments (could be any object, the command has to care about)CommandNotFoundException
- If the command doesn't existsCommandNotAvailableException
- If the command isn't available in this momentInvalidArgumentException
- If the arguments aren't correctpublic final Object executeCommand(String command, Object[] arguments) throws CommandNotFoundException, CommandNotAvailableException, InvalidArgumentException
command
- the commands namearguments
- the arguments (could be any object, the command has to care about)CommandNotFoundException
- If the command doesn't existsCommandNotAvailableException
- If the command isn't available in this momentInvalidArgumentException
- If the arguments aren't correct
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |