Package com.sshtools.j2ssh.session
Class SessionChannelClient
- java.lang.Object
-
- com.sshtools.j2ssh.connection.Channel
-
- com.sshtools.j2ssh.connection.IOChannel
-
- com.sshtools.j2ssh.session.SessionChannelClient
-
public class SessionChannelClient extends IOChannel
- Version:
- $Revision: 1.52 $
- Author:
- $author$
-
-
Field Summary
-
Fields inherited from class com.sshtools.j2ssh.connection.IOChannel
boundInputStream, boundOutputStream, in, ios, out
-
Fields inherited from class com.sshtools.j2ssh.connection.Channel
connection, localChannelId, localPacketSize, localWindow, remoteChannelId, remotePacketSize, remoteWindow, state
-
-
Constructor Summary
Constructors Constructor Description SessionChannelClient()
Creates a new SessionChannelClient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeTerminalDimensions(PseudoTerminal term)
boolean
executeCommand(java.lang.String command)
byte[]
getChannelConfirmationData()
byte[]
getChannelOpenData()
java.lang.String
getChannelType()
java.lang.Integer
getExitCode()
protected int
getMaximumPacketSize()
protected int
getMaximumWindowSpace()
protected int
getMinimumWindowSpace()
java.lang.String
getSessionType()
java.io.InputStream
getStderrInputStream()
SubsystemClient
getSubsystem()
boolean
isLocalFlowControlEnabled()
protected void
onChannelClose()
protected void
onChannelExtData(SshMsgChannelExtendedData msg)
protected void
onChannelOpen()
protected void
onChannelRequest(java.lang.String requestType, boolean wantReply, byte[] requestData)
boolean
requestAgentForwarding()
boolean
requestPseudoTerminal(PseudoTerminal term)
boolean
requestPseudoTerminal(java.lang.String term, int cols, int rows, int width, int height, java.lang.String terminalModes)
boolean
requestX11Forwarding(int display, java.lang.String cookie)
boolean
setEnvironmentVariable(java.lang.String name, java.lang.String value)
void
setSessionType(java.lang.String sessionType)
void
setSignalListener(SignalListener signalListener)
boolean
startShell()
boolean
startSubsystem(SubsystemClient subsystem)
boolean
startSubsystem(java.lang.String subsystem)
-
Methods inherited from class com.sshtools.j2ssh.connection.IOChannel
bindInputStream, bindOutputStream, getInputStream, getOutputStream, init, onChannelData, onChannelEOF, open, setLocalEOF
-
Methods inherited from class com.sshtools.j2ssh.connection.Channel
addEventListener, close, finalizeClose, getLocalChannelId, getLocalPacketSize, getLocalWindow, getName, getRemoteChannelId, getRemotePacketSize, getRemoteWindow, getState, init, isClosed, isLocalEOF, isOpen, isRemoteEOF, processChannelData, processChannelData, remoteClose, sendChannelData, sendChannelExtData, setName, setRemoteEOF
-
-
-
-
Method Detail
-
getChannelOpenData
public byte[] getChannelOpenData()
- Specified by:
getChannelOpenData
in classChannel
- Returns:
-
getChannelConfirmationData
public byte[] getChannelConfirmationData()
- Specified by:
getChannelConfirmationData
in classChannel
- Returns:
-
getChannelType
public java.lang.String getChannelType()
- Specified by:
getChannelType
in classChannel
- Returns:
-
getMinimumWindowSpace
protected int getMinimumWindowSpace()
- Specified by:
getMinimumWindowSpace
in classChannel
- Returns:
-
getMaximumWindowSpace
protected int getMaximumWindowSpace()
- Specified by:
getMaximumWindowSpace
in classChannel
- Returns:
-
getMaximumPacketSize
protected int getMaximumPacketSize()
- Specified by:
getMaximumPacketSize
in classChannel
- Returns:
-
setSignalListener
public void setSignalListener(SignalListener signalListener)
- Parameters:
signalListener
-
-
setEnvironmentVariable
public boolean setEnvironmentVariable(java.lang.String name, java.lang.String value) throws java.io.IOException
- Parameters:
name
-value
-- Returns:
- Throws:
java.io.IOException
-
requestAgentForwarding
public boolean requestAgentForwarding() throws java.io.IOException
- Returns:
- Throws:
java.io.IOException
SshException
InvalidChannelException
-
requestX11Forwarding
public boolean requestX11Forwarding(int display, java.lang.String cookie) throws java.io.IOException
- Parameters:
display
-cookie
-- Returns:
- Throws:
java.io.IOException
-
getExitCode
public java.lang.Integer getExitCode()
- Returns:
-
changeTerminalDimensions
public void changeTerminalDimensions(PseudoTerminal term) throws java.io.IOException
- Parameters:
term
-- Throws:
java.io.IOException
-
executeCommand
public boolean executeCommand(java.lang.String command) throws java.io.IOException
- Parameters:
command
-- Returns:
- Throws:
java.io.IOException
-
requestPseudoTerminal
public boolean requestPseudoTerminal(java.lang.String term, int cols, int rows, int width, int height, java.lang.String terminalModes) throws java.io.IOException
- Parameters:
term
-cols
-rows
-width
-height
-terminalModes
-- Returns:
- Throws:
java.io.IOException
-
requestPseudoTerminal
public boolean requestPseudoTerminal(PseudoTerminal term) throws java.io.IOException
- Parameters:
term
-- Returns:
- Throws:
java.io.IOException
-
startShell
public boolean startShell() throws java.io.IOException
- Returns:
- Throws:
java.io.IOException
-
startSubsystem
public boolean startSubsystem(java.lang.String subsystem) throws java.io.IOException
- Parameters:
subsystem
-- Returns:
- Throws:
java.io.IOException
-
startSubsystem
public boolean startSubsystem(SubsystemClient subsystem) throws java.io.IOException
- Parameters:
subsystem
-- Returns:
- Throws:
java.io.IOException
-
isLocalFlowControlEnabled
public boolean isLocalFlowControlEnabled()
- Returns:
-
getSessionType
public java.lang.String getSessionType()
- Returns:
-
setSessionType
public void setSessionType(java.lang.String sessionType)
- Parameters:
sessionType
-
-
getSubsystem
public SubsystemClient getSubsystem()
- Returns:
-
onChannelClose
protected void onChannelClose() throws java.io.IOException
- Overrides:
onChannelClose
in classIOChannel
- Throws:
java.io.IOException
-
onChannelOpen
protected void onChannelOpen() throws java.io.IOException
- Specified by:
onChannelOpen
in classChannel
- Throws:
java.io.IOException
-
getStderrInputStream
public java.io.InputStream getStderrInputStream() throws java.io.IOException
- Returns:
- Throws:
java.io.IOException
-
onChannelExtData
protected void onChannelExtData(SshMsgChannelExtendedData msg) throws java.io.IOException
- Overrides:
onChannelExtData
in classIOChannel
- Parameters:
msg
-- Throws:
java.io.IOException
-
onChannelRequest
protected void onChannelRequest(java.lang.String requestType, boolean wantReply, byte[] requestData) throws java.io.IOException
- Specified by:
onChannelRequest
in classChannel
- Parameters:
requestType
-wantReply
-requestData
-- Throws:
java.io.IOException
-
-