public class CampaignRestrictionEvaluator extends java.lang.Object implements CMSRestrictionEvaluator<CMSYmktCampaignRestrictionModel>
| Modifier and Type | Field and Description |
|---|---|
protected InitiativeService |
initiativeService |
protected static java.lang.String |
SESSION_PREFIX |
protected SessionService |
sessionService |
protected UserContextService |
userContextService |
| Constructor and Description |
|---|
CampaignRestrictionEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCampaignsToSession(java.util.List<java.lang.String> campaignsList) |
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 |
protected java.util.List<java.lang.String> |
getCampaignsFromBackend()
Retrieve user's campaigns from back end system and adds them to user session
|
protected java.util.Optional<java.util.List<java.lang.String>> |
getCampaignsFromSession() |
void |
setInitiativeService(InitiativeService initiativeService) |
void |
setSessionService(SessionService sessionService) |
void |
setUserContextService(UserContextService userContextService) |
protected static final java.lang.String SESSION_PREFIX
protected InitiativeService initiativeService
protected SessionService sessionService
protected UserContextService userContextService
protected void addCampaignsToSession(java.util.List<java.lang.String> campaignsList)
public boolean evaluate(CMSYmktCampaignRestrictionModel campaignRestriction, RestrictionData context)
evaluate in interface CMSRestrictionEvaluator<CMSYmktCampaignRestrictionModel>campaignRestriction - context - protected java.util.List<java.lang.String> getCampaignsFromBackend()
protected java.util.Optional<java.util.List<java.lang.String>> getCampaignsFromSession()
public void setInitiativeService(InitiativeService initiativeService)
public void setSessionService(SessionService sessionService)
public void setUserContextService(UserContextService userContextService)
Copyright © 2018 SAP SE. All Rights Reserved.