public interface ConsentService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANONYMOUS_CONSENTS
Cookie for anonymous user
|
static java.lang.String |
CONSENT_GIVEN
Expected consent value
|
static java.lang.String |
PROFILE_CONSENT
Consent code for Profile
|
static java.lang.String |
PROFILE_CONSENT_GIVEN
Cookie and Session attribute key
|
static java.lang.String |
USER_CONSENTS
Session attribute for logged in users
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateConsentReference(HttpServletRequest request,
HttpServletResponse response)
Generates the consent reference for the user and stores it both in a cookie
and in the session
|
void |
generateConsentReference(HttpServletRequest request,
HttpServletResponse response,
boolean shouldGenerateConsentReference)
Generates the consent reference for the user and stores it both in a cookie
and in the session
|
<any> |
generateConsentReferenceForUser(java.lang.String userId)
Executes the rest call to the consent service to get the consent reference for a given user
|
java.lang.String |
getConsentReferenceFromCookie(java.lang.String siteId,
HttpServletRequest request)
Fetches the consent reference from cookie
|
java.lang.String |
getConsentReferenceFromSession()
Fetches the consent reference from session
|
boolean |
isProfileTrackingConsentGiven(HttpServletRequest request)
Checks if the user (logged In or Anonymous) has granted the consent to allow profile tracking
|
boolean |
isProfileTrackingConsentGivenForAnonymousUser(java.util.Optional<Cookie> anonymousConsentCookie)
Checks if the Anonymous User has granted the consent to allow profile tracking
The consents for Anonymous Users are stored in a Cookie
|
boolean |
isProfileTrackingConsentGivenForLoggedInUser()
Checks if the Log In User has granted the consent to allow profile tracking
The consents for Log In Users are stored in Session
|
void |
setProfileConsentCookie(HttpServletRequest request,
HttpServletResponse response,
boolean consent)
Saves the profile consent separately in a cookie and session attribute
|
static final java.lang.String USER_CONSENTS
static final java.lang.String ANONYMOUS_CONSENTS
static final java.lang.String PROFILE_CONSENT
static final java.lang.String CONSENT_GIVEN
static final java.lang.String PROFILE_CONSENT_GIVEN
boolean isProfileTrackingConsentGiven(HttpServletRequest request)
request - the http requestboolean isProfileTrackingConsentGivenForLoggedInUser()
void setProfileConsentCookie(HttpServletRequest request,
HttpServletResponse response,
boolean consent)
request - http requestresponse - http reponseconsent - true or falseboolean isProfileTrackingConsentGivenForAnonymousUser(java.util.Optional<Cookie> anonymousConsentCookie)
anonymousConsentCookie - <any> generateConsentReferenceForUser(java.lang.String userId)
userId - the user idvoid generateConsentReference(HttpServletRequest request,
HttpServletResponse response)
request - Http requestresponse - Http response with the consent reference cookievoid generateConsentReference(HttpServletRequest request,
HttpServletResponse response,
boolean shouldGenerateConsentReference)
request - Http requestresponse - Http response with the consent reference cookieshouldGenerateConsentReference - should generate consent referencejava.lang.String getConsentReferenceFromSession()
java.lang.String getConsentReferenceFromCookie(java.lang.String siteId,
HttpServletRequest request)
siteId - base site identifierrequest - http requestCopyright © 2018 SAP SE. All Rights Reserved.