|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.maverick.sshd.Channel
com.maverick.sshd.SessionChannel
ExampleSession
public class ExampleSession
If your server is to support an interactive shell or the execution of
commands you need to implement this abstract class and set your class in the
ConfigurationContext.
context.setSessionProvider(ExampleSession.class);
This example session will simply echo all input until the 'exit' command is
received.
| 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 | |
|---|---|
ExampleSession()
|
|
| Method Summary | |
|---|---|
protected boolean |
allocatePseudoTerminal(String term,
int cols,
int rows,
int width,
int height,
byte[] encoded)
The client requested that a pty (pseudo terminal) is allocated for the session |
protected void |
changeWindowDimensions(int cols,
int rows,
int width,
int height)
Change the dimensions of the terminal window. |
protected boolean |
executeCommand(String cmd)
The user has requested the execution of a command. |
protected void |
onChannelClosed()
The channel has been closed. |
protected void |
onLocalEOF()
The local side has sent an EOF message. |
protected void |
onSessionOpen()
The session has now been opened. |
protected void |
processSignal(String signal)
Process a signal sent by the client. |
protected void |
processStderrData(byte[] data)
Process stderr data. |
protected void |
processStdinData(byte[] data)
Process stdin data. |
protected boolean |
setEnvironmentVariable(String name,
String value)
Set an environment variable |
protected boolean |
startShell()
The user has requested that the session start an interactive shell. |
| Methods inherited from class com.maverick.sshd.SessionChannel |
|---|
createChannel, evaluateWindowSpace, haltIncomingData, idle, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelOpenConfirmation, onChannelRequest, onExtendedData, onRemoteEOF, openChannel, resumeIncomingData, sendChannelDataWithBuffering, sendExitStatus, sendStderrData, sendStderrData, sendStdoutData, sendStdoutData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExampleSession()
| Method Detail |
|---|
protected void processStdinData(byte[] data)
processStdinData in class SessionChanneldata - protected void processStderrData(byte[] data)
data - protected void onChannelClosed()
onChannelClosed in class Channelprotected boolean executeCommand(String cmd)
executeCommand in class SessionChannelcmd -
protected void changeWindowDimensions(int cols,
int rows,
int width,
int height)
changeWindowDimensions in class SessionChannelcols - rows - width - height - protected void onSessionOpen()
executeCommand(java.lang.String) or startShell()
onSessionOpen in class SessionChannelprotected void onLocalEOF()
onLocalEOF in class Channelprotected boolean startShell()
startShell in class SessionChannel
protected boolean allocatePseudoTerminal(String term,
int cols,
int rows,
int width,
int height,
byte[] encoded)
allocatePseudoTerminal in class SessionChannelterm - the terminal typecols - the number of columns in charactersrows - the number of rows in characterswidth - the width in pixels (informational only)height - the heigh in pixels( informational only)encoded - encoded terminal modes
protected void processSignal(String signal)
processSignal in class SessionChannelsignal -
protected boolean setEnvironmentVariable(String name,
String value)
setEnvironmentVariable in class SessionChannelname - value -
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||