Package jadex.platform.service.cli
Class CliAgent
- java.lang.Object
- 
- jadex.platform.service.cli.CliAgent
 
- 
- All Implemented Interfaces:
- ICliService,- IInternalCliService
 
 public class CliAgent extends java.lang.Object implements ICliService, IInternalCliService The client agent allows for executing command line commands. It offers the executeCommand() method via the ICliService.
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanabortedFlag if the agent is killed.protected IInternalAccessagentThe agent.protected booleanconsoleThe console flag.protected booleanguiThe gui flag.protected java.util.Map<Tuple2<java.lang.String,java.lang.Integer>,Tuple2<ACliShell,java.lang.Long>>shellsThe shells per session.protected longshelltimeoutThe shell timeout.
 - 
Constructor SummaryConstructors Constructor Description CliAgent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>addAllCommandsFromClassPath(Tuple2<java.lang.String,java.lang.Integer> sessionid)Add all commands from classpath.IFuture<java.lang.Void>addCommand(ICliCommand cmd, Tuple2<java.lang.String,java.lang.Integer> sessionid)Add a specific command.voidbody()The agent body.protected voidcreateConsole()Create a console reader.protected voidcreateGui()Create a gui frame for console in and out.IFuture<java.lang.String>executeCommand(java.lang.String line, Tuple2<java.lang.String,java.lang.Integer> sessionid)Execute a command line command and get back the results.ACliShellgetShell(Tuple2<java.lang.String,java.lang.Integer> sessionid)Get the shell.IFuture<java.lang.String>internalGetShellPrompt(Tuple2<java.lang.String,java.lang.Integer> sessionid)Get the shell prompt.voidkilled()Called when the agent is killed.voidremoveShell(Tuple2<java.lang.String,java.lang.Integer> sessionid)Remove a shell.IFuture<java.lang.Boolean>removeSubshell(Tuple2<java.lang.String,java.lang.Integer> sessionid)Remove a subshell.
 
- 
- 
- 
Field Detail- 
agentprotected IInternalAccess agent The agent.
 - 
guiprotected boolean gui The gui flag.
 - 
consoleprotected boolean console The console flag.
 - 
shelltimeoutprotected long shelltimeout The shell timeout.
 - 
shellsprotected java.util.Map<Tuple2<java.lang.String,java.lang.Integer>,Tuple2<ACliShell,java.lang.Long>> shells The shells per session.
 - 
abortedprotected boolean aborted Flag if the agent is killed.
 
- 
 - 
Method Detail- 
bodypublic void body() The agent body.
 - 
killedpublic void killed() Called when the agent is killed.
 - 
createGuiprotected void createGui() Create a gui frame for console in and out.
 - 
createConsoleprotected void createConsole() Create a console reader.
 - 
executeCommandpublic IFuture<java.lang.String> executeCommand(java.lang.String line, Tuple2<java.lang.String,java.lang.Integer> sessionid) Execute a command line command and get back the results.- Specified by:
- executeCommandin interface- ICliService
- Parameters:
- command- The command.
- Returns:
- The result of the command.
 
 - 
internalGetShellPromptpublic IFuture<java.lang.String> internalGetShellPrompt(Tuple2<java.lang.String,java.lang.Integer> sessionid) Get the shell prompt.- Specified by:
- internalGetShellPromptin interface- IInternalCliService
- Parameters:
- sessionid- The session id.
- Returns:
- The prompt.
 
 - 
removeSubshellpublic IFuture<java.lang.Boolean> removeSubshell(Tuple2<java.lang.String,java.lang.Integer> sessionid) Remove a subshell.- Specified by:
- removeSubshellin interface- IInternalCliService
- Parameters:
- sessionid- The session id.
- Returns:
- True, if could be removed.
 
 - 
addAllCommandsFromClassPathpublic IFuture<java.lang.Void> addAllCommandsFromClassPath(Tuple2<java.lang.String,java.lang.Integer> sessionid) Add all commands from classpath.- Specified by:
- addAllCommandsFromClassPathin interface- IInternalCliService
- Parameters:
- sessionid- The session id.
 
 - 
addCommandpublic IFuture<java.lang.Void> addCommand(ICliCommand cmd, Tuple2<java.lang.String,java.lang.Integer> sessionid) Add a specific command.- Specified by:
- addCommandin interface- IInternalCliService
- Parameters:
- sessionid- The session id.
 
 - 
getShellpublic ACliShell getShell(Tuple2<java.lang.String,java.lang.Integer> sessionid) Get the shell.- Parameters:
- session- The session.
- Returns:
- The shell.
 
 - 
removeShellpublic void removeShell(Tuple2<java.lang.String,java.lang.Integer> sessionid) Remove a shell.- Parameters:
- session- The session.
 
 
- 
 
-