public class DefaultConsentService extends java.lang.Object implements ConsentService
ConsentService. Service is responsible to generate and provide the consent reference.| Constructor and Description |
|---|
DefaultConsentService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addConsentReferenceCookie(HttpServletResponse response,
java.lang.String consentReferenceId) |
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
|
BaseSiteService |
getBaseSiteService() |
protected ConsentServiceClient |
getClient() |
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
|
protected ConsentReferenceCookieGenerator |
getCookieGenerator() |
protected java.util.Optional<BaseSiteModel> |
getCurrentBaseSiteModel() |
ProfileConfigurationService |
getProfileConfigurationService() |
RetrieveRestClientStrategy |
getRetrieveRestClientStrategy() |
SessionService |
getSessionService() |
protected java.lang.String |
getSiteId() |
protected java.lang.String |
getUserId() |
UserService |
getUserService() |
protected static void |
logError(java.lang.Throwable error) |
protected static void |
logSuccess(ConsentResponse consentResponse) |
void |
setBaseSiteService(BaseSiteService baseSiteService) |
void |
setCookieGenerator(ConsentReferenceCookieGenerator cookieGenerator) |
void |
setProfileConfigurationService(ProfileConfigurationService profileConfigurationService) |
void |
setRetrieveRestClientStrategy(RetrieveRestClientStrategy retrieveRestClientStrategy) |
void |
setSessionService(SessionService sessionService) |
void |
setUserService(UserService userService) |
protected void |
storeConsentReferenceInSession(java.lang.String consentReferenceId) |
public void generateConsentReference(HttpServletRequest request,
HttpServletResponse response)
ConsentServicegenerateConsentReference in interface ConsentServicerequest - Http requestresponse - Http response with the consent reference cookiepublic void generateConsentReference(HttpServletRequest request,
HttpServletResponse response,
boolean shouldGenerateConsentReference)
ConsentServicegenerateConsentReference in interface ConsentServicerequest - Http requestresponse - Http response with the consent reference cookieshouldGenerateConsentReference - should generate consent referenceprotected java.lang.String getUserId()
public java.lang.String getConsentReferenceFromCookie(java.lang.String siteId,
HttpServletRequest request)
ConsentServicegetConsentReferenceFromCookie in interface ConsentServicesiteId - base site identifierrequest - http requestprotected void addConsentReferenceCookie(HttpServletResponse response,
java.lang.String consentReferenceId)
protected void storeConsentReferenceInSession(java.lang.String consentReferenceId)
public java.lang.String getConsentReferenceFromSession()
ConsentServicegetConsentReferenceFromSession in interface ConsentServicepublic <any> generateConsentReferenceForUser(java.lang.String userId)
ConsentServicegenerateConsentReferenceForUser in interface ConsentServiceuserId - the user idprotected java.lang.String getSiteId()
protected java.util.Optional<BaseSiteModel> getCurrentBaseSiteModel()
protected static void logSuccess(ConsentResponse consentResponse)
protected static void logError(java.lang.Throwable error)
protected ConsentServiceClient getClient()
protected ConsentReferenceCookieGenerator getCookieGenerator()
public void setCookieGenerator(ConsentReferenceCookieGenerator cookieGenerator)
public SessionService getSessionService()
public void setSessionService(SessionService sessionService)
public UserService getUserService()
public void setUserService(UserService userService)
public ProfileConfigurationService getProfileConfigurationService()
public void setProfileConfigurationService(ProfileConfigurationService profileConfigurationService)
public RetrieveRestClientStrategy getRetrieveRestClientStrategy()
public void setRetrieveRestClientStrategy(RetrieveRestClientStrategy retrieveRestClientStrategy)
public BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService baseSiteService)
Copyright © 2017 SAP SE. All Rights Reserved.