Package com.sun.jersey.api.client

Examples of com.sun.jersey.api.client.WebResource.queryParam()


  }

  protected BatchRequestResponse performApiGetRequest(String relativeUri, boolean queryAllFields) {
    WebResource webResource = ambariWebResource.path(relativeUri);
    if (queryAllFields) {
      webResource = webResource.queryParam("fields", "*");
    }
    ClientResponse response;
    try {
      response = webResource.get(ClientResponse.class);
    } catch (UniformInterfaceException e) {
View Full Code Here


        System.out.println("** Buy an iPhone for Bill Burke");
        System.out.println();
        System.out.println("** First see if Bill Burke exists as a customer");
        wr = c.resource(shoppingLinks.get("customers").getHref());
        Customers customers = wr.queryParam("firstName", "Bill").queryParam("lastName", "Burke").get(Customers.class);
        Customer customer = null;
        if (customers.getCustomers().size() > 0) {
            System.out.println("- Found a Bill Burke in the database, using that");
            customer = customers.getCustomers().iterator().next();
        } else {
View Full Code Here

        }

        System.out.println();
        System.out.println("Search for iPhone in the Product database");
        wr = c.resource(shoppingLinks.get("products").getHref());
        Products products = wr.queryParam("name", "iPhone").get(Products.class);
        Product product = null;
        if (products.getProducts().size() > 0) {
            System.out.println("- Found iPhone in the database.");
            product = products.getProducts().iterator().next();
        } else {
View Full Code Here

        System.out.println("** Buy an iPhone for Bill Burke");
        System.out.println();
        System.out.println("** First see if Bill Burke exists as a customer");
        wr = c.resource(shoppingLinks.get("customers").getHref());
        Customers customers = wr.queryParam("firstName", "Bill").queryParam("lastName", "Burke").get(Customers.class);
        Customer customer = null;
        if (customers.getCustomers().size() > 0) {
            System.out.println("- Found a Bill Burke in the database, using that");
            customer = customers.getCustomers().iterator().next();
        } else {
View Full Code Here

        }

        System.out.println();
        System.out.println("Search for iPhone in the Product database");
        wr = c.resource(shoppingLinks.get("products").getHref());
        Products products = wr.queryParam("name", "iPhone").get(Products.class);
        Product product = null;
        if (products.getProducts().size() > 0) {
            System.out.println("- Found iPhone in the database.");
            product = products.getProducts().iterator().next();
        } else {
View Full Code Here

      String entityName, String colo) throws IvoryCLIException {
   
    WebResource resource = service.path(entities.path)
        .path(entityType).path(entityName);
    if (colo != null) {
      resource = resource.queryParam("colo", colo);
    }
    ClientResponse clientResponse = resource.header(REMOTE_USER, USER)
        .accept(entities.mimeType).type(MediaType.TEXT_XML)
        .method(entities.method, ClientResponse.class);
View Full Code Here

      String entityType, Object requestObject, String colo) throws IvoryCLIException {
   
    WebResource resource = service.path(entities.path)
        .path(entityType);
    if (colo != null) {
      resource = resource.queryParam("colo", colo);
    }
    ClientResponse clientResponse = resource.header(REMOTE_USER, USER)
        .accept(entities.mimeType).type(MediaType.TEXT_XML)
        .method(entities.method, ClientResponse.class, requestObject);
View Full Code Here

  }

  public InstancesResult instanceCmd(Instances instances, String type, String name, String start, String end, String colo) {
        WebResource resource = service.path(instances.path).path(type).path(name);
        resource = resource.queryParam("start", start);
        if(end != null)
            resource = resource.queryParam("end", end);
        resource = resource.queryParam("colo", colo);
       
        return resource.header(REMOTE_USER, USER).accept(instances.mimeType).method(instances.method, InstancesResult.class);
View Full Code Here

  public InstancesResult instanceCmd(Instances instances, String type, String name, String start, String end, String colo) {
        WebResource resource = service.path(instances.path).path(type).path(name);
        resource = resource.queryParam("start", start);
        if(end != null)
            resource = resource.queryParam("end", end);
        resource = resource.queryParam("colo", colo);
       
        return resource.header(REMOTE_USER, USER).accept(instances.mimeType).method(instances.method, InstancesResult.class);
  }
 
View Full Code Here

  public InstancesResult instanceCmd(Instances instances, String type, String name, String start, String end, String colo) {
        WebResource resource = service.path(instances.path).path(type).path(name);
        resource = resource.queryParam("start", start);
        if(end != null)
            resource = resource.queryParam("end", end);
        resource = resource.queryParam("colo", colo);
       
        return resource.header(REMOTE_USER, USER).accept(instances.mimeType).method(instances.method, InstancesResult.class);
  }
 
  private String sendInstanceRequest(Instances instances, String type,
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.