com.maverick.sshd
Class Subsystem

java.lang.Object
  extended by com.maverick.sshd.Subsystem
All Implemented Interfaces:
com.maverick.ssh.components.SshComponent
Direct Known Subclasses:
SftpSubsystem

public abstract class Subsystem
extends Object
implements com.maverick.ssh.components.SshComponent

Defines the abstract attributes of an SSH Subsystem.

Author:
Lee David Painter

Field Summary
protected  SshContext context
           
protected  SessionChannel session
           
 
Constructor Summary
Subsystem(String name)
           
 
Method Summary
 String getName()
           
 void init(SessionChannel session)
          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(com.maverick.ssh.common.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(String name)
Method Detail

getName

public String getName()
Specified by:
getName in interface com.maverick.ssh.components.SshComponent

init

public void init(SessionChannel session)
          throws IOException,
                 PermissionDeniedException
Initialize the subsystem with the current session and configuration.

Parameters:
session -
context -
Throws:
IOException
PermissionDeniedException

processMessage

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

Parameters:
data -
Throws:
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 IOException
Called when a subsystem message has been extracted from the incoming data stream.

Parameters:
msg -
Throws:
IOException

sendMessage

protected void sendMessage(com.maverick.ssh.common.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 © 2012. All Rights Reserved.