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
The type Pros priced itinerary bundle handler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanAddBundle(ItineraryPricingInfoData itineraryPricingInfoData, List<TransportOfferingData> transportOfferings, BundleType type) This method ensures that for each transport offering is offered only one bundle per type.protected de.hybris.platform.enumeration.EnumerationServiceGets enumeration service.getFareBucketCodes(SearchResponseMessage searchResponseMessage, PricedItineraryData pricedItineraryData) Gets fare bucket codes.protected ItineraryPricingInfoDatagetItineraryPricingInfoDataForType(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.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.Gets pros search response service.protected PROSTravelBundleTemplateServiceGets pros travel bundle template service.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.protected de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel,TravelBundleTemplateData> Gets travel bundle template converter.protected TravelRulesServiceGets travel rules service.protected de.hybris.platform.servicelayer.user.UserServiceGets user service.voidhandle(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.protected voidpopulateBundleMap(List<BundleTemplateModel> bundleTemplatesForTransportOfferings, Map<BundleType, List<BundleTemplateModel>> bundleMap, boolean allowMultipleBundles) Creates a map bundleType, bundles.protected voidpopulateItineraryPricingInformations(PricedItineraryData pricedItinerary, List<String> fareBucketCodes) For each pricedItinerary populate PricingInfo as below.protected voidpopulateItineraryPricingInfosFromBundleMap(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 infovoidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) Sets enumeration service.protected voidsetItineraryPricingInfoAvailability(List<ItineraryPricingInfoData> itineraryPricingInfoDatas) This method will mark an itinerary pricing info as unavailable if no bundles are populatedvoidsetProsSearchResponseService(PROSSearchResponseService prosSearchResponseService) Sets pros search response service.voidsetProsTravelBundleTemplateService(PROSTravelBundleTemplateService prosTravelBundleTemplateService) Sets pros travel bundle template service.voidsetTravelBundleTemplateConverter(de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel, TravelBundleTemplateData> travelBundleTemplateConverter) Sets travel bundle template converter.voidsetTravelRulesService(TravelRulesService travelRulesService) Sets travel rules service.voidsetUserService(de.hybris.platform.servicelayer.user.UserService userService) Sets user service.protected voidshowBundles(List<String> bundlesToShow, FareSelectionData fareSelectionData) Removes all theItineraryPricingInfoDatathat have the ignoreRule flag set to false and are not present in the bundleToShow listprotected voidshowBundleTemplates(FareSelectionData fareSelectionData, FareSearchRequestData fareSearchRequestData) Shows bundles templates based on rules
-
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:
handlein interfaceShoppingFareSearchHandler- Overrides:
handlein classShoppingPricedItineraryBundleHandler- Parameters:
searchResponseMessage- the search response messagefareShopMessage- the fare shop messagefareSearchRequestData- the fare search request datafareSelectionData- the fare selection data
-
showBundleTemplates
protected void showBundleTemplates(FareSelectionData fareSelectionData, FareSearchRequestData fareSearchRequestData) Shows bundles templates based on rules- Parameters:
fareSelectionData- the fare selection datafareSearchRequestData- the fare search request data
-
showBundles
Removes all theItineraryPricingInfoDatathat have the ignoreRule flag set to false and are not present in the bundleToShow list- Parameters:
bundlesToShow- the bundles to showfareSelectionData- 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 itineraryfareBucketCodes- 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 offeringsfareBucketCodes- 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 maptransportOfferings- the transport offeringsitineraryPricingInfoDatas- 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 datatransportOfferings- the transport offeringstype- 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 datasentry- 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 offeringsbundleMap- the bundle mapallowMultipleBundles- the allow multiple bundles
-
getTransportOfferings
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 messagepricedItineraryData- 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
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
Gets travel rules service.- Returns:
- the travel rules service
-
setTravelRulesService
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
Gets pros search response service.- Returns:
- the pros search response service
-
setProsSearchResponseService
Sets pros search response service.- Parameters:
prosSearchResponseService- the pros search response service
-