Interface ConsentFacade

  • All Known Implementing Classes:
    DefaultConsentFacade

    public interface ConsentFacade
    Facade interface providing an API for performing various consent operations.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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 in ConsentTemplateData.consentData.
      ConsentTemplateData getLatestConsentTemplate​(java.lang.String consentTemplateId)
      Gets the latest consent template for the specified consentTemplateId and the current base site.
      void giveConsent​(java.lang.String consentTemplateId, java.lang.Integer consentTemplateVersion)
      Gives consent for the specified consentTemplateId and consentTemplateVersion, the current base site and current user.
      void withdrawConsent​(java.lang.String consentCode)
      Withdraws consent for the specified consentCode.
    • Method Detail

      • getLatestConsentTemplate

        ConsentTemplateData getLatestConsentTemplate​(java.lang.String consentTemplateId)
        Gets the latest consent template for the specified consentTemplateId and the current base site.
        Parameters:
        consentTemplateId - the id of the consent template to retrieve the consent for. Should be a valid id for a ConsentTemplateModel.
        Returns:
        the active consent
      • getConsentTemplatesWithConsents

        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 in ConsentTemplateData.consentData.
        Returns:
        a list of active consent templates
      • giveConsent

        void giveConsent​(java.lang.String consentTemplateId,
                         java.lang.Integer consentTemplateVersion)
        Gives consent for the specified consentTemplateId and consentTemplateVersion, 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 to consentGivenDate attribute.
        Parameters:
        consentTemplateId - the id of the consent template to give the consent for. Should be a valid id for a ConsentTemplateModel.
        consentTemplateVersion - the version of the consent template to give the consent for
        Throws:
        ModelNotFoundException - if no ConsentTemplate with the specified consentTemplateId and consentTemplateVersion was found
        AmbiguousIdentifierException - if multiple ConsentTemplate entities were found for the the specified consentTemplateId and consentTemplateVersion
        CommerceConsentGivenException - if a consent was already given
        See Also:
        CommerceConsentService.giveConsent(CustomerModel, ConsentTemplateModel)