Package com.illumon.util.net
Class WSCommServer
java.lang.Object
com.illumon.util.net.AbstractCommServer
com.illumon.util.net.WSCommServer
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,CommServer
WebSocket-based implementation of CommServer, providing the basic wiring to map gwt-rpc websocket messages to
fishlib Commands and back again. Nearly any case where a CommServer is expected, this class should suffice, with
only a very few differences:
- Since there is no fishlib port, getPort throws an exception - getHttpPort should be used instead
- handleCommand is currently unimplemented, to avoid the risk of being sent a non-websocket ClientEntry
- sendCommandWithResponse and sendAsyncCommandWithResponse are not yet implemented
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.illumon.util.net.AbstractCommServer
log, nameFields inherited from interface io.deephaven.enterprise.comm.api.CommServer
IGNORE_CACHE_CLIENTS, ONLY_CACHE_CLIENTS, SEND_TO_ALL -
Constructor Summary
ConstructorsConstructorDescriptionWSCommServer(com.fishlib.configuration.Configuration configuration, String name, com.fishlib.io.logger.Logger log, RpcSocketFactory clientFactoryFunction, int port, @Nullable Function<org.eclipse.jetty.ee10.servlet.ServletContextHandler, org.eclipse.jetty.server.Handler> contextConsumer, String commPath, Supplier<? extends WebSocketServer.WebsocketMarker> commServerEndpointFactory) -
Method Summary
Modifier and TypeMethodDescriptioncom.fishlib.base.log.LogOutputappend(com.fishlib.base.log.LogOutput logOutput) voidintstatic StringgetKeystorePassphrase(com.fishlib.configuration.Configuration configuration) Get the passphrase.static StringgetKeyStorePath(com.fishlib.configuration.Configuration configuration) Get the keystore path.intgetPort()voidhandleCommand(ClientEntry client, com.fishlib.base.Command cmd) voidsendAsyncCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command cmd, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) com.fishlib.base.CommandsendCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command command, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) Methods inherited from class com.illumon.util.net.AbstractCommServer
addClientEntry, addCommandHandler, getClients, getClientSet, getHandler, getName, putHandler, removeClientEntry, removeCommandHandler, sendCommand, sendCommand, sendCommand, TEST_SOCKET_CLOSEMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.enterprise.comm.api.CommServer
sendCommand, sendCommandWithResponse, sendCommandWithResponse
-
Constructor Details
-
WSCommServer
public WSCommServer(com.fishlib.configuration.Configuration configuration, String name, com.fishlib.io.logger.Logger log, RpcSocketFactory clientFactoryFunction, int port, @Nullable @Nullable Function<org.eclipse.jetty.ee10.servlet.ServletContextHandler, org.eclipse.jetty.server.Handler> contextConsumer, String commPath, Supplier<? extends WebSocketServer.WebsocketMarker> commServerEndpointFactory)
-
-
Method Details
-
getKeyStorePath
Get the keystore path.- Parameters:
configuration- the Configuration instance to use- Returns:
- the keystore path
-
getKeystorePassphrase
Get the passphrase.- Parameters:
configuration- the Configuration instance to use- Returns:
- the passphrase
-
getPort
public int getPort() -
getHttpPort
public int getHttpPort() -
sendAsyncCommandWithResponse
public void sendAsyncCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command cmd, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) -
sendCommandWithResponse
public com.fishlib.base.Command sendCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command command, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) -
disconnect
- Specified by:
disconnectin interfaceCommServer- Overrides:
disconnectin classAbstractCommServer- Throws:
IOException
-
handleCommand
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput)
-