@Test public void testReadRegularMessage() { OvsdbConnectionHandler heartBeatHandler = newOvsdbConnectionHandler(); JsonNode jsonNode = JsonNodeFactory.instance.objectNode(); ((ObjectNode) jsonNode).put("id", "123"); ((ObjectNode) jsonNode).put("method", "echo"); ((ObjectNode) jsonNode).putArray("params"); heartBeatHandler.channelRead(ctx, jsonNode); verify(ctx).fireChannelRead(jsonNode); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) { readIdleCount = 0; if (!isHeartbeatResponse((JsonNode) msg)) { ctx.fireChannelRead(msg); } else { LOGGER.debug("Received heartbeat response {}", msg); } }
OvsdbConnectionHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { readIdleCount = 0; if (!isHeartbeatResponse((JsonNode) msg)) { ctx.fireChannelRead(msg); } else { LOGGER.debug("Received heartbeat response {}", msg); } } }
OvsdbConnectionHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { readIdleCount = 0; if (!isHeartbeatResponse((JsonNode) msg)) { ctx.fireChannelRead(msg); } else { LOGGER.debug("Received heartbeat response {}", msg); } } OvsdbConnectionHandler(
      ConnectionCallback connectionCallback, ScheduledExecutorService executorService
  );   OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ScheduledExecutorService executorService
  ); private  OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ConnectionCallback connectionCallback,
      ScheduledExecutorService executorService
  ); }
OvsdbConnectionHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { readIdleCount = 0; if (!isHeartbeatResponse((JsonNode) msg)) { ctx.fireChannelRead(msg); } else { LOGGER.debug("Received heartbeat response {}", msg); } } OvsdbConnectionHandler(
      ConnectionCallback connectionCallback, ScheduledExecutorService executorService
  );   OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ScheduledExecutorService executorService
  ); private  OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ConnectionCallback connectionCallback,
      ScheduledExecutorService executorService
  ); @Override void channelActive(final ChannelHandlerContext ctx); @Override void channelRead(ChannelHandlerContext ctx, Object msg); @Override void channelInactive(ChannelHandlerContext ctx); @Override void userEventTriggered(ChannelHandlerContext ctx, Object evt); }
OvsdbConnectionHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { readIdleCount = 0; if (!isHeartbeatResponse((JsonNode) msg)) { ctx.fireChannelRead(msg); } else { LOGGER.debug("Received heartbeat response {}", msg); } } OvsdbConnectionHandler(
      ConnectionCallback connectionCallback, ScheduledExecutorService executorService
  );   OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ScheduledExecutorService executorService
  ); private  OvsdbConnectionHandler(
      CompletableFuture<OvsdbClient> ovsdbClientFuture, ConnectionCallback connectionCallback,
      ScheduledExecutorService executorService
  ); @Override void channelActive(final ChannelHandlerContext ctx); @Override void channelRead(ChannelHandlerContext ctx, Object msg); @Override void channelInactive(ChannelHandlerContext ctx); @Override void userEventTriggered(ChannelHandlerContext ctx, Object evt);  }