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 code
|
protected ConsentDao |
getConsentDao() |
ConsentTemplateModel |
getConsentTemplate(java.lang.String consentTemplateId,
java.lang.Integer consentTemplateVersion,
BaseSiteModel baseSite)
Finds the consent for the supplied
ConsentTemplate, consentTemplateVersion and
baseSite. |
protected ConsentTemplateDao |
getConsentTemplateDao() |
java.util.List<ConsentTemplateModel> |
getConsentTemplates(BaseSiteModel baseSite)
Finds all available consent templates (in the latest version) for the given
consentTemplateId and
baseSite. |
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() |
void |
giveConsent(CustomerModel customer,
ConsentTemplateModel consentTemplate)
Gives consent for the specified customer and consent template.
|
protected boolean |
isConsentWithdrawn(ConsentModel consent) |
void |
setConsentDao(ConsentDao consentDao) |
void |
setConsentTemplateDao(ConsentTemplateDao consentTemplateDao) |
void |
setModelService(ModelService modelService) |
void |
setTimeService(TimeService timeService) |
void |
withdrawConsent(ConsentModel consent)
Withdraws consent for the specified ConsentModel by updating the consentWithdrawnDate.
|
public java.util.List<ConsentTemplateModel> getConsentTemplates(BaseSiteModel baseSite)
CommerceConsentServiceconsentTemplateId and
baseSite.getConsentTemplates in interface CommerceConsentServicebaseSite - the baseSite to retrieve the consent template for.public ConsentTemplateModel getConsentTemplate(java.lang.String consentTemplateId, java.lang.Integer consentTemplateVersion, BaseSiteModel baseSite)
CommerceConsentServiceConsentTemplate, consentTemplateVersion and
baseSite.getConsentTemplate in interface CommerceConsentServiceconsentTemplateId - the id of the consent template to retrieve the consent for.consentTemplateVersion - the version of the consent template to retrieve the consent for.baseSite - the baseSite to retrieve the consent template for.public ConsentTemplateModel getLatestConsentTemplate(java.lang.String consentTemplateId, BaseSiteModel baseSite)
CommerceConsentServiceConsentTemplate for the given consentTemplateId and
baseSite.getLatestConsentTemplate in interface CommerceConsentServiceconsentTemplateId - the id of the consent template to retrieve the consent for.baseSite - the baseSite to retrieve the consent template for.public ConsentModel getConsent(java.lang.String consentCode)
CommerceConsentServicegetConsent 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 void giveConsent(CustomerModel customer, ConsentTemplateModel consentTemplate)
CommerceConsentServiceConsent and sets the
consentGivenDate.giveConsent in interface CommerceConsentServicecustomer - the customer to give the consent forconsentTemplate - the consent template to give the consent forpublic void withdrawConsent(ConsentModel consent)
CommerceConsentServicewithdrawConsent in interface CommerceConsentServiceconsent - the consent to withdraw the consent forprotected boolean isConsentWithdrawn(ConsentModel consent)
protected ConsentModel createConsentModel(CustomerModel customer, ConsentTemplateModel consentTemplate)
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)
Copyright © 2017 SAP SE. All Rights Reserved.