Package services.publix.idcookie
Class IdCookieAccessor
- java.lang.Object
-
- services.publix.idcookie.IdCookieAccessor
-
@Singleton public class IdCookieAccessor extends java.lang.ObjectThis class offers a simple interface to extract, log and discard JATOS ID cookies.Internally this class accesses ID cookies in the HTTP Request or Response. It stores the extracted
IdCookieModelin aIdCookieCollection. Additionally, it puts theIdCookieCollectionin theRequestScopefor easier retrieval in subsequent calls within the same Request.Each browser can run up to certain limit (defined in jatos.conf) studies at the same time. This means that there is the same number of ID cookies stored in the browser as studies are currently running (although part of them might be abandoned).
-
-
Constructor Summary
Constructors Constructor Description IdCookieAccessor(IdCookieSerialiser idCookieSerialiser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddiscard(long studyResultId)Discards the ID cookie that corresponds to the given study result ID.protected IdCookieCollectionextract()Returns the IdCookieCollection containing all ID cookies of this Request.
-
-
-
Constructor Detail
-
IdCookieAccessor
@Inject public IdCookieAccessor(IdCookieSerialiser idCookieSerialiser)
-
-
Method Detail
-
extract
protected IdCookieCollection extract() throws IdCookieAlreadyExistsException
Returns the IdCookieCollection containing all ID cookies of this Request. Additionally, it stores this IdCookieCollection in the RequestScope. All subsequent calls of this method will get the IdCookieCollection from the RequestScope.- Throws:
IdCookieAlreadyExistsException
-
discard
protected void discard(long studyResultId) throws IdCookieAlreadyExistsExceptionDiscards the ID cookie that corresponds to the given study result ID. If there is no such ID cookie, it does nothing.- Throws:
IdCookieAlreadyExistsException
-
-