Interface ConsentService
-
- All Known Implementing Classes:
DefaultConsentService
public interface ConsentServiceConsentService interface. Service is responsible to generate and provide the consent reference.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteConsentReferenceInConsentServiceAndInUserModel(UserModel userModel, java.lang.String baseSiteId)Deletes the consent reference when the user revokes the consent for profile or user closes the accountjava.lang.StringgetConsentReferenceFromCookie(java.lang.String siteId, javax.servlet.http.HttpServletRequest request)Fetches the consent reference from cookiejava.lang.StringgetConsentReferenceFromSession()Fetches the consent reference from sessionbooleanisProfileTrackingConsentGiven()Checks if the user (logged in or anonymous) has granted the consent to allow profile trackingbooleanisProfileTrackingConsentGiven(javax.servlet.http.HttpServletRequest request)Checks if the user (logged In or Anonymous) has granted the consent to allow profile trackingvoidremoveConsentReferenceCookieAndSession(javax.servlet.http.HttpServletResponse response)removes the consent reference cookievoidsaveConsentReferenceInSession(java.lang.String consentId)It gets the consent reference stored in a cookie and saves it in the session for further eventsvoidsaveConsentReferenceInSessionAndCurrentUserModel(javax.servlet.http.HttpServletRequest request)It gets the consent reference stored in a cookie (generated by ProfileTag) and saves it in the session and in the user model (for logged In users) for further eventsvoidsetProfileConsentCookieAndSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean consent)Saves the profile consent separately in a cookie and session attribute
-
-
-
Method Detail
-
isProfileTrackingConsentGiven
boolean isProfileTrackingConsentGiven(javax.servlet.http.HttpServletRequest request)
Checks if the user (logged In or Anonymous) has granted the consent to allow profile tracking- Parameters:
request- the http request- Returns:
- true or false
-
setProfileConsentCookieAndSession
void setProfileConsentCookieAndSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean consent)Saves the profile consent separately in a cookie and session attribute- Parameters:
request- http requestresponse- http reponseconsent- true or false
-
saveConsentReferenceInSessionAndCurrentUserModel
void saveConsentReferenceInSessionAndCurrentUserModel(javax.servlet.http.HttpServletRequest request)
It gets the consent reference stored in a cookie (generated by ProfileTag) and saves it in the session and in the user model (for logged In users) for further events- Parameters:
request- Http request
-
getConsentReferenceFromCookie
java.lang.String getConsentReferenceFromCookie(java.lang.String siteId, javax.servlet.http.HttpServletRequest request)Fetches the consent reference from cookie- Parameters:
siteId- base site identifierrequest- http request- Returns:
- consent reference
-
getConsentReferenceFromSession
java.lang.String getConsentReferenceFromSession()
Fetches the consent reference from session- Returns:
- consent reference
-
deleteConsentReferenceInConsentServiceAndInUserModel
void deleteConsentReferenceInConsentServiceAndInUserModel(UserModel userModel, java.lang.String baseSiteId)
Deletes the consent reference when the user revokes the consent for profile or user closes the account- Parameters:
userModel- the userbaseSiteId- the base site id
-
removeConsentReferenceCookieAndSession
void removeConsentReferenceCookieAndSession(javax.servlet.http.HttpServletResponse response)
removes the consent reference cookie- Parameters:
response- http response
-
saveConsentReferenceInSession
void saveConsentReferenceInSession(java.lang.String consentId)
It gets the consent reference stored in a cookie and saves it in the session for further events- Parameters:
consentId-
-
isProfileTrackingConsentGiven
boolean isProfileTrackingConsentGiven()
Checks if the user (logged in or anonymous) has granted the consent to allow profile tracking- Returns:
- true if consent is given
-
-