Package jadex.platform.service.cli
Class ACliCommand
- java.lang.Object
-
- jadex.platform.service.cli.ACliCommand
-
- All Implemented Interfaces:
ICliCommand
- Direct Known Subclasses:
AddResourceCommand,ChangeDirectoryCommand,CreateComponentCommand,DestroyComponentCommand,DownloadFileCommand,EvaluateExpressionCommand,ExecuteFileCommand,HelpCommand,KillPlatformCommand,ListComponentsCommand,ListDirectoryCommand,ListPlatformsCommand,MakeDirectoryCommand,RemoveFileCommand,SaveSettingsCommand,ServiceQueryCommand,SetSecretCommand,ShowPlatformArgumentsCommand,SwitchPlatformCommand,UploadFileCommand
public abstract class ACliCommand extends java.lang.Object implements ICliCommand
The abstract command implementation implements the logic for: invokeCommand(final CliContext context, String[] strargs) by converting the arguments to objects using the argument infos (and converts) and converting back the result to a string using the result info.
-
-
Constructor Summary
Constructors Constructor Description ACliCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ArgumentInfo[]getArgumentInfos(CliContext context)Get the argument infos.java.lang.StringgetDescription()Get the command description.java.lang.StringgetExampleUsage()Get example usage(s).abstract java.lang.String[]getNames()Get the command names (name including alias').ResultInfogetResultInfo(CliContext context, java.util.Map<java.lang.String,java.lang.Object> args)Get the result info.IFuture<java.lang.String>invokeCommand(CliContext context, java.lang.String[] strargs)Invoke the command.abstract java.lang.ObjectinvokeCommand(CliContext context, java.util.Map<java.lang.String,java.lang.Object> args)Invoke the command.
-
-
-
Method Detail
-
getNames
public abstract java.lang.String[] getNames()
Get the command names (name including alias').- Specified by:
getNamesin interfaceICliCommand- Returns:
- A string array of the command name and optional further alias names.
-
getDescription
public java.lang.String getDescription()
Get the command description.- Specified by:
getDescriptionin interfaceICliCommand- Returns:
- The command description.
-
getExampleUsage
public java.lang.String getExampleUsage()
Get example usage(s).- Specified by:
getExampleUsagein interfaceICliCommand- Returns:
- Example usages.
-
invokeCommand
public abstract java.lang.Object invokeCommand(CliContext context, java.util.Map<java.lang.String,java.lang.Object> args)
Invoke the command.- Specified by:
invokeCommandin interfaceICliCommand- Parameters:
context- The context.args- The arguments.
-
getArgumentInfos
public ArgumentInfo[] getArgumentInfos(CliContext context)
Get the argument infos.- Specified by:
getArgumentInfosin interfaceICliCommand- Parameters:
context- The context.- Returns:
- The argument infos.
-
getResultInfo
public ResultInfo getResultInfo(CliContext context, java.util.Map<java.lang.String,java.lang.Object> args)
Get the result info.- Specified by:
getResultInfoin interfaceICliCommand- Parameters:
context- The context.- Returns:
- The result info.
-
invokeCommand
public IFuture<java.lang.String> invokeCommand(CliContext context, java.lang.String[] strargs)
Invoke the command.- Specified by:
invokeCommandin interfaceICliCommand- Parameters:
context- The context.args- The arguments.
-
-