Package com.illumon.util.net
Class DelegatingCommServer
java.lang.Object
com.illumon.util.net.DelegatingCommServer
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,CommServer
Allows treating multiple CommServer instances as if they were one. Limitations:
If there is a "real" Server instance, it should be the first parameter, so that
some internal impl details like port are handled correctly. Other details like
handleCommand and addClientEntry can't be handled properly at all, and will
throw exceptions.
-
Field Summary
Fields inherited from interface io.deephaven.enterprise.comm.api.CommServer
IGNORE_CACHE_CLIENTS, ONLY_CACHE_CLIENTS, SEND_TO_ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientEntry(ClientEntry client) voidaddClientEntry(ClientEntry client, CommServer server) voidaddCommandHandler(String id, CommandHandler commandHandler) com.fishlib.base.log.LogOutputappend(com.fishlib.base.log.LogOutput logOutput) voidintgetPort()voidhandleCommand(ClientEntry client, com.fishlib.base.Command cmd) voidvoidsendAsyncCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command cmd, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) booleansendCommand(ClientEntry clientEntry, String id, com.fishlib.base.Command command, boolean allowFlush) voidsendCommand(String id, com.fishlib.base.Command command) voidsendCommand(String id, com.fishlib.base.Command command, int sendTo) com.fishlib.base.CommandsendCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command command, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) voidFor unit tests: throw out all connected clients, but don't shut down the server sockets.Methods 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
-
DelegatingCommServer
-
-
Method Details
-
getPort
public int getPort()- Specified by:
getPortin interfaceCommServer
-
sendCommand
- Specified by:
sendCommandin interfaceCommServer
-
sendCommand
- Specified by:
sendCommandin interfaceCommServer
-
sendCommand
public boolean sendCommand(ClientEntry clientEntry, String id, com.fishlib.base.Command command, boolean allowFlush) - Specified by:
sendCommandin interfaceCommServer
-
sendAsyncCommandWithResponse
public void sendAsyncCommandWithResponse(ClientEntry client, String serviceId, com.fishlib.base.Command cmd, AsyncCommandHandler handler, long timeoutMillis, boolean allowFlush) throws IOException - Specified by:
sendAsyncCommandWithResponsein interfaceCommServer- 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 - Specified by:
sendCommandWithResponsein interfaceCommServer- Throws:
IOException
-
getClientSet
- Specified by:
getClientSetin interfaceCommServer
-
addCommandHandler
- Specified by:
addCommandHandlerin interfaceCommServer
-
removeCommandHandler
- Specified by:
removeCommandHandlerin interfaceCommServer
-
disconnect
- Specified by:
disconnectin interfaceCommServer- Throws:
IOException
-
handleCommand
- Specified by:
handleCommandin interfaceCommServer
-
addClientEntry
- Specified by:
addClientEntryin interfaceCommServer
-
addClientEntry
-
TEST_SOCKET_CLOSE
Description copied from interface:CommServerFor unit tests: throw out all connected clients, but don't shut down the server sockets.- Specified by:
TEST_SOCKET_CLOSEin interfaceCommServer- Throws:
IOException
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput) - Specified by:
appendin interfacecom.fishlib.base.log.LogOutputAppendable
-