Package org.jenkinsci.main.modules.sshd
Class AsynchronousCommand
- java.lang.Object
-
- org.jenkinsci.main.modules.sshd.AsynchronousCommand
-
- All Implemented Interfaces:
Runnable
,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
,org.apache.sshd.server.session.ServerSessionAware
public abstract class AsynchronousCommand extends Object implements org.apache.sshd.server.command.Command, org.apache.sshd.server.session.ServerSessionAware, Runnable
PartialCommand
implementation that uses a thread to run a command.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AsynchronousCommand(SshCommandFactory.CommandLine cmdLine)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Constructor Detail
-
AsynchronousCommand
protected AsynchronousCommand(SshCommandFactory.CommandLine cmdLine)
-
-
Method Detail
-
setInputStream
public void setInputStream(InputStream in)
- Specified by:
setInputStream
in interfaceorg.apache.sshd.server.command.CommandDirectInputStreamAware
-
setOutputStream
public void setOutputStream(OutputStream out)
- Specified by:
setOutputStream
in interfaceorg.apache.sshd.server.command.CommandDirectOutputStreamAware
-
setErrorStream
public void setErrorStream(OutputStream err)
- Specified by:
setErrorStream
in interfaceorg.apache.sshd.server.command.CommandDirectErrorStreamAware
-
getInputStream
public InputStream getInputStream()
-
getOutputStream
public OutputStream getOutputStream()
-
getErrorStream
public OutputStream getErrorStream()
-
getCmdLine
public SshCommandFactory.CommandLine getCmdLine()
-
setExitCallback
public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
- Specified by:
setExitCallback
in interfaceorg.apache.sshd.server.command.Command
-
getSession
public org.apache.sshd.server.session.ServerSession getSession()
-
setSession
public void setSession(org.apache.sshd.server.session.ServerSession session)
- Specified by:
setSession
in interfaceorg.apache.sshd.server.session.ServerSessionAware
-
getCurrentUser
@CheckForNull protected User getCurrentUser()
-
getEnvironment
public org.apache.sshd.server.Environment getEnvironment()
-
start
public void start(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) throws IOException
- Specified by:
start
in interfaceorg.apache.sshd.server.command.CommandLifecycle
- Throws:
IOException
-
start
public void start(org.apache.sshd.server.Environment env) throws IOException
- Throws:
IOException
-
destroy
public void destroy(org.apache.sshd.server.channel.ChannelSession channel) throws Exception
- Specified by:
destroy
in interfaceorg.apache.sshd.server.command.CommandLifecycle
- Throws:
Exception
-
destroy
public void destroy()
-
-