com.sshtools.j2ssh.session
Class SessionChannelClient

java.lang.Object
  extended by com.sshtools.j2ssh.connection.Channel
      extended by com.sshtools.j2ssh.connection.IOChannel
          extended by com.sshtools.j2ssh.session.SessionChannelClient
Direct Known Subclasses:
ScpClient.ScpChannel

public class SessionChannelClient
extends IOChannel

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
private  SshMessageStore errorMessages
           
private  java.lang.Integer exitCode
           
private  boolean localFlowControl
           
private static org.apache.commons.logging.Log log
           
private  java.lang.String sessionType
           
private  SignalListener signalListener
           
private  ChannelInputStream stderr
           
private  SubsystemClient subsystem
           
 
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
SessionChannelClient()
          Creates a new SessionChannelClient object.
 
Method Summary
 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(java.lang.String subsystem)
           
 boolean startSubsystem(SubsystemClient 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

exitCode

private java.lang.Integer exitCode

sessionType

private java.lang.String sessionType

subsystem

private SubsystemClient subsystem

localFlowControl

private boolean localFlowControl

signalListener

private SignalListener signalListener

errorMessages

private SshMessageStore errorMessages

stderr

private ChannelInputStream stderr
Constructor Detail

SessionChannelClient

public SessionChannelClient()
Creates a new SessionChannelClient object.

Method Detail

getChannelOpenData

public byte[] getChannelOpenData()
Specified by:
getChannelOpenData in class Channel
Returns:

getChannelConfirmationData

public byte[] getChannelConfirmationData()
Specified by:
getChannelConfirmationData in class Channel
Returns:

getChannelType

public java.lang.String getChannelType()
Specified by:
getChannelType in class Channel
Returns:

getMinimumWindowSpace

protected int getMinimumWindowSpace()
Specified by:
getMinimumWindowSpace in class Channel
Returns:

getMaximumWindowSpace

protected int getMaximumWindowSpace()
Specified by:
getMaximumWindowSpace in class Channel
Returns:

getMaximumPacketSize

protected int getMaximumPacketSize()
Specified by:
getMaximumPacketSize in class Channel
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 class IOChannel
Throws:
java.io.IOException

onChannelOpen

protected void onChannelOpen()
                      throws java.io.IOException
Specified by:
onChannelOpen in class Channel
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 class IOChannel
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 class Channel
Parameters:
requestType -
wantReply -
requestData -
Throws:
java.io.IOException