public class VirtualShellNG extends SessionChannelNG
Modifier and Type | Class and Description |
---|---|
static interface |
VirtualShellNG.WindowSizeChangeListener |
Modifier and Type | Field and Description |
---|---|
protected ShellCommandFactory |
commandFactory |
protected VirtualConsole |
console |
SSH_EXTENDED_DATA_STDERR
Constructor and Description |
---|
VirtualShellNG(com.sshtools.common.ssh.SshConnection con,
ShellCommandFactory commandFactory) |
VirtualShellNG(com.sshtools.common.ssh.SshConnection con,
ShellCommandFactory commandFactory,
java.lang.String shellCommand) |
Modifier and Type | Method and Description |
---|---|
void |
addProtectedEnvironmentVar(java.lang.String name) |
void |
addWindowSizeChangeListener(VirtualShellNG.WindowSizeChangeListener listener) |
protected boolean |
allocatePseudoTerminal(java.lang.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 RootShell |
createShell(com.sshtools.common.ssh.SshConnection con) |
void |
disableRawMode() |
void |
enableRawMode() |
protected boolean |
executeCommand(java.lang.String cmd) |
protected void |
onChannelOpenFailure() |
protected void |
onLocalEOF() |
protected void |
onSessionData(java.nio.ByteBuffer data) |
void |
onSessionOpen() |
protected void |
processSignal(java.lang.String signal)
A signal can be delivered to the process by the client.
|
void |
removeWindowSizeChangeListener(VirtualShellNG.WindowSizeChangeListener listener) |
protected boolean |
requestAgentForwarding(java.lang.String requestType)
Implement this method to support agent forwarding.
|
boolean |
setEnvironmentVariable(java.lang.String name,
java.lang.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.
|
createChannel, executeCommand, getErrorStream, getMaximumWindowSpace, getMinimumWindowSpace, getSubsystem, idle, isAgentForwardingRequested, isIncomingDataHalted, isSingleSession, onChannelClosed, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelOpenConfirmation, onChannelRequest, onExtendedData, onRemoteEOF, openChannel, sendStderrData, sendStderrData, sendStdoutData, sendStdoutData, setSingleSession, startSubsystem
addEventListener, canClose, checkWindowSpace, clearIdleState, close, close, createCache, evaluateWindowSpace, getChannelType, getCloseFuture, getConnection, getConnectionProtocol, getContext, getInputStream, getLastActivity, getLocalId, getLocalPacket, getLocalWindow, getMaxiumRemotePacketSize, getMaxiumRemoteWindowSize, getOpenFuture, getOutputStream, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, getTimeout, haltIncomingData, isClosed, isClosing, isConnected, isLocalEOF, isOpen, isRemoteEOF, log, log, log, logMessage, onChannelError, onRemoteClose, onWindowAdjust, processChannelRequestResponse, registerExtendedDataType, resetIdleState, resumeIncomingData, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelRequest, sendChannelRequest, sendData, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust, sendWindowAdjust, setTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected VirtualConsole console
protected ShellCommandFactory commandFactory
public VirtualShellNG(com.sshtools.common.ssh.SshConnection con, ShellCommandFactory commandFactory, java.lang.String shellCommand)
public VirtualShellNG(com.sshtools.common.ssh.SshConnection con, ShellCommandFactory commandFactory)
public void addWindowSizeChangeListener(VirtualShellNG.WindowSizeChangeListener listener)
public void removeWindowSizeChangeListener(VirtualShellNG.WindowSizeChangeListener listener)
public void addProtectedEnvironmentVar(java.lang.String name)
protected boolean executeCommand(java.lang.String cmd)
protected void changeWindowDimensions(int cols, int rows, int width, int height)
SessionChannelNG
changeWindowDimensions
in class SessionChannelNG
protected void onSessionData(java.nio.ByteBuffer data)
onSessionData
in class SessionChannelNG
public void onSessionOpen()
onSessionOpen
in interface com.sshtools.common.ssh.SessionChannel
onSessionOpen
in class SessionChannelNG
protected boolean startShell()
SessionChannelNG
startShell
in class SessionChannelNG
protected RootShell createShell(com.sshtools.common.ssh.SshConnection con) throws com.sshtools.common.permissions.PermissionDeniedException, java.io.IOException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
protected boolean requestAgentForwarding(java.lang.String requestType)
SessionChannelNG
requestAgentForwarding
in class SessionChannelNG
protected boolean allocatePseudoTerminal(java.lang.String term, int cols, int rows, int width, int height, byte[] modes)
SessionChannelNG
allocatePseudoTerminal
in class SessionChannelNG
public boolean setEnvironmentVariable(java.lang.String name, java.lang.String value)
SessionChannelNG
setEnvironmentVariable
in interface com.sshtools.common.ssh.SessionChannelServer
setEnvironmentVariable
in class SessionChannelNG
protected void onChannelOpenFailure()
onChannelOpenFailure
in class com.sshtools.synergy.ssh.ChannelNG<SshServerContext>
protected void processSignal(java.lang.String signal)
SessionChannelNG
processSignal
in class SessionChannelNG
protected void onLocalEOF()
onLocalEOF
in class com.sshtools.synergy.ssh.ChannelNG<SshServerContext>
public void enableRawMode()
enableRawMode
in interface com.sshtools.common.ssh.SessionChannelServer
enableRawMode
in class SessionChannelNG
public void disableRawMode()
disableRawMode
in interface com.sshtools.common.ssh.SessionChannelServer
disableRawMode
in class SessionChannelNG
Copyright © 2022. All rights reserved.