public abstract class Subsystem<T extends SshContext> extends ExecutorOperationSupport<SshContext>
Modifier and Type | Field and Description |
---|---|
protected T |
context |
static Integer |
MESSAGES_INCOMING |
static Integer |
MESSAGES_OUTGOING |
protected Channel<T> |
session |
protected TransportProtocol<T> |
transport |
CALLBACKS, EVENTS
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup() |
protected abstract void |
cleanupSubsystem() |
protected void |
executeOperation(Runnable r) |
void |
free() |
SshContext |
getContext() |
boolean |
hasQueuedMesasges() |
void |
init(Channel<T> session,
T 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 |
parseMessage(byte[] data) |
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.
|
addTask, cleanupOperations, getOperationsCount
protected Channel<T extends SshContext> session
protected TransportProtocol<T extends SshContext> transport
protected T extends SshContext context
public static final Integer MESSAGES_OUTGOING
public static final Integer MESSAGES_INCOMING
public Subsystem(String name)
public SshContext getContext()
getContext
in class ExecutorOperationSupport<SshContext>
public void init(Channel<T> session, T context) throws IOException
session
- context
- IOException
protected void executeOperation(Runnable r)
protected void cleanup()
protected abstract void cleanupSubsystem()
public void processMessage(byte[] data) throws IOException
data
- IOException
protected void parseMessage(byte[] data) throws IOException
IOException
public void free()
protected abstract void onSubsystemFree()
protected abstract void onMessageReceived(byte[] msg) throws IOException
msg
- IOException
protected void sendMessage(Packet packet) throws IOException
msg
- IOException
public boolean hasQueuedMesasges()
Copyright © 2016. All rights reserved.