com.sshtools.daemon.subsystem
Class SubsystemServer

java.lang.Object
  extended by com.sshtools.daemon.subsystem.SubsystemServer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SftpSubsystemServer

public abstract class SubsystemServer
extends java.lang.Object
implements java.lang.Runnable

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

Field Summary
private  SubsystemInputStream in
           
private  SubsystemMessageStore incoming
           
private static org.apache.commons.logging.Log log
           
private  SubsystemOutputStream out
           
private  SubsystemMessageStore outgoing
           
protected  SessionChannelServer session
           
private  StartStopState state
           
private  SshThread thread
           
 
Constructor Summary
SubsystemServer()
          Creates a new SubsystemServer object.
 
Method Summary
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 StartStopState getState()
           
protected abstract  void onMessageReceived(SubsystemMessage msg)
           
protected  void registerMessage(int messageId, java.lang.Class implementor)
           
 void run()
           
protected  void sendMessage(SubsystemMessage msg)
           
 void setSession(SessionChannelServer session)
           
 void start()
           
 void stop()
           
 
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

incoming

private SubsystemMessageStore incoming

outgoing

private SubsystemMessageStore outgoing

in

private SubsystemInputStream in

out

private SubsystemOutputStream out

thread

private SshThread thread

state

private StartStopState state

session

protected SessionChannelServer session
Constructor Detail

SubsystemServer

public SubsystemServer()
Creates a new SubsystemServer object.

Method Detail

setSession

public void setSession(SessionChannelServer session)
Parameters:
session -

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns:
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns:
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable

start

public void start()

stop

public void stop()

getState

public StartStopState getState()
Returns:

onMessageReceived

protected abstract void onMessageReceived(SubsystemMessage msg)
Parameters:
msg -

registerMessage

protected void registerMessage(int messageId,
                               java.lang.Class implementor)
Parameters:
messageId -
implementor -

sendMessage

protected void sendMessage(SubsystemMessage msg)
Parameters:
msg -