Package com.sun.jersey.api.client

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


        return rr;
    }

    public static RestResponse delete(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        ClientResponse cr = webResource.queryParams(buildMultivalueMap(payload))
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(RESPONSE_TYPE).delete(ClientResponse.class);
        checkStatusForSuccess(cr);
        return RestResponse.getRestResponse(cr);
    }
View Full Code Here


      MultivaluedMap<String, String> params = new MultivaluedMapImpl();
      for ( Map.Entry<String, String> paramEntry : options.getParams().entrySet() ) {
        params.putSingle( paramEntry.getKey(), paramEntry.getValue() );
      }

      viewPath = viewPath.queryParams( params );
    }

    return get( viewPath );
  }
View Full Code Here

                    }
                }
                if (debug) {
                    System.out.println("Command Sent " + command + " : "+ queryParams);
                }
                ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

                if (response.getStatus() >= 300) {
                    if (debug)
                        System.out.println("ElastiCenter returned error code : " + response.getStatus());
                    if (401 == response.getStatus()) {
View Full Code Here

        MultivaluedMap<String,String> queryParams = new MultivaluedMapImpl();
        queryParams.add("term", search);
        queryParams.add("media", MEDIA);
        queryParams.add("limit", Integer.toString(LIMIT));
        queryParams.add("output", "json");
        webResource = webResource.queryParams(queryParams);

        ClientResponse response = webResource.accept("text/plain").get(ClientResponse.class);
        logger.info("HTTP response status: "+response.getStatus());

        InputStream is = response.getEntityInputStream();
View Full Code Here

      MultivaluedMap<String, String> params = new MultivaluedMapImpl();
      for ( Map.Entry<String, String> paramEntry : options.getParams().entrySet() ) {
        params.putSingle( paramEntry.getKey(), paramEntry.getValue() );
      }

      viewPath = viewPath.queryParams( params );
    }

    return get( viewPath );
  }
View Full Code Here

      MultivaluedMap<String, String> params = new MultivaluedMapImpl();
      for ( Map.Entry<String, String> paramEntry : options.getParams().entrySet() ) {
        params.putSingle( paramEntry.getKey(), paramEntry.getValue() );
      }

      viewPath = viewPath.queryParams( params );
    }

    return get( viewPath );
  }
View Full Code Here

        ResourceFactory resourceFactory, ErrorDeserialiser<?> errorDeserialiser,
        String... pathElements) throws CreateSendException {
        WebResource resource = resourceFactory.getResource(client, pathElements);
       
        if(queryString != null) {
            resource = resource.queryParams(queryString);
        }
       
        try {
            return fixStringResult(klass, resource.get(klass));
        } catch (UniformInterfaceException ue) {
View Full Code Here

       
        addPagingParams(queryString, page, pageSize, orderField, orderDirection);
       
        try {
            if(queryString != null) {
                resource = resource.queryParams(queryString);
            }
           
            return resource.get(new GenericType<PagedResult<T>>(getGenericReturnType()));
        } catch (UniformInterfaceException ue) {
            throw handleErrorResponse(ue, defaultDeserialiser);
View Full Code Here

    private void put(Object entity, MultivaluedMap<String, String> queryString, ErrorDeserialiser<?> errorDeserialiser,
        String... pathElements) throws CreateSendException {
        WebResource resource = authorisedResourceFactory.getResource(client, pathElements);
       
        if(queryString != null) {
            resource = resource.queryParams(queryString);
        }
       
        try {
            resource.
                type(MediaType.APPLICATION_JSON_TYPE).
View Full Code Here

    @Override
  public void delete(MultivaluedMap<String, String> queryString, String... pathElements) throws CreateSendException {
        WebResource resource = authorisedResourceFactory.getResource(client, pathElements);
       
        if( queryString != null )
          resource = resource.queryParams(queryString);
       
        try {
            resource.delete();
        } catch (UniformInterfaceException ue) {
            throw handleErrorResponse(ue, defaultDeserialiser);
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.