Package com.google.greaze.definition.rest

Examples of com.google.greaze.definition.rest.RestCallSpec


  }

  @RequestScoped
  @Provides
  public RestCallSpec getRestCallSpec(RestCallSpecMap restCallSpecMap, CallPath callPath) {
    RestCallSpec restCallSpec = restCallSpecMap.get(callPath);
    return restCallSpec.createCopy(callPath);
  }
View Full Code Here


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    this.employees = new RepositoryInMemory<Employee>();
    RestResponseBuilder<Employee> responseBuilder = new ResponseBuilderEmployee(employees);
    RestCallSpec employeeRestCallSpec =
      ResourceDepotBaseClient.generateRestCallSpec(RESOURCE_PATH, Employee.class, null);
    RestCallSpecMap restCallSpecMap = new RestCallSpecMap.Builder()
      .set(RESOURCE_PATH, employeeRestCallSpec)
      .build();
    ResponseBuilderMap responseBuilders = new ResponseBuilderMap.Builder()
View Full Code Here

    HeaderMapSpec contextHeaderSpec = new HeaderMapSpec.Builder()
      .put(HEADER1.getName(), String.class)
      .put(HEADER2.getName(), String.class)
      .build();
  WebContextSpec webContextSpec = new WebContextSpec(contextHeaderSpec);
    RestCallSpec callSpec =
      ResourceDepotBaseClient.generateRestCallSpec(resourcePath, Employee.class, webContextSpec);
    RestCallSpecMap restCallSpecMap = new RestCallSpecMap.Builder()
      .set(resourcePath, callSpec)
      .build();
    ResponseBuilderMap responseBuilders = new ResponseBuilderMap.Builder()
View Full Code Here

    this.injector = injector;
  }

  @SuppressWarnings({"rawtypes", "unchecked"})
  public void service(HttpServletResponse res) {
    RestCallSpec callSpec = injector.getInstance(RestCallSpec.class);
    Preconditions.checkNotNull(callSpec);
    Gson gson = injector.getInstance(Gson.class);
    RestRequestBase<?, ?> restRequest = injector.getInstance(RestRequestBase.class);
    RestResponseBase.Builder response = new RestResponseBase.Builder(callSpec.getResponseSpec());
    RestResponseBaseBuilder responseBuilder = injector.getInstance(RestResponseBaseBuilder.class);
    WebContext context = injector.getInstance(WebContext.class);
    responseBuilder.buildResponse(context, restRequest, response);
    RestResponseBase webServiceResponse = response.build();
    RestResponseSender responseSender = new RestResponseSender(gson);
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.rest.RestCallSpec

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.