Package com.linkedin.r2.filter.message.rpc

Examples of com.linkedin.r2.filter.message.rpc.RpcRequestFilter


            requestBuilder = setCommonRequestHeader(requestBuilder);

            RestRequest request = requestBuilder.build();
            Future<RestResponse> future = client.restRequest(request);
            // This will block
            RestResponse response = future.get();
            final ByteString entity = response.getEntity();
            if(entity == null) {
                if(logger.isDebugEnabled()) {
                    logger.debug("Empty response !");
                }
                responseMessage = "Received empty response from " + coordinatorUrl;
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
                                    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

  private void sendByteArrayAsResponse(Callback<RestResponse> callback,
                                    byte[] responseBytes,
                                    String mediaType)
  {
    RestResponse staticContentResponse = new RestResponseBuilder().
                                          setStatus(HttpStatus.S_200_OK.getCode()).
                                          setHeader(RestConstants.HEADER_CONTENT_TYPE, mediaType).
                                          setEntity(responseBytes).
                                          build();
    callback.onSuccess(staticContentResponse);
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

  private void sendByteArrayAsResponse(Callback<RestResponse> callback,
                                    byte[] responseBytes,
                                    String mediaType)
  {
    RestResponse staticContentResponse = new RestResponseBuilder().
                                          setStatus(HttpStatus.S_200_OK.getCode()).
                                          setHeader(RestConstants.HEADER_CONTENT_TYPE, mediaType).
                                          setEntity(responseBytes).
                                          build();
    callback.onSuccess(staticContentResponse);
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

  @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

TOP

Related Classes of com.linkedin.r2.filter.message.rpc.RpcRequestFilter

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.