/** * Adds not persistent cookie to the response. * Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie */ public void cookie(String name, String value) { cookie(name, value, -1, false); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured * @param httpOnly if true: cookie will be marked as http only */ public void cookie(String name, String value, int maxAge, boolean secured, boolean httpOnly) { cookie("", "", name, value, maxAge, secured, httpOnly); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured */ public void cookie(String name, String value, int maxAge, boolean secured) { cookie(name, value, maxAge, secured, false); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, * zero - deletes the cookie) */ public void cookie(String name, String value, int maxAge) { cookie(name, value, maxAge, false); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param path path of the cookie * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured */ public void cookie(String path, String name, String value, int maxAge, boolean secured) { cookie("", path, name, value, maxAge, secured, false); }
@Override public void cookie(String name, String value, int maxAge, boolean secured) { delegate.cookie(name, value, maxAge, secured); }
@Override public void cookie(String name, String value, int maxAge) { delegate.cookie(name, value, maxAge); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param path path of the cookie * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured * @param httpOnly if true: cookie will be marked as http only */ public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) { cookie("", path, name, value, maxAge, secured, httpOnly); }
@Override public void cookie(String name, String value) { delegate.cookie(name, value); }
@Override public void cookie(String path, String name, String value, int maxAge, boolean secured) { delegate.cookie(path, name, value, maxAge, secured); }
@Override public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) { delegate.cookie(path, name, value, maxAge, secured, httpOnly); }
@Override public void cookie(String domain, String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) { delegate.cookie(domain, path, name, value, maxAge, secured, httpOnly); }
public String update(Request request, Response response) { String fromCookie = request.cookie(COOKIE_NAME); final Long userId = currentUserId(request); if (!Objects.equals(pipelineSelectionsService.load(fromCookie, userId).etag(), getIfMatch(request))) { throw HaltApiResponses.haltBecauseEtagDoesNotMatch(DATA_IS_OUT_OF_DATE); } Filters filters; try { filters = Filters.fromJson(request.body()); } catch (FilterValidationException | JsonParseException e) { throw HaltApiResponses.haltBecauseOfReason(e.getMessage()); } Long recordId = pipelineSelectionsService.save(fromCookie, userId, filters); if (!apiAuthenticationHelper.securityEnabled()) { response.cookie("/go", COOKIE_NAME, String.valueOf(recordId), ONE_YEAR, systemEnvironment.isSessionCookieSecure(), true); } response.status(OK); return format("{ \"contentHash\": \"%s\" }", pipelineSelectionsService.load(fromCookie, userId).etag()); }
@Override public void cookie(String path, String name, String value, int maxAge, boolean secured) { delegate.cookie(path, name, value, maxAge, secured); }
/** * Adds not persistent cookie to the response. * Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie */ public void cookie(String name, String value) { cookie(name, value, -1, false); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param path path of the cookie * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured * @param httpOnly if true: cookie will be marked as http only */ public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) { cookie("", path, name, value, maxAge, secured, httpOnly); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured * @param httpOnly if true: cookie will be marked as http only */ public void cookie(String name, String value, int maxAge, boolean secured, boolean httpOnly) { cookie("", "", name, value, maxAge, secured, httpOnly); }
@Override public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) { delegate.cookie(path, name, value, maxAge, secured, httpOnly); }
/** * Adds not persistent cookie to the response. * Can be invoked multiple times to insert more than one cookie. * * @param name name of the cookie * @param value value of the cookie */ public void cookie(String name, String value) { cookie(name, value, -1, false); }
/** * Adds cookie to the response. Can be invoked multiple times to insert more than one cookie. * * @param path path of the cookie * @param name name of the cookie * @param value value of the cookie * @param maxAge max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie) * @param secured if true : cookie will be secured */ public void cookie(String path, String name, String value, int maxAge, boolean secured) { cookie("", path, name, value, maxAge, secured, false); }