@Singleton
public class IdCookieService
extends java.lang.Object
Constructor and Description |
---|
IdCookieService(IdCookieAccessor idCookieAccessor) |
Modifier and Type | Method and Description |
---|---|
void |
discardIdCookie(java.lang.Long studyResultId)
Discards the ID cookie if the given study result ID is equal to the one
in the cookie.
|
IdCookieModel |
getIdCookie(java.lang.Long studyResultId)
Returns the IdCookie that corresponds to the given study result ID.
|
IdCookieModel |
getOldestIdCookie()
Checks the creation time of each IdCookie in the given IdCookieCollection
and returns the oldest one.
|
java.lang.Long |
getStudyResultIdFromOldestIdCookie()
Checks the creation time of each IdCookie in the given IdCookieCollection
and returns the study result ID of the oldest one.
|
boolean |
hasIdCookie(java.lang.Long studyResultId) |
boolean |
maxIdCookiesReached()
Returns true if the max number of IdCookies have been reached and false
otherwise.
|
boolean |
oneIdCookieHasThisStudyAssets(java.lang.String studyAssets)
Returns true if the study assets of at least one ID cookie is equal to
the given study assets.
|
void |
writeIdCookie(StudyResult studyResult)
Generates an ID cookie from the given parameters and sets it in the
response object.
|
void |
writeIdCookie(StudyResult studyResult,
ComponentResult componentResult)
Generates an ID cookie from the given parameters and sets it in the
response object.
|
void |
writeIdCookie(StudyResult studyResult,
ComponentResult componentResult,
JatosPublix.JatosRun jatosRun)
Generates an ID cookie from the given parameters and sets it in the
Response object.
|
void |
writeIdCookie(StudyResult studyResult,
JatosPublix.JatosRun jatosRun)
Generates an ID cookie from the given parameters and sets it in the
response object.
|
@Inject public IdCookieService(IdCookieAccessor idCookieAccessor)
public boolean hasIdCookie(java.lang.Long studyResultId) throws InternalServerErrorPublixException
public IdCookieModel getIdCookie(java.lang.Long studyResultId) throws BadRequestPublixException, InternalServerErrorPublixException
public boolean oneIdCookieHasThisStudyAssets(java.lang.String studyAssets) throws InternalServerErrorPublixException
public void writeIdCookie(StudyResult studyResult) throws InternalServerErrorPublixException
public void writeIdCookie(StudyResult studyResult, ComponentResult componentResult) throws InternalServerErrorPublixException
public void writeIdCookie(StudyResult studyResult, JatosPublix.JatosRun jatosRun) throws InternalServerErrorPublixException
public void writeIdCookie(StudyResult studyResult, ComponentResult componentResult, JatosPublix.JatosRun jatosRun) throws InternalServerErrorPublixException
public void discardIdCookie(java.lang.Long studyResultId) throws InternalServerErrorPublixException
public boolean maxIdCookiesReached() throws InternalServerErrorPublixException
public IdCookieModel getOldestIdCookie() throws InternalServerErrorPublixException
public java.lang.Long getStudyResultIdFromOldestIdCookie() throws InternalServerErrorPublixException