Package com.sshtools.common.ssh
Class Subsystem
java.lang.Object
com.sshtools.common.ssh.Subsystem
- Direct Known Subclasses:
PublicKeySubsystemServer,SftpSubsystem
Defines the abstract attributes of an SSH Subsystem.
- Author:
- Lee David Painter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Contextprotected SessionChannelstatic final Integerstatic final Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup()protected abstract voidprotected voidexecuteOperation(Integer messageQueue, ConnectionAwareTask r) voidfree()voidinit(SessionChannel session, Context context) Initialize the subsystem with the current session and configuration.voidonFreeMessage(byte[] msg) protected abstract voidonMessageReceived(byte[] msg) Called when a subsystem message has been extracted from the incoming data stream.protected abstract voidThe subsystem has been closed and all resources should be freed.protected voidparseMessage(ByteBuffer data) voidprocessMessage(ByteBuffer data) Process channel data and transform into a subsystem message when enough data has arrived.voidsendMessage(Packet packet) Send a subsystem message.
-
Field Details
-
SUBSYSTEM_INCOMING
-
SUBSYSTEM_OUTGOING
-
session
-
context
-
-
Constructor Details
-
Subsystem
-
-
Method Details
-
getContext
-
getConnection
-
getSession
-
init
public void init(SessionChannel session, Context context) throws IOException, PermissionDeniedException Initialize the subsystem with the current session and configuration.- Parameters:
session-context-- Throws:
IOExceptionPermissionDeniedException
-
executeOperation
-
cleanup
protected void cleanup() -
cleanupSubsystem
protected abstract void cleanupSubsystem() -
processMessage
Process channel data and transform into a subsystem message when enough data has arrived.- Parameters:
data-- Throws:
IOException
-
parseMessage
- Throws:
IOException
-
free
public void free() -
onSubsystemFree
protected abstract void onSubsystemFree()The subsystem has been closed and all resources should be freed. -
onMessageReceived
Called when a subsystem message has been extracted from the incoming data stream.- Parameters:
msg-- Throws:
IOException
-
sendMessage
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-- Throws:
IOException
-
onFreeMessage
public void onFreeMessage(byte[] msg)
-