@Test public void testWindow() throws IOException, InterruptedException { final BeatsFrame openFrame = new BeatsFrame.Builder() .version((byte) 0x31) .frameType((byte) 0x57) .seqNumber(-1) .payload(Integer.toString(1).getBytes()) .build(); final String sender = "sender1"; final CapturingChannelResponder responder = new CapturingChannelResponder(); frameHandler.handle(openFrame, responder, sender); Assert.assertEquals(0, responder.responded); }
public void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender) throws IOException, InterruptedException { final Map<String, String> metadata = EventFactoryUtil.createMapWithSender(sender.toString()); metadata.put(BeatsMetadata.SEQNUMBER_KEY, String.valueOf(frame.getSeqNumber())); String line = ""; if (frame.getFrameType() == FRAME_JSON ) { final E event = eventFactory.create(frame.getPayload(), metadata, responder); events.offer(event); } }
BeatsFrameHandler { public void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender) throws IOException, InterruptedException { final Map<String, String> metadata = EventFactoryUtil.createMapWithSender(sender.toString()); metadata.put(BeatsMetadata.SEQNUMBER_KEY, String.valueOf(frame.getSeqNumber())); String line = ""; if (frame.getFrameType() == FRAME_JSON ) { final E event = eventFactory.create(frame.getPayload(), metadata, responder); events.offer(event); } } }
BeatsFrameHandler { public void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender) throws IOException, InterruptedException { final Map<String, String> metadata = EventFactoryUtil.createMapWithSender(sender.toString()); metadata.put(BeatsMetadata.SEQNUMBER_KEY, String.valueOf(frame.getSeqNumber())); String line = ""; if (frame.getFrameType() == FRAME_JSON ) { final E event = eventFactory.create(frame.getPayload(), metadata, responder); events.offer(event); } } BeatsFrameHandler(final SelectionKey selectionKey,
                             final Charset charset,
                             final EventFactory<E> eventFactory,
                             final BlockingQueue<E> events,
                             final AsyncChannelDispatcher dispatcher,
                             final ComponentLog logger); }
BeatsFrameHandler { public void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender) throws IOException, InterruptedException { final Map<String, String> metadata = EventFactoryUtil.createMapWithSender(sender.toString()); metadata.put(BeatsMetadata.SEQNUMBER_KEY, String.valueOf(frame.getSeqNumber())); String line = ""; if (frame.getFrameType() == FRAME_JSON ) { final E event = eventFactory.create(frame.getPayload(), metadata, responder); events.offer(event); } } BeatsFrameHandler(final SelectionKey selectionKey,
                             final Charset charset,
                             final EventFactory<E> eventFactory,
                             final BlockingQueue<E> events,
                             final AsyncChannelDispatcher dispatcher,
                             final ComponentLog logger); void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender); }
BeatsFrameHandler { public void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender) throws IOException, InterruptedException { final Map<String, String> metadata = EventFactoryUtil.createMapWithSender(sender.toString()); metadata.put(BeatsMetadata.SEQNUMBER_KEY, String.valueOf(frame.getSeqNumber())); String line = ""; if (frame.getFrameType() == FRAME_JSON ) { final E event = eventFactory.create(frame.getPayload(), metadata, responder); events.offer(event); } } BeatsFrameHandler(final SelectionKey selectionKey,
                             final Charset charset,
                             final EventFactory<E> eventFactory,
                             final BlockingQueue<E> events,
                             final AsyncChannelDispatcher dispatcher,
                             final ComponentLog logger); void handle(final BeatsFrame frame, final ChannelResponder<SocketChannel> responder, final String sender); static final byte FRAME_WINDOWSIZE; }