public abstract class AsynchronousCommand extends Object implements org.apache.sshd.server.command.Command, org.apache.sshd.server.session.ServerSessionAware, Runnable
Command implementation that uses a thread to run a command.| Modifier | Constructor and Description |
|---|---|
protected |
AsynchronousCommand(SshCommandFactory.CommandLine cmdLine) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
destroy(org.apache.sshd.server.channel.ChannelSession channel) |
SshCommandFactory.CommandLine |
getCmdLine() |
protected User |
getCurrentUser() |
org.apache.sshd.server.Environment |
getEnvironment() |
OutputStream |
getErrorStream() |
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
org.apache.sshd.server.session.ServerSession |
getSession() |
void |
run() |
protected abstract int |
runCommand() |
void |
setErrorStream(OutputStream err) |
void |
setExitCallback(org.apache.sshd.server.ExitCallback callback) |
void |
setInputStream(InputStream in) |
void |
setOutputStream(OutputStream out) |
void |
setSession(org.apache.sshd.server.session.ServerSession session) |
void |
start(org.apache.sshd.server.channel.ChannelSession channel,
org.apache.sshd.server.Environment env) |
void |
start(org.apache.sshd.server.Environment env) |
protected AsynchronousCommand(SshCommandFactory.CommandLine cmdLine)
public void setInputStream(InputStream in)
setInputStream in interface org.apache.sshd.server.command.CommandDirectInputStreamAwarepublic void setOutputStream(OutputStream out)
setOutputStream in interface org.apache.sshd.server.command.CommandDirectOutputStreamAwarepublic void setErrorStream(OutputStream err)
setErrorStream in interface org.apache.sshd.server.command.CommandDirectErrorStreamAwarepublic InputStream getInputStream()
public OutputStream getOutputStream()
public OutputStream getErrorStream()
public SshCommandFactory.CommandLine getCmdLine()
public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
setExitCallback in interface org.apache.sshd.server.command.Commandpublic org.apache.sshd.server.session.ServerSession getSession()
public void setSession(org.apache.sshd.server.session.ServerSession session)
setSession in interface org.apache.sshd.server.session.ServerSessionAware@CheckForNull protected User getCurrentUser()
public org.apache.sshd.server.Environment getEnvironment()
public void start(org.apache.sshd.server.channel.ChannelSession channel,
org.apache.sshd.server.Environment env)
throws IOException
start in interface org.apache.sshd.server.command.CommandLifecycleIOExceptionpublic void start(org.apache.sshd.server.Environment env)
throws IOException
IOExceptionpublic void destroy(org.apache.sshd.server.channel.ChannelSession channel)
throws Exception
destroy in interface org.apache.sshd.server.command.CommandLifecycleExceptionpublic void destroy()
Copyright © 2016–2022. All rights reserved.