Examples of RequestMessage


Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

        this.serializer = serializer;
    }

    @Override
    protected void encode(final ChannelHandlerContext channelHandlerContext, final Object msg, final ByteBuf byteBuf) throws Exception {
        final RequestMessage requestMessage = (RequestMessage) msg;
        try {
            if (binaryEncoding) {
                byteBuf.writeBytes(serializer.serializeRequestAsBinary(requestMessage, channelHandlerContext.alloc()));
            } else {
                final MessageTextSerializer textSerializer = (MessageTextSerializer) serializer;
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

public class RequestMessageTest {

    @Test
    public void shouldOverrideRequest() {
        final UUID request = UUID.randomUUID();
        final RequestMessage msg = RequestMessage.build("op").overrideRequestId(request).create();
        assertEquals(request, msg.getRequestId());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

        assertEquals(request, msg.getRequestId());
    }

    @Test
    public void shouldSetProcessor() {
        final RequestMessage msg = RequestMessage.build("op").processor("ppp").create();
        assertEquals("ppp", msg.getProcessor());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

    public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) throws Exception {
        if (msg instanceof Pair) {
            try {
                final Pair pair = (Pair) msg;
                final Iterator itty = (Iterator) pair.getValue1();
                final RequestMessage requestMessage = (RequestMessage) pair.getValue0();

                // the batch size can be overriden by the request
                final int resultIterationBatchSize = (Integer) requestMessage.optionalArgs(Tokens.ARGS_BATCH_SIZE).orElse(settings.resultIterationBatchSize);

                // timer for the total serialization time
                final StopWatch stopWatch = new StopWatch();

                final EventExecutorGroup executorService = ctx.executor();
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

        assertEquals("ppp", msg.getProcessor());
    }

    @Test
    public void shouldSetOpWithDefaults() {
        final RequestMessage msg = RequestMessage.build("op").create();
        Assert.assertEquals("", msg.getProcessor());    // standard op processor
        assertNotNull(msg.getRequestId());
        assertEquals("op", msg.getOp());
        assertNotNull(msg.getArgs());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

        assertNotNull(msg.getArgs());
    }

    @Test
    public void shouldReturnEmptyOptionalArg() {
        final RequestMessage msg = RequestMessage.build("op").create();
        assertFalse(msg.optionalArgs("test").isPresent());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.driver.message.RequestMessage

        assertFalse(msg.optionalArgs("test").isPresent());
    }

    @Test
    public void shouldReturnArgAsOptional() {
        final RequestMessage msg = RequestMessage.build("op").add("test", "testing").create();
        assertEquals("testing", msg.optionalArgs("test").get());
    }
View Full Code Here

Examples of com.torrent4j.net.peerwire.messages.RequestMessage

    write(new HandshakeMessage(torrentHash, peerID));
  }

  @Override
  public void requestBlock(int pieceIndex, int start, int length) {
    write(new RequestMessage(pieceIndex, start, length));
  }
View Full Code Here

Examples of it.polito.appeal.traci.protocol.RequestMessage

    }
   
    if(queries.isEmpty())
      return;
   
    RequestMessage reqMsg = new RequestMessage();
    for (Query q : queries) {
      for (Command req : q.getRequests()) {
        reqMsg.append(req);
      }
    }
   
    reqMsg.writeTo(dos);
    ResponseMessage respMsg = new ResponseMessage(dis);
    Iterator<ResponseContainer> responseIterator = respMsg.responses().iterator();
    for (Query q : queries) {
      q.pickResponses(responseIterator);     
    }
View Full Code Here

Examples of net.sf.clairv.p2p.RequestMessage

          log.warn("Cannot deserialize the bytes to object");
          return;
        }
        if (enclosed instanceof RequestMessage) {
          // request message, see if we need to handle it
          RequestMessage requestMsg = (RequestMessage) enclosed;
          final RequestHandler handler = (RequestHandler) messageHandlers
              .get(requestMsg.getClass());
          if (handler != null) {
            final PastryRequest request = new PastryRequest();
            request.setContext(PastryNetwork.this.context);
            request.setMessage(requestMsg);
            request.setRemoteNodeId(wrapper.getSourceNodeId());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.