Examples of cookie()


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

    public static RestResponse get(String address, Map<String, Object> payload) {
        if (address.startsWith("/")) {
            address = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("REST_URL") + address;
        }
        WebResource webResource = JERSEY_CLIENT.resource(address).queryParams(buildMultivalueMap(payload));
        ClientResponse resp = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(RESPONSE_TYPE).get(ClientResponse.class);
        return RestResponse.getRestResponse(resp);
    }
View Full Code Here

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

    }

    public static RestResponse post(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).post(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

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

    }

    public static RestResponse put(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).put(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

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

        return RestResponse.getRestResponse(cr);
    }

    public static RestResponse options(String address, String responseType) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(responseType).options(ClientResponse.class);
        checkStatusForSuccess(cr);
        return RestResponse.getRestResponse(cr);
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

                .outbound(new RestPayloadImpl.Outbound(false))
                .managedJob()
                .parameters(params);
        ResponseBuilder rb = Response.status(HttpURLConnection.HTTP_OK);
        if ( isSingleInstanceCommand(model)) {
            rb.cookie(getJSessionCookie(jSessionId));
        }
        rb.entity(SseCommandHelper.invokeAsync(commandInvocation, null));
        return rb.build();
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

        } else {
            rb.type(MediaType.APPLICATION_JSON_TYPE);
            rb.entity(ar);
        }
        if ( isSingleInstanceCommand(model)) {
            rb.cookie(getJSessionCookie(jSessionId));
        }
        return rb.build();
    }

    /** Some ActionReporters has special logic which must be reflected here
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

              .getAdminCookieMaxageMinutes();
          NewCookie cookieUsername = new NewCookie("username", admin
              .getUsername(), null, null, null, maxAge, false);
          NewCookie cookiePassword = new NewCookie("password", admin
              .getPassword(), null, null, null, maxAge, false);
          rb.cookie(cookieUsername, cookiePassword);
        }
      }

      result = rb.build();
    } catch (Exception ex) {
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

    @PUT
    @Produces("text/plain")
    public Response setCookies() {
        ResponseBuilder rb = Response.ok();
        rb.cookie(new NewCookie("name", "value", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment", 10, false));
        rb.cookie(new NewCookie("name2", "value2", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
        rb.cookie(new NewCookie("name3", "value3", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

    @Produces("text/plain")
    public Response setCookies() {
        ResponseBuilder rb = Response.ok();
        rb.cookie(new NewCookie("name", "value", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment", 10, false));
        rb.cookie(new NewCookie("name2", "value2", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
        rb.cookie(new NewCookie("name3", "value3", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
        return rb.build();
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cookie()

        ResponseBuilder rb = Response.ok();
        rb.cookie(new NewCookie("name", "value", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment", 10, false));
        rb.cookie(new NewCookie("name2", "value2", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
        rb.cookie(new NewCookie("name3", "value3", uri.getBaseUri().getPath() + uri.getPath(), uri
            .getBaseUri().getHost().toLowerCase(), "comment2", 10, false));
        return rb.build();
    }

    @CookieParam("name3")
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.