Examples of RpcRequest


Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    /*
     * Create the requets.
     */
    private RpcRequest createRequest() {
        try {
            return new RpcRequest(getPayload(), vaadinRequest);
        } catch (JsonException e) {
            LOGGER.log(Level.SEVERE, "", e);

            Assert.assertTrue(false);
            return null;
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOnAndNoToken() {
        initTest(true, TokenType.MISSING);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isDefaultToken(rpcRequest));
        Assert.assertFalse(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOffAndNoToken() {
        initTest(false, TokenType.MISSING);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isDefaultToken(rpcRequest));
        Assert.assertTrue(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOnAndInvalidToken() {
        initTest(true, TokenType.INVALID);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isInvalidToken(rpcRequest));
        Assert.assertFalse(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOffAndInvalidToken() {
        initTest(false, TokenType.INVALID);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isInvalidToken(rpcRequest));
        Assert.assertTrue(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOnAndValidToken() {
        initTest(true, TokenType.VALID);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isValidToken(rpcRequest));
        Assert.assertTrue(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of com.vaadin.server.communication.ServerRpcHandler.RpcRequest

    @Test
    public void securityOffAndValidToken() {
        initTest(false, TokenType.VALID);

        RpcRequest rpcRequest = createRequest();

        Assert.assertTrue(isValidToken(rpcRequest));
        Assert.assertTrue(isRequestValid(rpcRequest));
    }
View Full Code Here

Examples of hudson.remoting.RemoteInvocationHandler.RPCRequest

        ObjectInputStream ois = new ObjectInputStream(fin);
        for (int n=0; ; n++) {
            Command o = (Command)ois.readObject();
            System.out.println("#"+n+" : "+o);
            if (o instanceof RPCRequest) {
                RPCRequest request = (RPCRequest) o;
                System.out.print("  (");
                boolean first=true;
                for (Object argument : request.getArguments()) {
                    if(first)   first=false;
                    else        System.out.print(",");
                    System.out.print(argument);
                }
                System.out.println(")");
View Full Code Here

Examples of org.apache.spark.network.protocol.RpcRequest

  }

  @Test
  public void requests() {
    testClientToServer(new ChunkFetchRequest(new StreamChunkId(1, 2)));
    testClientToServer(new RpcRequest(12345, new byte[0]));
    testClientToServer(new RpcRequest(12345, new byte[100]));
  }
View Full Code Here

Examples of org.apache.tajo.rpc.RpcProtos.RpcRequest

    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {
      final RpcRequest request = (RpcRequest) e.getMessage();

      String methodName = request.getMethodName();
      MethodDescriptor methodDescriptor =
          service.getDescriptorForType().findMethodByName(methodName);

      if (methodDescriptor == null) {
        throw new RemoteCallException(request.getId(),
            new NoSuchMethodException(methodName));
      }
      Message paramProto = null;
      if (request.hasRequestMessage()) {
        try {
          paramProto = service.getRequestPrototype(methodDescriptor)
              .newBuilderForType().mergeFrom(request.getRequestMessage()).
                  build();

        } catch (Throwable t) {
          throw new RemoteCallException(request.getId(), methodDescriptor, t);
        }
      }
      Message returnValue;
      RpcController controller = new NettyRpcController();

      try {
        returnValue = service.callBlockingMethod(methodDescriptor,
            controller, paramProto);
      } catch (Throwable t) {
        throw new RemoteCallException(request.getId(), methodDescriptor, t);
      }

      RpcResponse.Builder builder =
          RpcResponse.newBuilder().setId(request.getId());

      if (returnValue != null) {
        builder.setResponseMessage(returnValue.toByteString());
      }
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.