public abstract class AbstractLinkHandler extends Object implements Runnable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractLinkHandler.LinkHandlerStatus |
Modifier and Type | Field and Description |
---|---|
protected SocketCipher |
cipher |
protected MessageReceiver |
communicator |
protected UUID |
currentSession |
protected InputStream |
in |
protected OutputStream |
out |
protected SessionManager |
refSM |
protected Socket |
socket |
protected AbstractLinkHandler.LinkHandlerStatus |
state |
Constructor and Description |
---|
AbstractLinkHandler(Socket socket,
MessageReceiver communicator,
SocketCipher cipher) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
afterRun()
The method is invoked after the main loop during which theh
loopRun() for cleaning up |
protected abstract boolean |
beforeRun()
The method is invoked before the main loop during which theh
loopRun() is executed |
protected void |
cleanUpSession() |
protected boolean |
connect() |
protected boolean |
disconnect() |
protected boolean |
handleGatewayProtocol(Message msg) |
protected abstract boolean |
handleSessionProtocol(Message msg) |
boolean |
isStopping() |
protected abstract boolean |
loopRun()
The actual action that is performed eveytime.
|
protected void |
manualCloseSocket() |
protected boolean |
reconnect() |
void |
run() |
void |
stop() |
protected final Socket socket
protected final InputStream in
protected final OutputStream out
protected UUID currentSession
protected final MessageReceiver communicator
protected AbstractLinkHandler.LinkHandlerStatus state
protected final SocketCipher cipher
protected final SessionManager refSM
public AbstractLinkHandler(Socket socket, MessageReceiver communicator, SocketCipher cipher)
protected abstract boolean beforeRun()
loopRun()
is executedprotected abstract boolean loopRun()
false
to stop the loopingprotected abstract boolean afterRun()
loopRun()
for cleaning upprotected boolean reconnect()
protected void cleanUpSession()
protected boolean connect()
protected boolean disconnect()
protected void manualCloseSocket()
protected boolean handleGatewayProtocol(Message msg)
protected abstract boolean handleSessionProtocol(Message msg)
public boolean isStopping()
public void stop()
Copyright © 2018 universAAL Consortium. All rights reserved.