public class ChannelSession extends AbstractServerChannel
Modifier and Type | Class and Description |
---|---|
class |
ChannelSession.CommandCloseable |
static class |
ChannelSession.Factory |
protected static class |
ChannelSession.StandardEnvironment |
AbstractChannel.GracefulChannelCloseable, AbstractChannel.GracefulState
CloseableUtils.AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
protected ChannelAsyncOutputStream |
asyncErr |
protected ChannelAsyncOutputStream |
asyncOut |
protected Command |
command |
protected CloseFuture |
commandExitFuture |
static long |
DEFAULT_COMMAND_EXIT_TIMEOUT |
protected ChannelSession.StandardEnvironment |
env |
protected OutputStream |
err |
protected OutputStream |
out |
protected ChannelDataReceiver |
receiver |
protected Buffer |
tempBuffer |
protected String |
type |
exitStatusSent
DEFAULT_CHANNEL_CLOSE_TIMEOUT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, gracefulFuture, gracefulState, handlers, id, localWindow, recipient, remoteWindow, service, session
closeFuture, lock, log, state
Constructor and Description |
---|
ChannelSession() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEnvVariable(String name,
String value) |
protected void |
closeShell(int exitValue) |
protected void |
doCloseImmediately()
doCloseImmediately is called once and only once
with state == Immediate
Overriding methods should always call the base implementation.
|
protected void |
doWriteData(byte[] data,
int off,
int len) |
protected void |
doWriteExtendedData(byte[] data,
int off,
int len) |
protected ChannelSession.StandardEnvironment |
getEnvironment() |
protected Closeable |
getInnerCloseable() |
protected int |
getPtyModeValue(PtyMode mode) |
protected boolean |
handleAgentForwarding(Buffer buffer) |
protected boolean |
handleBreak(Buffer buffer) |
protected boolean |
handleEnv(Buffer buffer) |
void |
handleEof() |
protected boolean |
handleExec(Buffer buffer) |
protected boolean |
handlePtyReq(Buffer buffer) |
Boolean |
handleRequest(String type,
Buffer buffer) |
protected boolean |
handleShell(Buffer buffer) |
protected boolean |
handleSignal(Buffer buffer) |
protected boolean |
handleSubsystem(Buffer buffer) |
void |
handleWindowAdjust(Buffer buffer) |
protected boolean |
handleWindowChange(Buffer buffer) |
protected boolean |
handleX11Forwarding(Buffer buffer) |
protected void |
prepareCommand() |
void |
setDataReceiver(ChannelDataReceiver receiver)
For
Command to install ChannelDataReceiver . |
doInit, handleOpenFailure, handleOpenSuccess, open, sendExitStatus
addRequestHandler, configureWindow, getId, getLocalWindow, getRecipient, getRemoteWindow, getSession, handleClose, handleData, handleExtendedData, handleFailure, handleRequest, init, notifyStateChanged, sendEof, sendWindowAdjust, toString, writePacket
doCloseGracefully
builder, close, isClosed, isClosing, preClose
public static final long DEFAULT_COMMAND_EXIT_TIMEOUT
protected String type
protected ChannelAsyncOutputStream asyncOut
protected ChannelAsyncOutputStream asyncErr
protected OutputStream out
protected OutputStream err
protected Command command
protected ChannelDataReceiver receiver
protected ChannelSession.StandardEnvironment env
protected Buffer tempBuffer
protected final CloseFuture commandExitFuture
public void handleWindowAdjust(Buffer buffer) throws IOException
handleWindowAdjust
in interface Channel
handleWindowAdjust
in class AbstractChannel
IOException
protected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractChannel
protected void doCloseImmediately()
CloseableUtils.AbstractCloseable
doCloseImmediately
in class AbstractChannel
public void handleEof() throws IOException
handleEof
in interface Channel
handleEof
in class AbstractChannel
IOException
protected void doWriteData(byte[] data, int off, int len) throws IOException
doWriteData
in class AbstractChannel
IOException
protected void doWriteExtendedData(byte[] data, int off, int len) throws IOException
doWriteExtendedData
in class AbstractChannel
IOException
public Boolean handleRequest(String type, Buffer buffer) throws IOException
IOException
protected boolean handleEnv(Buffer buffer) throws IOException
IOException
protected boolean handlePtyReq(Buffer buffer) throws IOException
IOException
protected boolean handleWindowChange(Buffer buffer) throws IOException
IOException
protected boolean handleSignal(Buffer buffer) throws IOException
IOException
protected boolean handleBreak(Buffer buffer) throws IOException
IOException
protected boolean handleShell(Buffer buffer) throws IOException
IOException
protected boolean handleExec(Buffer buffer) throws IOException
IOException
protected boolean handleSubsystem(Buffer buffer) throws IOException
IOException
public void setDataReceiver(ChannelDataReceiver receiver)
Command
to install ChannelDataReceiver
.
When you do this, Command.setInputStream(InputStream)
or
AsyncCommand.setIoInputStream(org.apache.sshd.common.io.IoInputStream)
will no longer be invoked. If you call this method from Command.start(Environment)
,
the input stream you received in Command.setInputStream(InputStream)
will
not read any data.protected void prepareCommand() throws IOException
IOException
protected int getPtyModeValue(PtyMode mode)
protected boolean handleAgentForwarding(Buffer buffer) throws IOException
IOException
protected boolean handleX11Forwarding(Buffer buffer) throws IOException
IOException
protected ChannelSession.StandardEnvironment getEnvironment()
protected void closeShell(int exitValue) throws IOException
IOException
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.