Package com.sun.jersey.api.client

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


        LOG.info("STARTING " + getName());

        WebResource wr = znodesr.path(path).queryParam("dataformat", encoding)
            .queryParam("name", name);
        if (data == null) {
            wr = wr.queryParam("null", "true");
        }
        if (sequence) {
            wr = wr.queryParam("sequence", "true");
        }
View Full Code Here


            .queryParam("name", name);
        if (data == null) {
            wr = wr.queryParam("null", "true");
        }
        if (sequence) {
            wr = wr.queryParam("sequence", "true");
        }

        Builder builder = wr.accept(accept);

        ClientResponse cr;
View Full Code Here

        }
        //Параметры запроса
        if (querryParams != null) {
            for (Map.Entry<String, String> entry : querryParams.entrySet()) {
                if (entry.getValue() != null) {
                    currentResource = currentResource.queryParam(entry.getKey(), entry.getValue());
                }
            }
        }
        try {
            ClientResponse response;
View Full Code Here

    @Test
    public void testSayHello() {
        Client client = Client.create();
       
        WebResource r = client.resource("http://localhost:8484").path("/hello");
        ClientResponse cr = r.queryParam("name", "Loïc").get(ClientResponse.class);
        assertEquals(200, cr.getStatus());
        assertEquals("Hello Loïc!", cr.getEntity(String.class));

        r = client.resource("http://localhost:8484").path("/hello");
        cr = r.queryParam("name", "loic").get(ClientResponse.class);
View Full Code Here

        ClientResponse cr = r.queryParam("name", "Loïc").get(ClientResponse.class);
        assertEquals(200, cr.getStatus());
        assertEquals("Hello Loïc!", cr.getEntity(String.class));

        r = client.resource("http://localhost:8484").path("/hello");
        cr = r.queryParam("name", "loic").get(ClientResponse.class);
        assertEquals(401, cr.getStatus());
        assertEquals("Access is denied", cr.getEntity(String.class));
    }
}
View Full Code Here

                                     String entityName, String colo) throws FalconCLIException {

        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

    private String sendEntityRequestWithObject(Entities entities, String entityType,
                                               Object requestObject, String colo) throws FalconCLIException {
        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);
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)
View Full Code Here

        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

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.