Package org.dellroad.jct.ssh
Class JctExecCommand
java.lang.Object
org.dellroad.jct.ssh.JctExecCommand
- All Implemented Interfaces:
org.apache.sshd.server.command.Command,org.apache.sshd.server.command.CommandDirectErrorStreamAware,org.apache.sshd.server.command.CommandDirectInputStreamAware,org.apache.sshd.server.command.CommandDirectOutputStreamAware,org.apache.sshd.server.command.CommandDirectStreamsAware,org.apache.sshd.server.command.CommandLifecycle
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.sshd.server.channel.ChannelSessionprotected Charsetprotected org.apache.sshd.server.Environmentprotected OutputStreamprotected org.apache.sshd.server.ExitCallbackprotected final Execprotected InputStreamprotected Localeprotected final org.slf4j.Loggerprotected OutputStreamprotected ExecSession -
Constructor Summary
ConstructorsConstructorDescriptionJctExecCommand(Exec exec, org.apache.sshd.server.channel.ChannelSession channel, String command) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecSessionCreate aConsoleSessionthat will implement this command.protected ThreadcreateSessionThread(Runnable action) voiddestroy(org.apache.sshd.server.channel.ChannelSession channel) protected intprotected StringgetThreadName(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) protected voidhandleChannelSignal(org.apache.sshd.common.channel.Channel channel, org.apache.sshd.server.Signal signal) Handle an incoming signal from the SSH client terminal.voidvoidsetExitCallback(org.apache.sshd.server.ExitCallback exitCallback) voidvoidfinal voidstart(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env)
-
Field Details
-
log
protected final org.slf4j.Logger log -
factory
-
channel
protected final org.apache.sshd.server.channel.ChannelSession channel -
in
-
out
-
err
-
exitCallback
protected org.apache.sshd.server.ExitCallback exitCallback -
env
protected org.apache.sshd.server.Environment env -
charset
-
locale
-
session
-
-
Constructor Details
-
JctExecCommand
-
-
Method Details
-
createSession
Create aConsoleSessionthat will implement this command.- Returns:
- newly created session
- Throws:
IOException- if an I/O error occurs
-
handleChannelSignal
protected void handleChannelSignal(org.apache.sshd.common.channel.Channel channel, org.apache.sshd.server.Signal signal) Handle an incoming signal from the SSH client terminal.The implementation in
AbstractCommanddoes nothing.- Parameters:
channel- SSH channelsignal- the signal received
-
setInputStream
- Specified by:
setInputStreamin interfaceorg.apache.sshd.server.command.CommandDirectInputStreamAware
-
setOutputStream
- Specified by:
setOutputStreamin interfaceorg.apache.sshd.server.command.CommandDirectOutputStreamAware
-
setErrorStream
- Specified by:
setErrorStreamin interfaceorg.apache.sshd.server.command.CommandDirectErrorStreamAware
-
setExitCallback
public void setExitCallback(org.apache.sshd.server.ExitCallback exitCallback) - Specified by:
setExitCallbackin interfaceorg.apache.sshd.server.command.Command
-
start
public final void start(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) throws IOException - Specified by:
startin interfaceorg.apache.sshd.server.command.CommandLifecycle- Throws:
IOException
-
destroy
- Specified by:
destroyin interfaceorg.apache.sshd.server.command.CommandLifecycle- Throws:
Exception
-
executeSession
- Throws:
InterruptedException
-
createSessionThread
-
getThreadName
protected String getThreadName(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env)
-