Class DefaultCommerceConsentService

    • Constructor Detail

      • DefaultCommerceConsentService

        public DefaultCommerceConsentService()
    • Method Detail

      • getConsentTemplate

        public ConsentTemplateModel getConsentTemplate​(java.lang.String consentTemplateId,
                                                       java.lang.Integer consentTemplateVersion,
                                                       BaseSiteModel baseSite)
        Description copied from interface: CommerceConsentService
        Finds the consent template for the supplied consentTemplateId, consentTemplateVersion and baseSite.
        Specified by:
        getConsentTemplate in interface CommerceConsentService
        Parameters:
        consentTemplateId - the id of the consent template
        consentTemplateVersion - the version of the consent template
        baseSite - the baseSite to retrieve the consent template for
        Returns:
        the consent template
      • getLatestConsentTemplate

        public ConsentTemplateModel getLatestConsentTemplate​(java.lang.String consentTemplateId,
                                                             BaseSiteModel baseSite)
        Description copied from interface: CommerceConsentService
        Finds the latest version of a ConsentTemplate for the given consentTemplateId and baseSite.
        Specified by:
        getLatestConsentTemplate in interface CommerceConsentService
        Parameters:
        consentTemplateId - the id of the consent template
        baseSite - the baseSite to retrieve the consent template for.
        Returns:
        the consent template
      • getConsent

        public ConsentModel getConsent​(java.lang.String consentCode)
        Description copied from interface: CommerceConsentService
        Finds the consent for the specified consentCode
        Specified by:
        getConsent in interface CommerceConsentService
        Parameters:
        consentCode - the consent code to get the consent for
        Returns:
        the consent
      • hasEffectivelyActiveConsent

        public boolean hasEffectivelyActiveConsent​(CustomerModel customer,
                                                   ConsentTemplateModel consentTemplate)
        Description copied from interface: CommerceConsentService
        Checks if a customer has a consent that has not been withdrawn for the specified consent template.
        Specified by:
        hasEffectivelyActiveConsent in interface CommerceConsentService
        Parameters:
        customer - the customer to check the consent for
        consentTemplate - the consent template to check the consent for
        Returns:
        true, if the customer has a consent that has not been withdrawn
      • withdrawConsent

        public void withdrawConsent​(ConsentModel consent)
        Description copied from interface: CommerceConsentService
        Withdraws consent for the specified ConsentModel by updating the consentWithdrawnDate.

        1. Doesn't withdraw the consent if its already withdrawn, i.e, If Consent.consentWithdrawnDate is already set calling this method will not overwrite the existing value.
        Specified by:
        withdrawConsent in interface CommerceConsentService
        Parameters:
        consent - the consent to withdraw the consent for
      • isConsentWithdrawn

        protected boolean isConsentWithdrawn​(ConsentModel consent)
      • isConsentGiven

        protected boolean isConsentGiven​(ConsentModel consent)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • getTimeService

        protected TimeService getTimeService()
      • setTimeService

        public void setTimeService​(TimeService timeService)
      • getConsentDao

        protected ConsentDao getConsentDao()
      • setConsentDao

        public void setConsentDao​(ConsentDao consentDao)
      • setConsentTemplateDao

        public void setConsentTemplateDao​(ConsentTemplateDao consentTemplateDao)
      • getEventService

        protected EventService getEventService()
      • setEventService

        public void setEventService​(EventService eventService)
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)