Class CampaignRestrictionEvaluator

    • Constructor Detail

      • CampaignRestrictionEvaluator

        public CampaignRestrictionEvaluator()
    • Method Detail

      • addCampaignsToSession

        protected void addCampaignsToSession​(java.util.List<java.lang.String> campaignsList)
      • evaluate

        public boolean evaluate​(CMSYmktCampaignRestrictionModel campaignRestriction,
                                RestrictionData context)
        This evaluator checks if the restriction is applicable.
        The restriction is true when the user belongs in a target group associated with the selected campaign
        The memberOfCampaign flag can be used to negate the restriction
        e.g.
        memberOfCampaign=true -> Restriction evaluates to true when user belongs to selected campaign
        memberOfCampaign=false -> Restriction evaluates to false when user belongs to selected campaign
        Specified by:
        evaluate in interface CMSRestrictionEvaluator<CMSYmktCampaignRestrictionModel>
        Parameters:
        campaignRestriction -
        context -
        Returns:
        true if user belongs to campaign
      • getCampaignsFromBackend

        protected java.util.List<java.lang.String> getCampaignsFromBackend()
        Retrieve user's campaigns from back end system and adds them to user session
        Returns:
        A list of campaigns
      • getCampaignsFromSession

        protected java.util.Optional<java.util.List<java.lang.String>> getCampaignsFromSession()
      • setInitiativeService

        public void setInitiativeService​(InitiativeService initiativeService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setUserContextService

        public void setUserContextService​(UserContextService userContextService)