Package com.google.greaze.definition

Examples of com.google.greaze.definition.UrlParams$Builder


    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    HeaderMap requestHeaders = requestHeadersBuilder.build();
    UrlParamsSpec urlParamsSpec = callSpec.getRequestSpec().getUrlParamsSpec();
    UrlParams urlParams = new UrlParams.Builder(urlParamsSpec).build();
    RestRequestBase<I, R> request = new RestRequestBase<I, R>(
        HttpMethod.GET, requestHeaders, urlParams, resourceId, null, resourceType, inlined);
    RestResponseBase<I, R> response = stub.getResponse(callSpec, request, gson);
    return response.getResource();
  }
View Full Code Here


    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    HeaderMap requestHeaders = requestHeadersBuilder.build();
    UrlParamsSpec urlParamsSpec = callSpec.getRequestSpec().getUrlParamsSpec();
    UrlParams urlParams = new UrlParams.Builder(urlParamsSpec).build();
    RestRequestBase<I, R> request = new RestRequestBase<I, R>(
        HttpMethod.POST, requestHeaders, urlParams, resource.getId(), resource, resourceType, inlined);
    RestResponseBase<I, R> response = stub.getResponse(callSpec, request, gson);
    return response.getResource();
  }
View Full Code Here

    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    HeaderMap requestHeaders = requestHeadersBuilder.build();
    UrlParamsSpec urlParamsSpec = callSpec.getRequestSpec().getUrlParamsSpec();
    UrlParams urlParams = new UrlParams.Builder(urlParamsSpec).build();
    RestRequestBase<I, R> request = new RestRequestBase<I, R>(
        HttpMethod.PUT, requestHeaders, urlParams, resource.getId(), resource, resourceType, inlined);
    RestResponseBase<I, R> response = stub.getResponse(callSpec, request, gson);
    return response.getResource();
  }
View Full Code Here

    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    HeaderMap requestHeaders = requestHeadersBuilder.build();
    UrlParamsSpec urlParamsSpec = callSpec.getRequestSpec().getUrlParamsSpec();
    UrlParams urlParams = new UrlParams.Builder(urlParamsSpec).build();
    RestRequestBase<I, R> request = new RestRequestBase<I, R>(
        HttpMethod.DELETE, requestHeaders, urlParams, resourceId, null, resourceType, inlined);
    stub.getResponse(callSpec, request, gson);
  }
View Full Code Here

    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    RequestBody requestBody = new RequestBody.Builder(requestSpec.getBodySpec())
      .build();
    UrlParams urlParams = new UrlParams.Builder(requestSpec.getUrlParamsSpec(), query).build();
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeadersBuilder.build(), urlParams, requestBody, inlined);
    WebServiceResponse response = stub.getResponse(callSpec, request, gson);
    ResponseBody body = response.getBody();
    // Using a local variable for listBody otherwise Maven freaks out while compiling
View Full Code Here

    Gson gson = spec.addTypeAdapters(new GsonBuilder()).create();
   
  HeaderMap requestHeaders = new HeaderMap.Builder(spec.getRequestSpec().getHeadersSpec())
      .put(TypedKeys.Request.AUTH_TOKEN, authToken)
      .build();
  UrlParams urlParams = new UrlParams.Builder(spec.getRequestSpec().getUrlParamsSpec())
      .build();
  RequestBody requestBody = new RequestBody.Builder(spec.getRequestSpec().getBodySpec())
      .put(TypedKeys.RequestBody.CART, cart)
      .build();
  WebServiceRequest request = new WebServiceRequest(
View Full Code Here

      .build();
    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec)
      .put("X-Name", "bob")
      .put("X-Salary", 10000)
      .build();
    UrlParams urlParams = null;
    RequestBody requestBody = null;
    RequestSpec requestSpec = null;
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeaders, urlParams, requestBody, requestSpec, false);
    HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
View Full Code Here

      .put("X-Number", ComplexNumber.class)
      .build();
    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec)
      .put("X-Number", new ComplexNumber(10, 3))
      .build();
    UrlParams urlParams = null;
    RequestBody requestBody = null;
    RequestSpec requestSpec = null;
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeaders, urlParams, requestBody, requestSpec, false);
    HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
View Full Code Here

    requestBody = new RequestBody.Builder(requestBodySpec).build();
  }

  public void testNoUrlParams() {
    UrlParamsSpec urlParamsSpec = new UrlParamsSpec.Builder().build();
    UrlParams urlParams = new UrlParams.Builder(urlParamsSpec).build();
    WebServiceRequest request =
      new WebServiceRequest(HttpMethod.GET, requestHeaders, urlParams, requestBody, false);
    URL url = client.getWebServiceUrl(callSpec, request, gson);
    assertEquals(SERVER_URL + CALL_PATH, url.toExternalForm());
  }
View Full Code Here

    assertEquals(SERVER_URL + CALL_PATH, url.toExternalForm());
  }

  public void testOneUrlParam() {
    UrlParamsSpec urlParamSpec = new UrlParamsSpec.Builder().put("foo", String.class).build();
    UrlParams urlParams = new UrlParams.Builder(urlParamSpec)
      .put("foo", "bar bar")
      .build();
    WebServiceRequest request =
      new WebServiceRequest(HttpMethod.GET, requestHeaders, urlParams, requestBody, false);
    URL url = client.getWebServiceUrl(callSpec, request, gson);
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.UrlParams$Builder

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.