com.maverick.sshd
Class UnsupportedSession

java.lang.Object
  extended by com.maverick.sshd.Channel
      extended by com.maverick.sshd.SessionChannel
          extended by com.maverick.sshd.UnsupportedSession
All Implemented Interfaces:
IdleStateListener

public class UnsupportedSession
extends SessionChannel

This is a basic session that provides a message to the user to inform them that a shell or command cannot be executed because the server does not support an interactive session.

Author:
Lee David Painter

Nested Class Summary
 
Nested classes/interfaces inherited from class com.maverick.sshd.Channel
Channel.QueuedData
 
Field Summary
 
Fields inherited from class com.maverick.sshd.SessionChannel
MAX_WINDOW_SPACE, MIN_WINDOW_SPACE
 
Fields inherited from class com.maverick.sshd.Channel
connection, localwindow, localWindowLock
 
Constructor Summary
UnsupportedSession()
           
 
Method Summary
protected  boolean allocatePseudoTerminal(java.lang.String parm1, int parm2, int parm3, int parm4, int parm5, byte[] parm6)
          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(java.lang.String cmd)
          Invoked when the user wants to execute a command
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 onRemoteEOF()
          The remote side has reported EOF so no more data will be received.
protected  void onSessionOpen()
          Called once the session is open and data can be sent/received.
protected  void processSignal(java.lang.String signal)
          A signal can be delivered to the process by the client.
protected  void processStderrData(byte[] data)
           
protected  void processStdinData(byte[] data)
          Data has arrived on the session's stdin stream.
protected  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.
 
Methods inherited from class com.maverick.sshd.SessionChannel
createChannel, evaluateWindowSpace, getSessionIdentifier, haltIncomingData, idle, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelOpenConfirmation, onChannelRequest, onExtendedData, openChannel, resumeIncomingData, sendChannelDataWithBuffering, sendExitStatus, sendStderrData, sendStderrData, sendStdoutData, sendStdoutData
 
Methods inherited from class com.maverick.sshd.Channel
addEventListener, addInputListener, addOutputListener, canClose, clearIdleState, close, getChannelType, getConnection, getContext, getLocalId, getLocalPacket, getLocalWindow, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, hasQueuedData, isClosed, isClosing, isEOF, isOpen, onRemoteClose, onWindowAdjust, queueSize, registerExtendedData, resetIdleState, sendChannelData, sendChannelData, sendChannelData, sendChannelData, sendChannelDataWithBuffering, sendChannelRequest, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsupportedSession

public UnsupportedSession()
Method Detail

processStdinData

protected void processStdinData(byte[] data)
Description copied from class: SessionChannel
Data has arrived on the session's stdin stream.

Specified by:
processStdinData in class SessionChannel

processStderrData

protected void processStderrData(byte[] data)

onChannelClosed

protected void onChannelClosed()
Description copied from class: Channel
Called when the channel has been closed to enable resources to be freed.

Specified by:
onChannelClosed in class Channel

executeCommand

protected boolean executeCommand(java.lang.String cmd)
Description copied from class: SessionChannel
Invoked when the user wants to execute a command

Specified by:
executeCommand in class SessionChannel
Returns:
true if the cmd has been executed, otherwise false

changeWindowDimensions

protected void changeWindowDimensions(int cols,
                                      int rows,
                                      int width,
                                      int height)
Description copied from class: SessionChannel
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.

Specified by:
changeWindowDimensions in class SessionChannel

onSessionOpen

protected void onSessionOpen()
Description copied from class: SessionChannel
Called once the session is open and data can be sent/received. This event happens once the user has either started the shell or executed a command.

Specified by:
onSessionOpen in class SessionChannel

onLocalEOF

protected void onLocalEOF()
Description copied from class: Channel
Called when the local side is EOF.

Specified by:
onLocalEOF in class Channel

startShell

protected boolean startShell()
Description copied from class: SessionChannel
Invoked when the user wants to start a shell.

Specified by:
startShell in class SessionChannel
Returns:
true if the shell has been started, otherwise false

allocatePseudoTerminal

protected boolean allocatePseudoTerminal(java.lang.String parm1,
                                         int parm2,
                                         int parm3,
                                         int parm4,
                                         int parm5,
                                         byte[] parm6)
Description copied from class: SessionChannel
If the client requests a pseudo terminal for the session this method will be invoked before the shell, exec or subsystem is started.

Specified by:
allocatePseudoTerminal in class SessionChannel
Returns:
boolean

processSignal

protected void processSignal(java.lang.String signal)
Description copied from class: SessionChannel
A signal can be delivered to the process by the client. If a signal is received this method will be invoked so that the session may evaluate and take the required action.

Specified by:
processSignal in class SessionChannel

onRemoteEOF

protected void onRemoteEOF()
Description copied from class: SessionChannel
The remote side has reported EOF so no more data will be received. This will force the channel to close. If this behaviour is not required you can override this method

Overrides:
onRemoteEOF in class SessionChannel

setEnvironmentVariable

protected boolean setEnvironmentVariable(java.lang.String name,
                                         java.lang.String value)
Description copied from class: SessionChannel
If the client requests that an environment variable be set this method will be invoked.

Specified by:
setEnvironmentVariable in class SessionChannel
Returns:
true if the variable has been set, otherwise false

onChannelOpenFailure

protected void onChannelOpenFailure()
Description copied from class: Channel
Called when the remote side fails to open a channel in response to our request. It only makes sense for some channel types to override this method. A local forwarding channel will never receive this message for example.

Overrides:
onChannelOpenFailure in class Channel


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.