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.String
getDescription()
Get the command description.java.lang.String
getExampleUsage()
Get example usage(s).abstract java.lang.String[]
getNames()
Get the command names (name including alias').ResultInfo
getResultInfo(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.Object
invokeCommand(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:
getNames
in 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:
getDescription
in interfaceICliCommand
- Returns:
- The command description.
-
getExampleUsage
public java.lang.String getExampleUsage()
Get example usage(s).- Specified by:
getExampleUsage
in 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:
invokeCommand
in interfaceICliCommand
- Parameters:
context
- The context.args
- The arguments.
-
getArgumentInfos
public ArgumentInfo[] getArgumentInfos(CliContext context)
Get the argument infos.- Specified by:
getArgumentInfos
in 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:
getResultInfo
in 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:
invokeCommand
in interfaceICliCommand
- Parameters:
context
- The context.args
- The arguments.
-
-