Class MessageSourceConsentFunction

    • Constructor Detail

      • MessageSourceConsentFunction

        public MessageSourceConsentFunction()
        Constructor.
    • Method Detail

      • setConsentKeyLookupStrategy

        public void setConsentKeyLookupStrategy​(@Nonnull
                                                Function<ProfileRequestContext,​String> strategy)
        Set the lookup strategy for the consent message key.
        Parameters:
        strategy - lookup strategy
      • setConsentValueMessageCodeSuffix

        public void setConsentValueMessageCodeSuffix​(@Nonnull @NotEmpty
                                                     String suffix)
        Set the consent value message code suffix.
        Parameters:
        suffix - suffix of message code for the consent value
      • setConsentFlowDescriptorLookupStrategy

        public void setConsentFlowDescriptorLookupStrategy​(@Nonnull
                                                           Function<ProfileRequestContext,​ConsentFlowDescriptor> strategy)
        Set the consent flow descriptor lookup strategy.
        Parameters:
        strategy - consent flow descriptor lookup strategy
      • setHashFunction

        public void setHashFunction​(@Nonnull
                                    Function<String,​String> function)
        Set the hash function.
        Parameters:
        function - hash function
      • setLocaleLookupStrategy

        public void setLocaleLookupStrategy​(@Nonnull
                                            Function<ProfileRequestContext,​Locale> strategy)
        Set the locale lookup strategy.
        Parameters:
        strategy - The localeLookupStrategy to set.
      • getConsentId

        @Nullable
        protected String getConsentId​(@Nonnull
                                      ProfileRequestContext profileRequestContext,
                                      @Nonnull
                                      Locale locale)
        Get the consent id.
        Parameters:
        profileRequestContext - profile request context
        locale - locale to use
        Returns:
        consent id
      • getConsentValue

        @Nullable
        protected String getConsentValue​(@Nonnull @NotEmpty
                                         String consentId,
                                         @Nonnull
                                         Locale locale)
        Get the consent value.
        Parameters:
        consentId - consent ID
        locale - locale to use
        Returns:
        consent value
      • getConsentValueHash

        @Nullable
        protected String getConsentValueHash​(@Nonnull @NotEmpty
                                             String consentId,
                                             @Nonnull
                                             Locale locale)
        Get the consent value hash.
        Parameters:
        consentId - consent ID
        locale - locale to use
        Returns:
        consent value hash
      • getLocale

        @Nullable
        protected Locale getLocale​(@Nonnull
                                   ProfileRequestContext profileRequestContext)
        Get the locale.
        Parameters:
        profileRequestContext - profile request context
        Returns:
        locale
      • isCompareValues

        protected boolean isCompareValues​(@Nonnull
                                          ProfileRequestContext profileRequestContext)
        Whether consent equality includes comparing consent values.
        Parameters:
        profileRequestContext - profile request context
        Returns:
        true if consent equality includes comparing consent values