public class ChannelSession extends AbstractServerChannel
| Modifier and Type | Class and Description |
|---|---|
class |
ChannelSession.CommandCloseable |
protected static class |
ChannelSession.StandardEnvironment |
AbstractChannel.GracefulChannelCloseable, AbstractChannel.GracefulStateCloseableUtils.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 |
exitStatusSentDEFAULT_CHANNEL_CLOSE_TIMEOUT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, executor, gracefulFuture, gracefulState, handlers, id, localWindow, recipient, remoteWindow, RESPONSE_BUFFER_GROWTH_FACTOR, service, session, shutdownExecutorcloseFuture, lock, statelog| 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
|
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, sendExitStatusaddRequestHandler, configureWindow, getExecutorService, getId, getLocalWindow, getRecipient, getRemoteWindow, getSession, handleClose, handleData, handleExtendedData, handleFailure, handleRequest, init, isEofSignalled, isShutdownOnExit, notifyStateChanged, sendEof, sendResponse, sendWindowAdjust, setEofSignalled, setExecutorService, setShutdownOnExit, toString, writePacketdoCloseGracefullybuilder, close, isClosed, isClosing, preCloseclose, isOpenpublic 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 class AbstractChannelIOExceptionprotected Closeable getInnerCloseable()
getInnerCloseable in class AbstractChannelprotected void doCloseImmediately()
CloseableUtils.AbstractCloseabledoCloseImmediately is called once and only once with state == Immediate
Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing
doCloseImmediately in class AbstractChannelpublic void handleEof()
throws IOException
handleEof in class AbstractChannelIOExceptionprotected void doWriteData(byte[] data,
int off,
int len)
throws IOException
doWriteData in class AbstractChannelIOExceptionprotected void doWriteExtendedData(byte[] data,
int off,
int len)
throws IOException
doWriteExtendedData in class AbstractChannelIOExceptionpublic Boolean handleRequest(String type, Buffer buffer) throws IOException
type - The request typebuffer - The Buffer containing extra request-specific contentBoolean representing the success/failure of handling
the request - null if unknown request receivedIOException - If request requires some extra response and failed
to generate itprotected boolean handleEnv(Buffer buffer) throws IOException
IOExceptionprotected boolean handlePtyReq(Buffer buffer) throws IOException
IOExceptionprotected boolean handleWindowChange(Buffer buffer) throws IOException
IOExceptionprotected boolean handleSignal(Buffer buffer) throws IOException
IOExceptionprotected boolean handleBreak(Buffer buffer) throws IOException
IOExceptionprotected boolean handleShell(Buffer buffer) throws IOException
IOExceptionprotected boolean handleExec(Buffer buffer) throws IOException
IOExceptionprotected boolean handleSubsystem(Buffer buffer) throws IOException
IOExceptionpublic void setDataReceiver(ChannelDataReceiver receiver)
Command to install ChannelDataReceiver.
When you do this, Command.setInputStream(java.io.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(java.io.InputStream) will
not read any data.receiver - The ChannelDataReceiver instanceprotected void prepareCommand()
throws IOException
IOExceptionprotected int getPtyModeValue(PtyMode mode)
protected boolean handleAgentForwarding(Buffer buffer) throws IOException
IOExceptionprotected boolean handleX11Forwarding(Buffer buffer) throws IOException
IOExceptionprotected ChannelSession.StandardEnvironment getEnvironment()
protected void closeShell(int exitValue)
throws IOException
IOExceptionCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.