Class DefaultConsentFacade
java.lang.Object
de.hybris.platform.commercefacades.consent.impl.DefaultConsentFacade
- All Implemented Interfaces:
ConsentFacade
Default implementation of
ConsentFacade.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseSiteServiceprotected CommerceConsentServiceprotected Converter<ConsentTemplateModel,ConsentTemplateData> Gets the list of consent templates available for the current base site (in their latest version) along with current user consents embedded inConsentTemplateData.consentData.getLatestConsentTemplate(String consentTemplateId) Gets the latest consent template for the specifiedconsentTemplateIdand the current base site.protected UserServicevoidgiveConsent(String consentTemplateId, Integer consentTemplateVersion) Gives consent for the specifiedconsentTemplateIdandconsentTemplateVersion, the current base site and current user.voidsetBaseSiteService(BaseSiteService baseSiteService) voidsetCommerceConsentService(CommerceConsentService commerceConsentService) voidsetConsentTemplateConverter(Converter<ConsentTemplateModel, ConsentTemplateData> consentTemplateConverter) voidsetUserService(UserService userService) voidwithdrawConsent(String consentCode) Withdraws consent for the specifiedconsentCode.
-
Constructor Details
-
DefaultConsentFacade
public DefaultConsentFacade()
-
-
Method Details
-
getLatestConsentTemplate
Description copied from interface:ConsentFacadeGets the latest consent template for the specifiedconsentTemplateIdand the current base site.- Specified by:
getLatestConsentTemplatein interfaceConsentFacade- Parameters:
consentTemplateId- the id of the consent template to retrieve the consent for. Should be a valid id for aConsentTemplateModel.- Returns:
- the active consent
-
getConsentTemplatesWithConsents
Description copied from interface:ConsentFacadeGets the list of consent templates available for the current base site (in their latest version) along with current user consents embedded inConsentTemplateData.consentData.- Specified by:
getConsentTemplatesWithConsentsin interfaceConsentFacade- Returns:
- a list of active consent templates
-
giveConsent
Description copied from interface:ConsentFacadeGives consent for the specifiedconsentTemplateIdandconsentTemplateVersion, the current base site and current user. If no Consent is found for the specified Consent Template, or if a Consent exists but is withdrawn (i.e. the withdrawal date is not null), a new Consent is created with the current date set toconsentGivenDateattribute.- Specified by:
giveConsentin interfaceConsentFacade- Parameters:
consentTemplateId- the id of the consent template to give the consent for. Should be a valid id for aConsentTemplateModel.consentTemplateVersion- the version of the consent template to give the consent for- See Also:
-
withdrawConsent
Description copied from interface:ConsentFacadeWithdraws consent for the specifiedconsentCode. If the given Consent has been withdrawn already, nothing happens- Specified by:
withdrawConsentin interfaceConsentFacade- Parameters:
consentCode- the code of the user consent to withdraw- See Also:
-
getUserService
-
setUserService
-
getCommerceConsentService
-
setCommerceConsentService
-
getConsentTemplateConverter
-
setConsentTemplateConverter
public void setConsentTemplateConverter(Converter<ConsentTemplateModel, ConsentTemplateData> consentTemplateConverter) -
getBaseSiteService
-
setBaseSiteService
-