Class OfferDiscoveryService


  • public class OfferDiscoveryService
    extends java.lang.Object
    This service provides offer recommendations and helper values from the CUAN_OFFER_DISCOVERY_SRV oData service
    • Constructor Detail

      • OfferDiscoveryService

        public OfferDiscoveryService()
    • Method Detail

      • createOfferRecommendationScenario

        protected OfferRecommendationScenario createOfferRecommendationScenario​(OfferRecommendationContext context)
        Build ContextParams, BasketObjects and LeadingObjects filters
        Parameters:
        context - Request parameters and filters
        Returns:
        OfferRecommendationScenario
      • createSAPOfferContentPosition

        protected SAPOfferContentPosition createSAPOfferContentPosition​(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
      • createSAPRecommendationItemDataSourceType

        protected SAPRecommendationItemDataSourceType createSAPRecommendationItemDataSourceType​(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
      • createSAPRecommendationType

        protected java.lang.String createSAPRecommendationType​(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
      • executeOfferRecommendation

        protected void executeOfferRecommendation​(OfferRecommendationScenario offerRecommendationScenario)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getCartItemsFromSession

        protected java.util.List<java.lang.String> getCartItemsFromSession()
      • getContentPositionValues

        public java.util.List<SAPOfferContentPosition> getContentPositionValues()
                                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getOfferRecommendations

        public java.util.List<OfferRecommendation> getOfferRecommendations​(OfferRecommendationContext context)
        Main method to trigger offer recommendation retrieval
        Parameters:
        context - Request parameters and filters
        Returns:
        List of OfferRecommendation
      • getOfferRecommendationScenarios

        @Nonnull
        public java.util.List<java.lang.String> getOfferRecommendationScenarios()
                                                                         throws java.io.IOException
        Returns:
        List of SAPRecommendationType from the yMKT system.
        The list is sorted by SAPRecommendationType#getId().
        Throws:
        java.io.IOException
      • setCartService

        public void setCartService​(CartService cartService)
      • setCommonI18NService

        public void setCommonI18NService​(CommonI18NService commonI18NService)
      • setODataService

        public void setODataService​(ODataService oDataService)
      • setRecentViewedItemsService

        public void setRecentViewedItemsService​(RecentViewedItemsService recentViewedItemsService)
      • setRecommendationBufferService

        public void setRecommendationBufferService​(RecommendationBufferService recommendationBufferService)
      • setUserContextService

        public void setUserContextService​(UserContextService userContextService)