Package jadex.platform.service.cli
Class ACliShell
- java.lang.Object
-
- jadex.platform.service.cli.ACliShell
-
- Direct Known Subclasses:
CliShell
,RemoteCliShell
public abstract class ACliShell extends java.lang.Object
Abstract base class for shells.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tuple2<java.lang.String,java.lang.Integer>
sessionid
The session id.protected java.lang.String
workingdir
The current working dir.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IFuture<java.lang.Void>
addAllCommandsFromClassPath()
Add all commands from classpath.abstract IFuture<java.lang.Void>
addCommand(ICliCommand cmd)
Add a command.abstract void
addSubshell(ACliShell subshell)
Add a subshell.abstract IFuture<java.lang.String>
executeCommand(java.lang.String line)
Execute a command line command and get back the results.abstract java.util.Map<java.lang.String,ICliCommand>
getCommands()
Get the commands.Tuple2<java.lang.String,java.lang.Integer>
getSessionId()
Get the session id.IFuture<java.lang.String>
getShellPrompt()
Get the complete prompt.java.lang.String
getWorkingDir()
Get the workingdir.abstract IFuture<java.lang.String>
internalGetShellPrompt()
Get the complete prompt (internal method).abstract IFuture<java.lang.Boolean>
removeSubshell()
Remove a subshell.void
setWorkingDir(java.lang.String workingdir)
Set the workingdir.
-
-
-
Field Detail
-
sessionid
protected Tuple2<java.lang.String,java.lang.Integer> sessionid
The session id.
-
workingdir
protected java.lang.String workingdir
The current working dir.
-
-
Constructor Detail
-
ACliShell
public ACliShell(Tuple2<java.lang.String,java.lang.Integer> sessionid)
Create a new cli.
-
-
Method Detail
-
addCommand
public abstract IFuture<java.lang.Void> addCommand(ICliCommand cmd)
Add a command.- Parameters:
cmd
- The command.
-
addAllCommandsFromClassPath
public abstract IFuture<java.lang.Void> addAllCommandsFromClassPath()
Add all commands from classpath.- Parameters:
cl
- The classloader to use.
-
getCommands
public abstract java.util.Map<java.lang.String,ICliCommand> getCommands()
Get the commands.- Returns:
- The commands.
-
executeCommand
public abstract IFuture<java.lang.String> executeCommand(java.lang.String line)
Execute a command line command and get back the results.- Parameters:
command
- The command.- Returns:
- The result of the command.
-
addSubshell
public abstract void addSubshell(ACliShell subshell)
Add a subshell.
-
removeSubshell
public abstract IFuture<java.lang.Boolean> removeSubshell()
Remove a subshell.
-
getShellPrompt
public IFuture<java.lang.String> getShellPrompt()
Get the complete prompt. Calls subshells getPrompt().- Returns:
- the complete prompt;
-
internalGetShellPrompt
public abstract IFuture<java.lang.String> internalGetShellPrompt()
Get the complete prompt (internal method). Calls subshells getPrompt().- Returns:
- the complete prompt;
-
getSessionId
public Tuple2<java.lang.String,java.lang.Integer> getSessionId()
Get the session id.- Returns:
- The session id.
-
getWorkingDir
public java.lang.String getWorkingDir()
Get the workingdir.- Returns:
- The workingdir.
-
setWorkingDir
public void setWorkingDir(java.lang.String workingdir)
Set the workingdir.- Parameters:
workingdir
- The workingdir to set.
-
-