public class VirtualShell extends SessionChannel
| Modifier and Type | Class and Description |
|---|---|
static interface |
VirtualShell.WindowSizeChangeListener |
Channel.DataBlock, Channel.QueuedDataCHANNEL_TYPE, maximumWindowSpace, minimumWindowSpace, SSH_EXTENDED_DATA_STDERRconnection, localwindow, localWindowLock| Constructor and Description |
|---|
VirtualShell() |
VirtualShell(int maximumPacket,
int maximumWindowSpace) |
VirtualShell(ShellCommandFactory commandFactory,
VirtualProcessFactory processFactory) |
VirtualShell(ShellCommandFactory commandFactory,
VirtualProcessFactory processFactory,
String shellCommand) |
| Modifier and Type | Method and Description |
|---|---|
void |
addWindowSizeChangeListener(VirtualShell.WindowSizeChangeListener listener) |
protected boolean |
allocatePseudoTerminal(String term,
int cols,
int rows,
int width,
int height,
byte[] modes)
If the client requests a pseudo terminal for the session this method will
be invoked before the shell, exec or subsystem is started.
|
protected void |
changeWindowDimensions(int cols,
int rows,
int width,
int height)
When the window (terminal) size changes on the client side, it MAY send
notification in which case this method will be invoked to notify the
session that a change has occurred.
|
protected boolean |
executeCommand(String cmd)
Invoked when the user wants to execute a command
|
VirtualProcessFactory |
getProcessFactory() |
protected void |
onChannelClosed()
Called when the channel has been closed to enable resources to be freed.
|
protected void |
onChannelOpenFailure()
Called when the remote side fails to open a channel in response to our
request.
|
protected void |
onLocalEOF()
Called when the local side is EOF.
|
protected void |
onSessionOpen()
Called once the session is open and data can be sent/received.
|
protected void |
processSignal(String signal)
A signal can be delivered to the process by the client.
|
protected void |
processStdinData(byte[] data)
just writes the input data to the outputstream of the 'input' field.
|
void |
removeWindowSizeChangeListener(VirtualShell.WindowSizeChangeListener listener) |
protected boolean |
requestAgentForwarding(String requestType)
Implement this method to support agent forwarding.
|
protected boolean |
setEnvironmentVariable(String name,
String value)
If the client requests that an environment variable be set this method
will be invoked.
|
protected boolean |
startShell()
Invoked when the user wants to start a shell.
|
close, createChannel, evaluateWindowSpace, executeTask, getMaximumWindowSpace, getMinimumWindowSpace, getSubsystem, haltIncomingData, idle, isAgentForwardingRequested, isIncomingDataHalted, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelOpenConfirmation, onChannelRequest, onExtendedData, onRemoteEOF, openChannel, resumeIncomingData, sendExitStatus, sendStderrData, sendStderrData, sendStdoutData, sendStdoutData, setMaximumWindowSpace, setMinimumWindowSpace, startSubsystemaddEventListener, addInputListener, addOutputListener, canClose, clearIdleState, close, consumeWindowSpace, createCloseTask, getChannelType, getConnection, getContext, getLocalId, getLocalPacket, getLocalWindow, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, isClosed, isClosing, isEOF, isOpen, isSelfManagedWindowSpace, markEOF, onRemoteClose, onWindowAdjust, queueSize, registerExtendedData, resetIdleState, sendChannelData, sendChannelData, sendChannelData, sendChannelData, sendChannelDataAndBlock, sendChannelRequest, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjustpublic VirtualShell(int maximumPacket,
int maximumWindowSpace)
public VirtualShell()
public VirtualShell(ShellCommandFactory commandFactory, VirtualProcessFactory processFactory, String shellCommand)
public VirtualShell(ShellCommandFactory commandFactory, VirtualProcessFactory processFactory)
public VirtualProcessFactory getProcessFactory()
public void addWindowSizeChangeListener(VirtualShell.WindowSizeChangeListener listener)
public void removeWindowSizeChangeListener(VirtualShell.WindowSizeChangeListener listener)
protected void processStdinData(byte[] data)
processStdinData in class SessionChannelcom.sshtools.server.SessionChannel#processStdinData(byte[])protected boolean executeCommand(String cmd)
SessionChannelexecuteCommand in class SessionChannelprotected void changeWindowDimensions(int cols,
int rows,
int width,
int height)
SessionChannelchangeWindowDimensions in class SessionChannelprotected void onSessionOpen()
SessionChannelonSessionOpen in class SessionChannelprotected boolean startShell()
SessionChannelstartShell in class SessionChannelprotected boolean requestAgentForwarding(String requestType)
SessionChannelrequestAgentForwarding in class SessionChannelprotected boolean allocatePseudoTerminal(String term, int cols, int rows, int width, int height, byte[] modes)
SessionChannelallocatePseudoTerminal in class SessionChannelprotected boolean setEnvironmentVariable(String name, String value)
SessionChannelsetEnvironmentVariable in class SessionChannelprotected void onChannelOpenFailure()
ChannelonChannelOpenFailure in class Channelprotected void processSignal(String signal)
SessionChannelprocessSignal in class SessionChannelprotected void onChannelClosed()
ChannelonChannelClosed in class Channelprotected void onLocalEOF()
ChannelonLocalEOF in class ChannelCopyright © 2025. All rights reserved.