Package com.sshtools.server.vsession
Class Msh
java.lang.Object
com.sshtools.server.vsession.AbstractCommand
com.sshtools.server.vsession.ShellCommand
com.sshtools.server.vsession.Msh
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
Catch
,RootShell
,SftpClientCommand
,Source
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandFactory<? extends Command>
static final String
protected Map<Long,
com.sshtools.server.vsession.Msh.Job> Fields inherited from class com.sshtools.server.vsession.ShellCommand
SUBSYSTEM_CALLBACK, SUBSYSTEM_FILESYSTEM, SUBSYSTEM_HELP, SUBSYSTEM_JVM, SUBSYSTEM_POLICY, SUBSYSTEM_SHELL, SUBSYSTEM_SSHD, SUBSYSTEM_SYSTEM, SUBSYSTEM_TEXT_EDITING
Fields inherited from class com.sshtools.server.vsession.AbstractCommand
exitCode
Fields inherited from interface com.sshtools.server.vsession.Command
STILL_ACTIVE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(MshListener listener) void
complete
(org.jline.reader.LineReader reader, org.jline.reader.ParsedLine line, List<org.jline.reader.Candidate> candidates) protected int
doSpawn
(VirtualConsole console, String[] args, boolean background) void
exit()
expandEnvironmentVariables
(Environment env, String value, Map<String, String> additionalReplacements) CommandFactory<? extends Command>
void
killProcess
(long pid) protected void
parseArgs
(VirtualConsole console, List<String> lineArgs) protected void
parseLine
(String line, VirtualConsole console) void
run
(String[] args, VirtualConsole console) protected void
runShell
(VirtualConsole console) protected void
setCommandFactory
(CommandFactory<? extends Command> commandFactory) protected void
source
(VirtualConsole console, com.sshtools.common.files.AbstractFile file) protected void
source
(VirtualConsole console, InputStream in) protected int
spawn
(VirtualConsole console, String[] args, boolean background) Methods inherited from class com.sshtools.server.vsession.AbstractCommand
getCommandName, getDescription, getExitCode, getName, getSubsystem, getUsage, isBuiltIn, isHidden, setBuiltIn, setDescription, setName, setSignature, setSubsystem
-
Field Details
-
commandFactory
-
runningJobs
-
LOGIN_CONTEXT
- See Also:
-
-
Constructor Details
-
Msh
-
Msh
-
-
Method Details
-
addListener
-
setCommandFactory
-
expandEnvironmentVariables
-
runShell
- Throws:
IOException
-
run
public void run(String[] args, VirtualConsole console) throws IOException, com.sshtools.common.permissions.PermissionDeniedException - Throws:
IOException
com.sshtools.common.permissions.PermissionDeniedException
-
source
protected void source(VirtualConsole console, com.sshtools.common.files.AbstractFile file) throws IOException, com.sshtools.common.permissions.PermissionDeniedException - Throws:
IOException
com.sshtools.common.permissions.PermissionDeniedException
-
source
- Throws:
IOException
-
parseArgs
- Throws:
IOException
-
parseLine
- Throws:
IOException
-
spawn
- Throws:
IOException
-
doSpawn
protected int doSpawn(VirtualConsole console, String[] args, boolean background) throws UnsupportedCommandException, IllegalAccessException, InstantiationException, org.apache.commons.cli.ParseException, IOException, com.sshtools.common.permissions.PermissionDeniedException, UsageException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException - Throws:
UnsupportedCommandException
IllegalAccessException
InstantiationException
org.apache.commons.cli.ParseException
IOException
com.sshtools.common.permissions.PermissionDeniedException
UsageException
IllegalArgumentException
InvocationTargetException
NoSuchMethodException
SecurityException
-
getLastError
-
exit
public void exit() -
getCommandFactory
-
complete
public void complete(org.jline.reader.LineReader reader, org.jline.reader.ParsedLine line, List<org.jline.reader.Candidate> candidates) - Specified by:
complete
in interfaceCommand
- Overrides:
complete
in classAbstractCommand
-
killProcess
public void killProcess(long pid)
-