Package com.google.greaze.definition.webservice

Examples of com.google.greaze.definition.webservice.ResponseBodySpec


 
  public WebServiceResponse receive(HttpURLConnection conn) {
    try {
      handleResponseCode(conn);
      HeaderMapSpec paramSpec = spec.getHeadersSpec();
      ResponseBodySpec bodySpec = spec.getBodySpec();
      // read response
      HeaderMap responseParams = readResponseHeaders(conn, paramSpec);
      ResponseBody responseBody = readResponseBody(conn, bodySpec);
      return new WebServiceResponse(responseParams, responseBody);
    } catch (IOException e) {
View Full Code Here


      (ResourceQueryParams) webServiceRequest.getUrlParameters().getParamsObject();
    WebContext context = new WebContextExtractor(webContextSpec).extract(webServiceRequest.getHeaders());
    List results = resourceQuery.query(queryParams, context);
    HeaderMapSpec headerSpec = new HeaderMapSpec.Builder().build();
    HeaderMap responseHeaders = new HeaderMap.Builder(headerSpec).build();
    ResponseBodySpec bodySpec = new ResponseBodySpec.Builder()
      .setListBody(resourceQuery.getResourceType())
      .build();
    ResponseBody responseBody = new ResponseBody.Builder(bodySpec)
      .setListBody(results)
      .build();
View Full Code Here

  public RestResponseBase(RestResponseSpec spec, HeaderMap responseHeaders, R resource) {
    super(spec, responseHeaders, createBody(resource, spec.getResourceType()));
  }
 
  private static<R> ResponseBody createBody(R resource, Type resourceType) {
    ResponseBodySpec spec = new ResponseBodySpec(ContentBodyType.SIMPLE, null, resourceType);
    return new ResponseBody.Builder(spec)
        .setSimpleBody(resource)
        .build();
  }
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.webservice.ResponseBodySpec

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.