Examples of RestResponse


Examples of com.linkedin.r2.message.rest.RestResponse

            requestBuilder.setHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS, timeoutStr);
            requestBuilder = setCommonRequestHeader(requestBuilder);
            RestRequest request = requestBuilder.build();
            Future<RestResponse> future = client.restRequest(request);
            // This will block
            RestResponse response = future.get();
            ByteString entity = response.getEntity();
            return entity.asString("UTF-8");
        } catch(Exception e) {
            if(e.getCause() instanceof RestException) {
                return ((RestException) e.getCause()).getResponse().getEntity().asString("UTF-8");
            }
View Full Code Here

Examples of com.linkedin.r2.message.rest.RestResponse

            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

Examples of com.linkedin.r2.message.rest.RestResponse

            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

Examples of com.linkedin.r2.message.rest.RestResponse

      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

Examples of com.linkedin.r2.message.rest.RestResponse

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

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

Examples of com.linkedin.r2.message.rest.RestResponse

                                    @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

Examples of com.openshift.internal.client.response.RestResponse

*/
public abstract class AbstractOpenShiftConnectionFactory {
 
  @SuppressWarnings("unchecked")
  protected IOpenShiftConnection getConnection(IRestService service, final String login, final String password) throws IOException, OpenShiftException {
    RestResponse response =
        (RestResponse) service.request(new Link("Get API", "/api", HttpMethod.GET));
    return new APIResource(login, password, service, (Map<String, Link>) response.getData());
  }
View Full Code Here

Examples of com.openshift.internal.client.response.RestResponse

        } catch (UnauthorizedException e) {
            throw new InvalidCredentialsOpenShiftException(url, e, getRestResponse(e));
        } catch (NotFoundException e) {
            throw new NotFoundOpenShiftException(url, e, getRestResponse(e));
        } catch (HttpClientException e) {
          RestResponse restResponse = getRestResponse(e);
          String message = getMessage(restResponse, e);
      throw new OpenShiftEndpointException(
          url.toString(), e, restResponse, "Could not request {0}: {1}", url, message);
        } catch (SocketTimeoutException e) {
            throw new OpenShiftTimeoutException(url, e,
View Full Code Here

Examples of com.openshift.internal.client.response.RestResponse

*/
public abstract class AbstractOpenShiftConnectionFactory {
 
  @SuppressWarnings("unchecked")
  protected IOpenShiftConnection getConnection(IRestService service, final String login, final String password) throws IOException, OpenShiftException {
    RestResponse response =
        (RestResponse) service.request(
            new Link("Get API", "/api", HttpMethod.GET),
            IHttpClient.NO_TIMEOUT,
            Collections.<Parameter> emptyList(),
            Collections.<Parameter> emptyList());
    return new APIResource(login, password, service, (Map<String, Link>) response.getData());
  }
View Full Code Here

Examples of models.RestResponse

        }
    }

    public static Result show(Long id) {
        Logger.info("SHOW");
        RestResponse response = Community.findByID(id);
        if(response.modelObject instanceof Community) {
            Community community = (Community) response.modelObject;
            User user = new User();
            user = user.getUserFromSession(session());
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.