@Singleton
public class GeneralSingleCookieService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COOKIE_NAME |
Constructor and Description |
---|
GeneralSingleCookieService() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addStudy(Study study,
Worker worker,
play.mvc.Http.Cookie generalSingleCookie)
If the cookie is not null it adds a new tuple (study's UUID and worker ID) to the cookie's value and returns it.
|
java.lang.Long |
fetchWorkerIdByStudy(Study study)
Returns the worker ID of the GeneralSingleWorker that belongs to the given study - or null, if it doesn't exist.
|
void |
set(java.lang.String cookieValue)
Sets the cookieValue as the new GeneralSingle cookie.
|
void |
set(Study study,
Worker worker)
Sets the cookie in the response.
|
public static final java.lang.String COOKIE_NAME
public java.lang.Long fetchWorkerIdByStudy(Study study)
public void set(java.lang.String cookieValue)
public void set(Study study, Worker worker)
public java.lang.String addStudy(Study study, Worker worker, play.mvc.Http.Cookie generalSingleCookie)