com.maverick.sshd
Class Subsystem

java.lang.Object
  extended by com.maverick.sshd.Subsystem
Direct Known Subclasses:
SftpSubsystem

public abstract class Subsystem
extends java.lang.Object

Defines the abstract attributes of an SSH Subsystem.

Author:
Lee David Painter

Field Summary
protected  SshContext context
           
protected  SessionChannel session
           
 
Constructor Summary
Subsystem(java.lang.String name)
           
 
Method Summary
protected  void init(SessionChannel session, SshContext context)
          Initialize the subsystem with the current session and configuration.
protected abstract  void onMessageReceived(byte[] msg)
          Called when a subsystem message has been extracted from the incoming data stream.
protected abstract  void onSubsystemFree()
          The subsystem has been closed and all resources should be freed.
protected  void processMessage(byte[] data)
          Process channel data and transform into a subsystem message when enough data has arrived.
protected  void sendMessage(Packet packet)
          Send a subsystem message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected SessionChannel session

context

protected SshContext context
Constructor Detail

Subsystem

public Subsystem(java.lang.String name)
Method Detail

init

protected void init(SessionChannel session,
                    SshContext context)
             throws java.io.IOException
Initialize the subsystem with the current session and configuration.

Parameters:
session -
context -
Throws:
java.io.IOException

processMessage

protected void processMessage(byte[] data)
                       throws java.io.IOException
Process channel data and transform into a subsystem message when enough data has arrived.

Parameters:
data -
Throws:
java.io.IOException

onSubsystemFree

protected abstract void onSubsystemFree()
The subsystem has been closed and all resources should be freed.


onMessageReceived

protected abstract void onMessageReceived(byte[] msg)
                                   throws java.io.IOException
Called when a subsystem message has been extracted from the incoming data stream.

Parameters:
msg -
Throws:
java.io.IOException

sendMessage

protected void sendMessage(Packet packet)
Send a subsystem message. NOTE: you do not have to prefix the message with its length as this operation is performed inside this method.

Parameters:
msg -


Copyright © 2003-2004 3SP LTD. All Rights Reserved.