Package jadex.platform.service.cli
Class RemoteCliShell
- java.lang.Object
-
- jadex.platform.service.cli.ACliShell
-
- jadex.platform.service.cli.RemoteCliShell
-
public class RemoteCliShell extends ACliShell
A remote shell is backed by an internal client service to which the commands are forwarded.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalCliService
cliser
The client service used to delegate commands to.-
Fields inherited from class jadex.platform.service.cli.ACliShell
sessionid, workingdir
-
-
Constructor Summary
Constructors Constructor Description RemoteCliShell(IInternalCliService cliser, Tuple2<java.lang.String,java.lang.Integer> sessionid)
Create a new remote shell.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>
addAllCommandsFromClassPath()
Add all commands from classpath.IFuture<java.lang.Void>
addCommand(ICliCommand cmd)
Add a command.void
addSubshell(ACliShell subshell)
Add a subshell.IFuture<java.lang.String>
executeCommand(java.lang.String line)
Execute a command line command and get back the results.java.util.Map<java.lang.String,ICliCommand>
getCommands()
Get the commands.IFuture<java.lang.String>
internalGetShellPrompt()
Get the complete prompt (internal method).IFuture<java.lang.Boolean>
removeSubshell()
Remove a subshell.-
Methods inherited from class jadex.platform.service.cli.ACliShell
getSessionId, getShellPrompt, getWorkingDir, setWorkingDir
-
-
-
-
Field Detail
-
cliser
protected IInternalCliService cliser
The client service used to delegate commands to.
-
-
Constructor Detail
-
RemoteCliShell
public RemoteCliShell(IInternalCliService cliser, Tuple2<java.lang.String,java.lang.Integer> sessionid)
Create a new remote shell.
-
-
Method Detail
-
executeCommand
public IFuture<java.lang.String> executeCommand(java.lang.String line)
Description copied from class:ACliShell
Execute a command line command and get back the results.- Specified by:
executeCommand
in classACliShell
- Returns:
- The result of the command.
-
internalGetShellPrompt
public IFuture<java.lang.String> internalGetShellPrompt()
Get the complete prompt (internal method). Calls subshells getPrompt().- Specified by:
internalGetShellPrompt
in classACliShell
- Returns:
- the complete prompt;
-
addAllCommandsFromClassPath
public IFuture<java.lang.Void> addAllCommandsFromClassPath()
Add all commands from classpath.- Specified by:
addAllCommandsFromClassPath
in classACliShell
- Parameters:
cl
- The classloader to use.
-
addCommand
public IFuture<java.lang.Void> addCommand(ICliCommand cmd)
Add a command.- Specified by:
addCommand
in classACliShell
- Parameters:
cmd
- The command.
-
removeSubshell
public IFuture<java.lang.Boolean> removeSubshell()
Remove a subshell.- Specified by:
removeSubshell
in classACliShell
-
getCommands
public java.util.Map<java.lang.String,ICliCommand> getCommands()
Get the commands.- Specified by:
getCommands
in classACliShell
- Returns:
- The commands.
-
addSubshell
public void addSubshell(ACliShell subshell)
Add a subshell.- Specified by:
addSubshell
in classACliShell
-
-