Class DefaultConsentFacade
- java.lang.Object
-
- de.hybris.platform.commercefacades.consent.impl.DefaultConsentFacade
-
- All Implemented Interfaces:
ConsentFacade
public class DefaultConsentFacade extends java.lang.Object implements ConsentFacade
Default implementation ofConsentFacade.
-
-
Constructor Summary
Constructors Constructor Description DefaultConsentFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BaseSiteServicegetBaseSiteService()protected CommerceConsentServicegetCommerceConsentService()protected Converter<ConsentTemplateModel,ConsentTemplateData>getConsentTemplateConverter()java.util.List<ConsentTemplateData>getConsentTemplatesWithConsents()Gets the list of consent templates available for the current base site (in their latest version) along with current user consents embedded inConsentTemplateData.consentData.ConsentTemplateDatagetLatestConsentTemplate(java.lang.String consentTemplateId)Gets the latest consent template for the specifiedconsentTemplateIdand the current base site.protected UserServicegetUserService()voidgiveConsent(java.lang.String consentTemplateId, java.lang.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(java.lang.String consentCode)Withdraws consent for the specifiedconsentCode.
-
-
-
Method Detail
-
getLatestConsentTemplate
public ConsentTemplateData getLatestConsentTemplate(java.lang.String consentTemplateId)
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
public java.util.List<ConsentTemplateData> 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
public void giveConsent(java.lang.String consentTemplateId, java.lang.Integer consentTemplateVersion)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:
CommerceConsentService.giveConsent(CustomerModel, ConsentTemplateModel)
-
withdrawConsent
public void withdrawConsent(java.lang.String consentCode)
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:
CommerceConsentService.withdrawConsent(de.hybris.platform.commerceservices.model.consent.ConsentModel)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getCommerceConsentService
protected CommerceConsentService getCommerceConsentService()
-
setCommerceConsentService
public void setCommerceConsentService(CommerceConsentService commerceConsentService)
-
getConsentTemplateConverter
protected Converter<ConsentTemplateModel,ConsentTemplateData> getConsentTemplateConverter()
-
setConsentTemplateConverter
public void setConsentTemplateConverter(Converter<ConsentTemplateModel,ConsentTemplateData> consentTemplateConverter)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
-