Package com.linkedin.r2.message.rpc

Examples of com.linkedin.r2.message.rpc.RpcRequestBuilder


      headers.putAll(getHeaders());
    }
    headers.put(errorHeaderName, "true");
    headers.put(RestConstants.HEADER_RESTLI_PROTOCOL_VERSION, protocolVersion.toString());

    RestResponse restResponse = new RestResponseBuilder()
        .setEntity(entity)
        .setStatus(status)
        .setHeaders(Collections.unmodifiableMap(headers))
        .build();
View Full Code Here


        .setStatus(status)
        .setHeaders(getHeaders())
        .setProtocolVersion(getProtocolVersion())
        .build();

    RestResponse restResponse = new RestResponseBuilder()
        .setEntity(entity)
        .setStatus(status)
        .setHeaders(decodedResponse.getHeaders())
        .build();
View Full Code Here

                                    @Override
                                    public void handleRequest(RestRequest request,
                                                               RequestContext requestContext,
                                                               RequestExecutionCallback<RestResponse> callback)
                                    {
                                      RestResponse response = EasyMock.createMock(RestResponse.class);
                                      RequestExecutionReportBuilder executionReportBuilder =
                                         new RequestExecutionReportBuilder();
                                      JsonTraceCodec jsonTraceCodec = new JsonTraceCodec();
                                      Trace t = null;
View Full Code Here

      headers.putAll(getHeaders());
    }
    headers.put(errorHeaderName, "true");
    headers.put(RestConstants.HEADER_RESTLI_PROTOCOL_VERSION, protocolVersion.toString());

    RestResponse restResponse = new RestResponseBuilder()
        .setEntity(entity)
        .setStatus(status)
        .setHeaders(Collections.unmodifiableMap(headers))
        .build();
View Full Code Here

        .setStatus(status)
        .setHeaders(getHeaders())
        .setProtocolVersion(getProtocolVersion())
        .build();

    RestResponse restResponse = new RestResponseBuilder()
        .setEntity(entity)
        .setStatus(status)
        .setHeaders(decodedResponse.getHeaders())
        .build();
View Full Code Here

  @Override
  @Deprecated
  @SuppressWarnings("deprecation")
  public void echo(String msg, final Callback<String> callback)
  {
    final RpcRequest request = new RpcRequestBuilder(_uri)
            .setEntity(ByteString.copyString(msg, RpcEchoServer.CHARSET))
            .build();

    _client.rpcRequest(request, new CallbackAdapter<String, RpcResponse>(callback)
    {
View Full Code Here

    // check the rewrite
    assertEquals(wrappedClient.restRequest.getURI(),
                 URI.create("http://test.linkedin.com/test/getCube"));
    assertEquals(wrappedClient.restWireAttrs, restWireAttrs);

    RpcRequest rpcRequest = new RpcRequestBuilder(URI.create("d2://HistoryService/getCube")).build();
    Map<String, String> rpcWireAttrs = new HashMap<String, String>();
    TestTransportCallback<RpcResponse> rpcCallback =
        new TestTransportCallback<RpcResponse>();

    client.rpcRequest(rpcRequest, new RequestContext(), rpcWireAttrs, rpcCallback);
View Full Code Here

    assertFalse(restCallback.response.hasError());
    assertEquals(wrappedClient.restRequest, restRequest);
    assertEquals(wrappedClient.restWireAttrs, restWireAttrs);

    RpcRequest rpcRequest = new RpcRequestBuilder(uri).build();
    Map<String, String> rpcWireAttrs = new HashMap<String, String>();
    TestTransportCallback<RpcResponse> rpcCallback =
        new TestTransportCallback<RpcResponse>();

    client.rpcRequest(rpcRequest, new RequestContext(), rpcWireAttrs, rpcCallback);
View Full Code Here

    client.restRequest(restRequest, restCallback);

    assertNull(restCallback.e);
    assertNotNull(restCallback.t);

    RpcRequest rpcRequest = new RpcRequestBuilder(uri).build();
    TestCallback<RpcResponse> rpcCallback = new TestCallback<RpcResponse>();

    client.rpcRequest(rpcRequest, rpcCallback);

    assertNotNull(rpcCallback.e);
View Full Code Here

  @Test
  @SuppressWarnings("deprecation")
  public void testSimpleRpcReq() throws IOException
  {
    final RpcRequest expected = new RpcRequestBuilder(URI.create("http://localhost:1234"))
            .build();
    assertMsgEquals(expected, _serializer.readRpcRequest(getResource("simple-rpc-req.txt")));
  }
View Full Code Here

TOP

Related Classes of com.linkedin.r2.message.rpc.RpcRequestBuilder

Copyright © 2018 www.massapicom. 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.