Class PROSPricedItineraryBundleHandler

java.lang.Object
de.hybris.platform.shoppingfacades.fare.search.handlers.impl.ShoppingPricedItineraryBundleHandler
de.hybris.platform.prosfacades.fare.search.handlers.impl.PROSPricedItineraryBundleHandler
All Implemented Interfaces:
ShoppingFareSearchHandler

public class PROSPricedItineraryBundleHandler extends ShoppingPricedItineraryBundleHandler
The type Pros priced itinerary bundle handler.
  • Constructor Details

    • PROSPricedItineraryBundleHandler

      public PROSPricedItineraryBundleHandler()
  • Method Details

    • handle

      public void handle(SearchResponseMessage searchResponseMessage, FareShopMessage fareShopMessage, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData)
      Populates ItinerarypricingInformation to pricedItinerary For each transport offering there must be always only one bundle per bundle type.
      Specified by:
      handle in interface ShoppingFareSearchHandler
      Overrides:
      handle in class ShoppingPricedItineraryBundleHandler
      Parameters:
      searchResponseMessage - the search response message
      fareShopMessage - the fare shop message
      fareSearchRequestData - the fare search request data
      fareSelectionData - the fare selection data
    • showBundleTemplates

      protected void showBundleTemplates(FareSelectionData fareSelectionData, FareSearchRequestData fareSearchRequestData)
      Shows bundles templates based on rules
      Parameters:
      fareSelectionData - the fare selection data
      fareSearchRequestData - the fare search request data
    • showBundles

      protected void showBundles(List<String> bundlesToShow, FareSelectionData fareSelectionData)
      Removes all the ItineraryPricingInfoData that have the ignoreRule flag set to false and are not present in the bundleToShow list
      Parameters:
      bundlesToShow - the bundles to show
      fareSelectionData - the fare selection data
    • populateItineraryPricingInformations

      protected void populateItineraryPricingInformations(PricedItineraryData pricedItinerary, List<String> fareBucketCodes)
      For each pricedItinerary populate PricingInfo as below. Retrieve a list of transport offerings and populate the itineraryPricingInfoData by searching all the bundle templates that contain Pros Fare Products having the given fareBucketCodes.
      Parameters:
      pricedItinerary - the priced itinerary
      fareBucketCodes - a list of fare bucket codes
    • getItineraryPricingInfos

      protected List<ItineraryPricingInfoData> getItineraryPricingInfos(List<TransportOfferingData> transportOfferings, List<String> fareBucketCodes)
      Retrieves a list of bundle templates that contain the Pros fare product with the given fareBucketCodes and populates the itineraryPricingInfoData from them.
      Parameters:
      transportOfferings - a list of transport offerings
      fareBucketCodes - a list of fare bucket codes
      Returns:
      a list of itineraryPricingInfoData
    • setItineraryPricingInfoAvailability

      protected void setItineraryPricingInfoAvailability(List<ItineraryPricingInfoData> itineraryPricingInfoDatas)
      This method will mark an itinerary pricing info as unavailable if no bundles are populated
      Parameters:
      itineraryPricingInfoDatas - the itinerary pricing info datas
    • populateItineraryPricingInfosFromBundleMap

      protected void populateItineraryPricingInfosFromBundleMap(Map<BundleType,List<BundleTemplateModel>> bundleMap, List<TransportOfferingData> transportOfferings, List<ItineraryPricingInfoData> itineraryPricingInfoDatas)
      Instantiate as many itinerary pricing infos as bundletypes and assign them to the itinerary pricing info
      Parameters:
      bundleMap - the bundle map
      transportOfferings - the transport offerings
      itineraryPricingInfoDatas - the itinerary pricing info datas
    • canAddBundle

      protected boolean canAddBundle(ItineraryPricingInfoData itineraryPricingInfoData, List<TransportOfferingData> transportOfferings, BundleType type)
      This method ensures that for each transport offering is offered only one bundle per type.
      Parameters:
      itineraryPricingInfoData - the itinerary pricing info data
      transportOfferings - the transport offerings
      type - the type
      Returns:
      boolean boolean
    • getItineraryPricingInfoDataForType

      protected ItineraryPricingInfoData getItineraryPricingInfoDataForType(List<ItineraryPricingInfoData> itineraryPricingInfoDatas, Map.Entry<BundleType,List<BundleTemplateModel>> entry)
      This method will either return an ItineraryPricingInfoData already created for a given type or it will create a new one.
      Parameters:
      itineraryPricingInfoDatas - the itinerary pricing info datas
      entry - the entry
      Returns:
      itinerary pricing info data for type
    • populateBundleMap

      protected void populateBundleMap(List<BundleTemplateModel> bundleTemplatesForTransportOfferings, Map<BundleType,List<BundleTemplateModel>> bundleMap, boolean allowMultipleBundles)
      Creates a map bundleType, bundles. If 'allowMultipleBundles' is set to true, it will be possible to have multiple bundles for the same bundletype. This happens only in case of multi sector with no bundle defined at a route level.
      Parameters:
      bundleTemplatesForTransportOfferings - the bundle templates for transport offerings
      bundleMap - the bundle map
      allowMultipleBundles - the allow multiple bundles
    • getTransportOfferings

      protected List<TransportOfferingData> getTransportOfferings(PricedItineraryData pricedItinerary)
      Method gets the Itinerary data from the pricedItinerary and then gets a list of OriginDestinationOption from the Itinerary object. An empty list if return if the list if empty otherwise a list of Transport Offerings is returned.
      Parameters:
      pricedItinerary - the priced itinerary
      Returns:
      List transport offerings
    • getFareBucketCodes

      protected List<String> getFareBucketCodes(SearchResponseMessage searchResponseMessage, PricedItineraryData pricedItineraryData)
      Gets fare bucket codes.
      Parameters:
      searchResponseMessage - the search response message
      pricedItineraryData - the priced itinerary data
      Returns:
      fare bucket codes
    • getTravelBundleTemplateConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel,TravelBundleTemplateData> getTravelBundleTemplateConverter()
      Gets travel bundle template converter.
      Returns:
      the travel bundle template converter
    • setTravelBundleTemplateConverter

      public void setTravelBundleTemplateConverter(de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel,TravelBundleTemplateData> travelBundleTemplateConverter)
      Sets travel bundle template converter.
      Parameters:
      travelBundleTemplateConverter - the travel bundle template converter
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Gets enumeration service.
      Returns:
      the enumeration service
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Sets enumeration service.
      Parameters:
      enumerationService - the enumeration service
    • getProsTravelBundleTemplateService

      protected PROSTravelBundleTemplateService getProsTravelBundleTemplateService()
      Gets pros travel bundle template service.
      Returns:
      the pros travel bundle template service
    • setProsTravelBundleTemplateService

      public void setProsTravelBundleTemplateService(PROSTravelBundleTemplateService prosTravelBundleTemplateService)
      Sets pros travel bundle template service.
      Parameters:
      prosTravelBundleTemplateService - the pros travel bundle template service
    • getTravelRulesService

      protected TravelRulesService getTravelRulesService()
      Gets travel rules service.
      Returns:
      the travel rules service
    • setTravelRulesService

      public void setTravelRulesService(TravelRulesService travelRulesService)
      Sets travel rules service.
      Parameters:
      travelRulesService - the travel rules service
    • getUserService

      protected de.hybris.platform.servicelayer.user.UserService getUserService()
      Gets user service.
      Returns:
      the user service
    • setUserService

      public void setUserService(de.hybris.platform.servicelayer.user.UserService userService)
      Sets user service.
      Parameters:
      userService - the user service
    • getProsSearchResponseService

      public PROSSearchResponseService getProsSearchResponseService()
      Gets pros search response service.
      Returns:
      the pros search response service
    • setProsSearchResponseService

      public void setProsSearchResponseService(PROSSearchResponseService prosSearchResponseService)
      Sets pros search response service.
      Parameters:
      prosSearchResponseService - the pros search response service