public abstract class Subsystem
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Context |
context |
protected SessionChannel |
session |
static java.lang.Integer |
SUBSYSTEM_INCOMING |
static java.lang.Integer |
SUBSYSTEM_OUTGOING |
| Constructor and Description |
|---|
Subsystem(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup() |
protected abstract void |
cleanupSubsystem() |
protected void |
executeOperation(java.lang.Integer messageQueue,
ConnectionAwareTask r) |
void |
free() |
SshConnection |
getConnection() |
Context |
getContext() |
SessionChannel |
getSession() |
void |
init(SessionChannel session,
Context context)
Initialize the subsystem with the current session and configuration.
|
void |
onFreeMessage(byte[] msg) |
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 |
parseMessage(java.nio.ByteBuffer data) |
void |
processMessage(java.nio.ByteBuffer data)
Process channel data and transform into a subsystem message when enough
data has arrived.
|
void |
sendMessage(Packet packet)
Send a subsystem message.
|
public static final java.lang.Integer SUBSYSTEM_INCOMING
public static final java.lang.Integer SUBSYSTEM_OUTGOING
protected SessionChannel session
protected Context context
public Context getContext()
public SshConnection getConnection()
public SessionChannel getSession()
public void init(SessionChannel session, Context context) throws java.io.IOException, PermissionDeniedException
session - context - java.io.IOExceptionPermissionDeniedExceptionprotected void executeOperation(java.lang.Integer messageQueue,
ConnectionAwareTask r)
protected void cleanup()
protected abstract void cleanupSubsystem()
public void processMessage(java.nio.ByteBuffer data)
throws java.io.IOException
data - java.io.IOExceptionprotected void parseMessage(java.nio.ByteBuffer data)
throws java.io.IOException
java.io.IOExceptionpublic void free()
protected abstract void onSubsystemFree()
protected abstract void onMessageReceived(byte[] msg)
throws java.io.IOException
msg - java.io.IOExceptionpublic void sendMessage(Packet packet) throws java.io.IOException
msg - java.io.IOExceptionpublic void onFreeMessage(byte[] msg)
Copyright © 2022. All rights reserved.