Package io.deephaven.envoysupport
Class WebSocketCommProxy
java.lang.Object
com.illumon.util.net.AbstractCommServer
io.deephaven.envoysupport.WebSocketCommProxy
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,CommServer
WebSocket-based implementation of CommServer, providing the basic wiring to map fishlib Commands through a websocket
pipe and back again.
This legacy form of IO requires http1.1 sockets, and has already been deleted in a future release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclasshandles incoming websocket binary payloads and dispatches them to the appropriate service via fishlib Commands -
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
ConstructorsConstructorDescriptionWebSocketCommProxy(@NotNull com.fishlib.io.logger.Logger log, @NotNull String name) Create a FishlibWebSocketProxy and do not start a web server.WebSocketCommProxy(@NotNull com.fishlib.io.logger.Logger log, @NotNull String name, int websocketPort, boolean startServer) Create a FishlibWebSocketProxy and also start a web server. -
Method Summary
Modifier and TypeMethodDescriptioncom.fishlib.base.log.LogOutputappend(com.fishlib.base.log.LogOutput logOutput) voidintgetPort()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) voidStart the instance server, if assigned.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
-
WebSocketCommProxy
public WebSocketCommProxy(@NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String name, int websocketPort, boolean startServer) Create a FishlibWebSocketProxy and also start a web server.- Parameters:
log- a logger for messagesname- the name of this serverwebsocketPort- the port to listen onstartServer- do not start the server if this is false. The caller will do it later.
-
WebSocketCommProxy
public WebSocketCommProxy(@NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String name) Create a FishlibWebSocketProxy and do not start a web server. This will be provided elsewhere.- Parameters:
log- a logger for messagesname- the name of this server
-
-
Method Details
-
startServer
public void startServer()Start the instance server, if assigned. -
disconnect
- Specified by:
disconnectin interfaceCommServer- Overrides:
disconnectin classAbstractCommServer- Throws:
IOException
-
getPort
public int getPort() -
sendAsyncCommandWithResponse
public void sendAsyncCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command cmd, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) throws IOException - Throws:
IOException
-
sendCommandWithResponse
public com.fishlib.base.Command sendCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command command, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) throws IOException - Throws:
IOException
-
handleCommand
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput) -
getProxyWebSocketHandler
-