public abstract class DefaultClientController<T extends CallerData> extends AbstractClientController<T> implements CommandParserListener
| Modifier and Type | Class and Description |
|---|---|
class |
DefaultClientController.ForwardingEventListener |
| Modifier and Type | Field and Description |
|---|---|
protected long |
discardedEventsCount |
protected boolean |
json |
static int |
KEEP_ALIVE_PERIOD |
protected KnownFormatCollector |
knownFormatCollector |
| Constructor and Description |
|---|
DefaultClientController(BlockingChannel dataChannel,
ContextManager contextManager,
java.util.concurrent.ExecutorService commandExecutionService,
FormatCache formatCache,
DataTableRegistry globalDataTableRegistry,
int pendingEventsQueueCapacity) |
DefaultClientController(BlockingChannel dataChannel,
ContextManager contextManager,
java.util.concurrent.ExecutorService commandExecutionService,
FormatCache formatCache,
DataTableRegistry globalDataTableRegistry,
int pendingEventsQueueCapacity,
boolean json,
boolean keepAliveDisabled) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCustomListeners(Context con) |
protected boolean |
addNormalListener(java.lang.String context,
java.lang.String name,
ContextEventListener cel) |
protected DataTable |
callFunction(Context con,
java.lang.String name,
DataTable parameters) |
OutgoingAggreGateCommand |
constructEventCommand(Event event,
java.lang.Integer listenerCode) |
abstract boolean |
controllerShouldHandle(Event ev,
ContextEventListener listener) |
protected ClassicEncodingSettings |
createClassicEncodingSettings(boolean useFormatCache) |
ContextEventListener |
createListener(java.lang.Integer listenerHashCode,
Expression filter,
java.lang.String fingerprint) |
protected void |
discardEvent() |
java.lang.String |
getAddress() |
protected Context |
getContext(java.lang.String path) |
ContextEventListener |
getDefaultEventListener() |
long |
getDiscardedEventsCount() |
protected java.lang.String |
getErrorDetails(java.lang.Throwable error) |
protected FunctionDefinition |
getFunctionDefinition(Context con,
java.lang.String name) |
java.lang.Long |
getLastDataTimestamp() |
int |
getPendingEventsCount() |
long |
getStartMessageCount() |
protected DataTable |
getVariable(Context con,
java.lang.String name) |
protected VariableDefinition |
getVariableDefinition(Context con,
java.lang.String name) |
boolean |
isConnected() |
boolean |
isJson() |
protected void |
logoutUser() |
void |
newDataReceived() |
OutgoingAggreGateCommand |
processCommand(IncomingAggreGateCommand cmd) |
protected OutgoingAggreGateCommand |
processMessage(IncomingAggreGateCommand cmd,
OutgoingAggreGateCommand ans) |
protected OutgoingAggreGateCommand |
processMessageOperation(IncomingAggreGateCommand cmd,
OutgoingAggreGateCommand ans) |
OutgoingAggreGateCommand |
processMessageStart(IncomingAggreGateCommand cmd,
OutgoingAggreGateCommand ans) |
void |
processOperationAddEventListener(java.lang.String id,
java.lang.String context,
java.lang.String name,
java.lang.Integer listener,
java.lang.String filter,
java.lang.String fingerprint,
OutgoingAggreGateCommand ans) |
OutgoingAggreGateCommand |
processOperationCallFunction(java.lang.String id,
Context con,
java.lang.String name,
java.lang.String encodedParameters,
java.lang.String flags,
OutgoingAggreGateCommand ans) |
void |
processOperationGetVar(java.lang.String id,
Context con,
java.lang.String name,
OutgoingAggreGateCommand ans) |
void |
processOperationRemoveEventListener(java.lang.String id,
java.lang.String context,
java.lang.String name,
java.lang.Integer listenerHashCode,
java.lang.String filter,
java.lang.String fingerprint,
OutgoingAggreGateCommand ans) |
void |
processOperationSetVar(java.lang.String id,
Context con,
java.lang.String name,
java.lang.String encodedValue,
OutgoingAggreGateCommand ans) |
boolean |
run() |
void |
runImpl() |
static java.lang.String |
searchForCode(java.lang.Throwable ex) |
static java.lang.String |
searchForCode(java.lang.Throwable ex,
java.lang.String fallbackCode) |
void |
sendCommand(OutgoingAggreGateCommand cmd) |
void |
setFormatCache(FormatCache formatCache) |
void |
setKnownFormatCollector(KnownFormatCollector knownFormatCollector) |
protected void |
setVariable(Context con,
java.lang.String name,
DataTable value) |
void |
shutdown() |
addMaskListener, getCallerController, getContextManager, getEventListeners, removeMaskListener, setCallerController, setContextManagerpublic static final int KEEP_ALIVE_PERIOD
protected final boolean json
protected long discardedEventsCount
protected KnownFormatCollector knownFormatCollector
public DefaultClientController(BlockingChannel dataChannel, ContextManager contextManager, java.util.concurrent.ExecutorService commandExecutionService, FormatCache formatCache, DataTableRegistry globalDataTableRegistry, int pendingEventsQueueCapacity)
public DefaultClientController(BlockingChannel dataChannel, ContextManager contextManager, java.util.concurrent.ExecutorService commandExecutionService, FormatCache formatCache, DataTableRegistry globalDataTableRegistry, int pendingEventsQueueCapacity, boolean json, boolean keepAliveDisabled)
public static java.lang.String searchForCode(java.lang.Throwable ex)
public static java.lang.String searchForCode(java.lang.Throwable ex,
java.lang.String fallbackCode)
public void setKnownFormatCollector(KnownFormatCollector knownFormatCollector)
public void processOperationGetVar(java.lang.String id,
Context con,
java.lang.String name,
OutgoingAggreGateCommand ans)
throws ContextException
ContextExceptionprotected DataTable getVariable(Context con, java.lang.String name) throws ContextException
ContextExceptionpublic void processOperationSetVar(java.lang.String id,
Context con,
java.lang.String name,
java.lang.String encodedValue,
OutgoingAggreGateCommand ans)
throws ContextException
ContextExceptionprotected VariableDefinition getVariableDefinition(Context con, java.lang.String name)
protected void setVariable(Context con, java.lang.String name, DataTable value) throws ContextException
ContextExceptionpublic OutgoingAggreGateCommand processOperationCallFunction(java.lang.String id, Context con, java.lang.String name, java.lang.String encodedParameters, java.lang.String flags, OutgoingAggreGateCommand ans) throws ContextException
ContextExceptionprotected FunctionDefinition getFunctionDefinition(Context con, java.lang.String name)
protected DataTable callFunction(Context con, java.lang.String name, DataTable parameters) throws ContextException
ContextExceptionprotected boolean addNormalListener(java.lang.String context,
java.lang.String name,
ContextEventListener cel)
public void processOperationAddEventListener(java.lang.String id,
java.lang.String context,
java.lang.String name,
java.lang.Integer listener,
java.lang.String filter,
java.lang.String fingerprint,
OutgoingAggreGateCommand ans)
public void processOperationRemoveEventListener(java.lang.String id,
java.lang.String context,
java.lang.String name,
java.lang.Integer listenerHashCode,
java.lang.String filter,
java.lang.String fingerprint,
OutgoingAggreGateCommand ans)
public OutgoingAggreGateCommand processMessageStart(IncomingAggreGateCommand cmd, OutgoingAggreGateCommand ans)
protected OutgoingAggreGateCommand processMessageOperation(IncomingAggreGateCommand cmd, OutgoingAggreGateCommand ans) throws SyntaxErrorException, ContextException
SyntaxErrorExceptionContextExceptionprotected void addCustomListeners(Context con)
protected OutgoingAggreGateCommand processMessage(IncomingAggreGateCommand cmd, OutgoingAggreGateCommand ans) throws SyntaxErrorException, ContextException
SyntaxErrorExceptionContextExceptionpublic OutgoingAggreGateCommand processCommand(IncomingAggreGateCommand cmd)
public void shutdown()
shutdown in class AbstractClientController<T extends CallerData>protected void logoutUser()
throws ContextException
ContextExceptionpublic boolean run()
run in class AbstractClientController<T extends CallerData>public void runImpl()
throws java.io.IOException,
DisconnectionException,
SyntaxErrorException
java.io.IOExceptionDisconnectionExceptionSyntaxErrorExceptionprotected java.lang.String getErrorDetails(java.lang.Throwable error)
public void sendCommand(OutgoingAggreGateCommand cmd) throws DisconnectionException, java.io.IOException
DisconnectionExceptionjava.io.IOExceptionpublic ContextEventListener createListener(java.lang.Integer listenerHashCode, Expression filter, java.lang.String fingerprint)
protected Context getContext(java.lang.String path)
public abstract boolean controllerShouldHandle(Event ev, ContextEventListener listener) throws EventHandlingException
EventHandlingExceptionpublic int getPendingEventsCount()
public long getDiscardedEventsCount()
protected void discardEvent()
public ContextEventListener getDefaultEventListener()
protected ClassicEncodingSettings createClassicEncodingSettings(boolean useFormatCache)
public OutgoingAggreGateCommand constructEventCommand(Event event, java.lang.Integer listenerCode)
public void setFormatCache(FormatCache formatCache)
public boolean isConnected()
public java.lang.String getAddress()
public void newDataReceived()
newDataReceived in interface CommandParserListenerpublic long getStartMessageCount()
public java.lang.Long getLastDataTimestamp()
public boolean isJson()