public class DefaultCommerceConsentService extends java.lang.Object implements CommerceConsentService
CommerceConsentService| Constructor and Description |
|---|
DefaultCommerceConsentService() |
| Modifier and Type | Method and Description |
|---|---|
protected ConsentModel |
createConsentModel(CustomerModel customer,
ConsentTemplateModel consentTemplate) |
ConsentModel |
getActiveConsent(CustomerModel customer,
ConsentTemplateModel consentTemplate)
Finds the latest consent for the specified customer and consent template.
|
ConsentModel |
getConsent(java.lang.String consentCode)
Finds the consent for the specified
consentCode |
protected ConsentDao |
getConsentDao() |
ConsentTemplateModel |
getConsentTemplate(java.lang.String consentTemplateId,
java.lang.Integer consentTemplateVersion,
BaseSiteModel baseSite)
Finds the consent template for the supplied
consentTemplateId, consentTemplateVersion and
baseSite. |
protected ConsentTemplateDao |
getConsentTemplateDao() |
java.util.List<ConsentTemplateModel> |
getConsentTemplates(BaseSiteModel baseSite)
Finds all the latest versions of consent templates for the given
baseSite. |
protected EventService |
getEventService() |
ConsentTemplateModel |
getLatestConsentTemplate(java.lang.String consentTemplateId,
BaseSiteModel baseSite)
Finds the latest version of a
ConsentTemplate for the given consentTemplateId and
baseSite. |
protected ModelService |
getModelService() |
protected TimeService |
getTimeService() |
protected UserService |
getUserService() |
void |
giveConsent(CustomerModel customer,
ConsentTemplateModel consentTemplate)
Gives consent for the specified customer and consent template.
|
boolean |
hasEffectivelyActiveConsent(CustomerModel customer,
ConsentTemplateModel consentTemplate)
Checks if a customer has a consent that has not been withdrawn for the specified consent template.
|
protected AbstractConsentEvent |
initializeEvent(AbstractConsentEvent event,
ConsentModel consent) |
protected boolean |
isConsentGiven(ConsentModel consent) |
protected boolean |
isConsentWithdrawn(ConsentModel consent) |
void |
setConsentDao(ConsentDao consentDao) |
void |
setConsentTemplateDao(ConsentTemplateDao consentTemplateDao) |
void |
setEventService(EventService eventService) |
void |
setModelService(ModelService modelService) |
void |
setTimeService(TimeService timeService) |
void |
setUserService(UserService userService) |
void |
withdrawConsent(ConsentModel consent)
Withdraws consent for the specified ConsentModel by updating the consentWithdrawnDate.
1. |
public java.util.List<ConsentTemplateModel> getConsentTemplates(BaseSiteModel baseSite)
CommerceConsentServicebaseSite.getConsentTemplates in interface CommerceConsentServicebaseSite - the baseSite to retrieve the consent template forpublic ConsentTemplateModel getConsentTemplate(java.lang.String consentTemplateId, java.lang.Integer consentTemplateVersion, BaseSiteModel baseSite)
CommerceConsentServiceconsentTemplateId, consentTemplateVersion and
baseSite.getConsentTemplate in interface CommerceConsentServiceconsentTemplateId - the id of the consent templateconsentTemplateVersion - the version of the consent templatebaseSite - the baseSite to retrieve the consent template forpublic ConsentTemplateModel getLatestConsentTemplate(java.lang.String consentTemplateId, BaseSiteModel baseSite)
CommerceConsentServiceConsentTemplate for the given consentTemplateId and
baseSite.getLatestConsentTemplate in interface CommerceConsentServiceconsentTemplateId - the id of the consent templatebaseSite - the baseSite to retrieve the consent template for.public ConsentModel getConsent(java.lang.String consentCode)
CommerceConsentServiceconsentCodegetConsent in interface CommerceConsentServiceconsentCode - the consent code to get the consent forpublic ConsentModel getActiveConsent(CustomerModel customer, ConsentTemplateModel consentTemplate)
CommerceConsentServicegetActiveConsent in interface CommerceConsentServicecustomer - the customer to get the consent forconsentTemplate - the consent template to get the consent forpublic boolean hasEffectivelyActiveConsent(CustomerModel customer, ConsentTemplateModel consentTemplate)
CommerceConsentServicehasEffectivelyActiveConsent in interface CommerceConsentServicecustomer - the customer to check the consent forconsentTemplate - the consent template to check the consent forpublic void giveConsent(CustomerModel customer, ConsentTemplateModel consentTemplate)
CommerceConsentServiceConsent and sets the
consentGivenDate. CommerceConsentGivenExceptiongiveConsent in interface CommerceConsentServicecustomer - the customer to give the consent forconsentTemplate - the consent template to give the consent forpublic void withdrawConsent(ConsentModel consent)
CommerceConsentServiceConsent.consentWithdrawnDate is
already set calling this method will not overwrite the existing value.withdrawConsent in interface CommerceConsentServiceconsent - the consent to withdraw the consent forprotected boolean isConsentWithdrawn(ConsentModel consent)
protected boolean isConsentGiven(ConsentModel consent)
protected ConsentModel createConsentModel(CustomerModel customer, ConsentTemplateModel consentTemplate)
protected AbstractConsentEvent initializeEvent(AbstractConsentEvent event, ConsentModel consent)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected TimeService getTimeService()
public void setTimeService(TimeService timeService)
protected ConsentDao getConsentDao()
public void setConsentDao(ConsentDao consentDao)
protected ConsentTemplateDao getConsentTemplateDao()
public void setConsentTemplateDao(ConsentTemplateDao consentTemplateDao)
protected EventService getEventService()
public void setEventService(EventService eventService)
protected UserService getUserService()
public void setUserService(UserService userService)
Copyright © 2018 SAP SE. All Rights Reserved.