public class ChannelSession extends AbstractServerChannel
Modifier and Type | Class and Description |
---|---|
static class |
ChannelSession.Factory |
protected static class |
ChannelSession.StandardEnvironment |
Modifier and Type | Field and Description |
---|---|
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
CLOSE_RECV, CLOSE_SENT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, gracefulState, handlers, id, localWindow, recipient, remoteWindow, service, session
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, 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 |
doWriteData(byte[] data,
int off,
int len) |
protected void |
doWriteExtendedData(byte[] data,
int off,
int len) |
protected Closeable |
getCommandCloseable() |
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) |
protected boolean |
handleWindowChange(Buffer buffer) |
protected boolean |
handleX11Forwarding(Buffer buffer) |
protected void |
postClose() |
protected void |
prepareCommand() |
void |
setDataReceiver(ChannelDataReceiver receiver)
For
Command to install ChannelDataReceiver . |
doInit, handleOpenFailure, handleOpenSuccess, open, sendExitStatus
addRequestHandler, configureWindow, getGracefulCloseable, getId, getLocalWindow, getRecipient, getRemoteWindow, getSession, handleClose, handleData, handleExtendedData, handleFailure, handleRequest, handleWindowAdjust, init, notifyStateChanged, sendEof, sendWindowAdjust, toString, writePacket
doCloseGracefully, doCloseImmediately
close
public static final long DEFAULT_COMMAND_EXIT_TIMEOUT
protected String type
protected OutputStream out
protected OutputStream err
protected Command command
protected ChannelDataReceiver receiver
protected ChannelSession.StandardEnvironment env
protected Buffer tempBuffer
protected final CloseFuture commandExitFuture
protected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractChannel
protected Closeable getCommandCloseable()
protected void postClose()
postClose
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)
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.