Class DefaultItemMarketingMessageResolver<P extends MarketingMessage,O extends Offer>
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.service.DefaultItemMarketingMessageResolver<P,O>
-
- All Implemented Interfaces:
ItemMarketingMessageResolver<P,O>
@Deprecated public class DefaultItemMarketingMessageResolver<P extends MarketingMessage,O extends Offer> extends Object implements ItemMarketingMessageResolver<P,O>
Deprecated.since 1.6, useMarketingMessageResolverinstead- Author:
- Samarth Dhruva (samarthd)
-
-
Field Summary
Fields Modifier and Type Field Description protected MarketingMessageOfferCandidateService<O>marketingMessageOfferCandidateServiceDeprecated.protected MarketingMessageService<P>marketingMessageServiceDeprecated.
-
Constructor Summary
Constructors Constructor Description DefaultItemMarketingMessageResolver(MarketingMessageService<P> marketingMessageService, MarketingMessageOfferCandidateService<O> marketingMessageOfferCandidateService)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<P>findAllMarketingMessagesForRequest(ItemMarketingMessageRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.Finds all of theMarketingMessagesfor the providedItemMarketingMessageRequest.protected List<P>findAllMessagesForItemAsQualifierOrTarget(ItemMarketingMessageRequest request, Stream<O> candidateOffers, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.Find all marketing messages from offers where the line item is used either as the target of the offer, or used to qualify for the offer.protected booleanisItemOffer(Offer offer)Deprecated.Checks if theOffertargets an order or fulfillment group item.protected booleanisItemQualifier(Offer offer, ItemMarketingMessageRequest request)Deprecated.Checks if any of the rules inOffer.getItemQualifierCriteria()matches the line item on this request in order to determine if the line item can be used to qualify for the offer.protected booleanisItemTarget(Offer offer, ItemMarketingMessageRequest request)Deprecated.If this is an item offer, checks if any of the rules inOffer.getTargetItemCriteria()matches the line item on this request in order to determine if the line item can be used as the target for the offer.
-
-
-
Field Detail
-
marketingMessageService
protected final MarketingMessageService<P extends MarketingMessage> marketingMessageService
Deprecated.
-
marketingMessageOfferCandidateService
protected final MarketingMessageOfferCandidateService<O extends Offer> marketingMessageOfferCandidateService
Deprecated.
-
-
Constructor Detail
-
DefaultItemMarketingMessageResolver
public DefaultItemMarketingMessageResolver(MarketingMessageService<P> marketingMessageService, MarketingMessageOfferCandidateService<O> marketingMessageOfferCandidateService)
Deprecated.
-
-
Method Detail
-
findAllMarketingMessagesForRequest
public List<P> findAllMarketingMessagesForRequest(ItemMarketingMessageRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.Description copied from interface:ItemMarketingMessageResolverFinds all of theMarketingMessagesfor the providedItemMarketingMessageRequest. This will find all the activeOffersfirst, then split them into two, filtered groups: Those that treat theItemMarketingMessageRequest.itemas a target and those that treat it as a qualifier. Then, it will fetch all of the messages for those offers, filtering by locale,MarketingMessageLocationType, and active date range and sort them by priority.- Specified by:
findAllMarketingMessagesForRequestin interfaceItemMarketingMessageResolver<P extends MarketingMessage,O extends Offer>- Parameters:
request- anItemMarketingMessageRequestcontaining the parameters by which the results will be filteredcontextInfo- the context information around sandboxing and multitenant state- Returns:
- the marketing messages for the given item in priority order
-
findAllMessagesForItemAsQualifierOrTarget
protected List<P> findAllMessagesForItemAsQualifierOrTarget(ItemMarketingMessageRequest request, Stream<O> candidateOffers, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.Find all marketing messages from offers where the line item is used either as the target of the offer, or used to qualify for the offer.- Parameters:
request- anItemMarketingMessageRequestcontaining the parameters by which the results will be filteredcandidateOffers- the candidate offers to filter oncontextInfo- Context information around sandbox and multitenant state.- Returns:
- the list of marketing messages that qualify based on the associated offers and message type.
-
isItemOffer
protected boolean isItemOffer(Offer offer)
Deprecated.Checks if theOffertargets an order or fulfillment group item.- Parameters:
offer- theOfferto check- Returns:
- true if the offer targets an order or fulfillment group item
-
isItemQualifier
protected boolean isItemQualifier(Offer offer, ItemMarketingMessageRequest request)
Deprecated.Checks if any of the rules inOffer.getItemQualifierCriteria()matches the line item on this request in order to determine if the line item can be used to qualify for the offer.- Parameters:
offer- theOfferto checkrequest- anItemMarketingMessageRequestcontaining the parameters by which the results will be filtered- Returns:
- true if a match is found in the qualifier criteria
-
isItemTarget
protected boolean isItemTarget(Offer offer, ItemMarketingMessageRequest request)
Deprecated.If this is an item offer, checks if any of the rules inOffer.getTargetItemCriteria()matches the line item on this request in order to determine if the line item can be used as the target for the offer. If the offer discount cannot apply to the sales price and the line item is on sale, then the item will not qualify as the offer target.- Parameters:
offer- theOfferto checkrequest- anItemMarketingMessageRequestcontaining the parameters by which the results will be filtered- Returns:
- true if the line item can qualify as the target of the offer
-
-