@Test public void testCompleteMessage() throws IOException, OncRpcException { Xdr xdr = new XdrStreamBuilder().build(); Buffer b = toFragmentedBuffer(xdr, 1024); mockedContext.setMessage(b); assertEquals(INVOKE, tcpParser.handleRead(mockedContext).type()); }
@Override public NextAction handleRead(FilterChainContext ctx) throws IOException { Buffer messageBuffer = ctx.getMessage(); if (messageBuffer == null) { return ctx.getStopAction(); } if (!isAllFragmentsArrived(messageBuffer)) { return ctx.getStopAction(messageBuffer); } ctx.setMessage(assembleXdr(messageBuffer)); final Buffer reminder = messageBuffer.hasRemaining() ? messageBuffer.split(messageBuffer.position()) : null; return ctx.getInvokeAction(reminder); }
RpcMessageParserTCP extends BaseFilter { @Override public NextAction handleRead(FilterChainContext ctx) throws IOException { Buffer messageBuffer = ctx.getMessage(); if (messageBuffer == null) { return ctx.getStopAction(); } if (!isAllFragmentsArrived(messageBuffer)) { return ctx.getStopAction(messageBuffer); } ctx.setMessage(assembleXdr(messageBuffer)); final Buffer reminder = messageBuffer.hasRemaining() ? messageBuffer.split(messageBuffer.position()) : null; return ctx.getInvokeAction(reminder); } }
RpcMessageParserTCP extends BaseFilter { @Override public NextAction handleRead(FilterChainContext ctx) throws IOException { Buffer messageBuffer = ctx.getMessage(); if (messageBuffer == null) { return ctx.getStopAction(); } if (!isAllFragmentsArrived(messageBuffer)) { return ctx.getStopAction(messageBuffer); } ctx.setMessage(assembleXdr(messageBuffer)); final Buffer reminder = messageBuffer.hasRemaining() ? messageBuffer.split(messageBuffer.position()) : null; return ctx.getInvokeAction(reminder); }  }
RpcMessageParserTCP extends BaseFilter { @Override public NextAction handleRead(FilterChainContext ctx) throws IOException { Buffer messageBuffer = ctx.getMessage(); if (messageBuffer == null) { return ctx.getStopAction(); } if (!isAllFragmentsArrived(messageBuffer)) { return ctx.getStopAction(messageBuffer); } ctx.setMessage(assembleXdr(messageBuffer)); final Buffer reminder = messageBuffer.hasRemaining() ? messageBuffer.split(messageBuffer.position()) : null; return ctx.getInvokeAction(reminder); }  @Override NextAction handleRead(FilterChainContext ctx); @Override NextAction handleWrite(FilterChainContext ctx); }
RpcMessageParserTCP extends BaseFilter { @Override public NextAction handleRead(FilterChainContext ctx) throws IOException { Buffer messageBuffer = ctx.getMessage(); if (messageBuffer == null) { return ctx.getStopAction(); } if (!isAllFragmentsArrived(messageBuffer)) { return ctx.getStopAction(messageBuffer); } ctx.setMessage(assembleXdr(messageBuffer)); final Buffer reminder = messageBuffer.hasRemaining() ? messageBuffer.split(messageBuffer.position()) : null; return ctx.getInvokeAction(reminder); }  @Override NextAction handleRead(FilterChainContext ctx); @Override NextAction handleWrite(FilterChainContext ctx);  }