Class AbstractFareInfoHandler
java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.AbstractFareInfoHandler
- All Implemented Interfaces:
FareSearchHandler
- Direct Known Subclasses:
DealFareInfoHandler,FareInfoHandler
Abstract handler responsible for populating the Fare Prices for scheduled route and populates the Passenger breakdown
prices on
FareSelectionData-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckValidAncillaryProducts(TravelBundleTemplateData bundleTemplateData) Check valid ancillary products boolean.protected FareDetailsDatacreateFareDetails(FareProductData fareProductData) Method returns a new instance of FareDetailsData with the FareProductData addedprotected FareInfoDatacreateFareInfo(List<FareDetailsData> fareDetailsDataList) Method returns a new instance of FareInfoData with the list of FareDetailsData addedprotected PriceDatacreatePriceData(double priceValue) Method returns a new PriceData using the PriceDataFactory and set sets the priceValue on the new PriceData objectprotected PriceDatacreatePriceData(de.hybris.platform.jalo.order.price.PriceInformation priceInfo) Method takes a PriceInformation object and performs a null check.protected List<PTCFareBreakdownData>createPTCFareBreakDownList(List<FareInfoData> fareInfoDataList, double baseFare, FareSearchRequestData fareSearchRequestData) This method creates the List of breakdowndataPTCFareBreakdownData.protected de.hybris.platform.configurablebundleservices.bundle.BundleTemplateServiceGets bundle template service.protected BundleTemplateModelgetChildFareProductBundleTemplate(TravelBundleTemplateData bundleTemplateData) This method gets the child fareproductbundletemplate of the current bundleTemplateprotected de.hybris.platform.servicelayer.i18n.CommonI18NServiceDeprecated.Deprecated since version 3.0.protected FareProductDatagetFareProductFromBundleTemplate(TravelBundleTemplateData bundleTemplateData) This method returns a fare product from the bundle template.protected de.hybris.platform.commercefacades.product.PriceDataFactoryDeprecated.Deprecated since version 3.0.protected ProductsSortStrategy<ProductData>Gets products sort strategy.protected doublegetTotalFromFareAndAncillaryProducts(TravelBundleTemplateData bundleTemplateData, FareProductData fareProductData) This method returns the total price for a fare product and ancillary products.protected TravelCommercePriceFacadeGets travel commerce price facade.voidhandle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData) Handle method.protected booleanisItineraryPricingInfoAvailable(ItineraryPricingInfoData itineraryPricingInfoData) This method checks if the ItineraryPricingInfo is available or not by checking if the price is setup for the fare products and ancillary products.protected voidlogNoPriceForSearchKey(String searchKey, String searchValue, ProductData productData) Log no price for search key.protected voidlogNoPriceForTransportOffering(String transportOfferingCode, ProductData productData) Log no price for transport offering.protected voidpopulateProductPrices(List<? extends ProductData> productList, String searchKey, String searchValue, BundleTemplateModel bundleTemplate) This method populates the price information for all the fare products and ancillary products.protected abstract voidpopulateProductPricesAndSort(PricedItineraryData pricedItinerary, ItineraryPricingInfoData itineraryPricingInfoData) Method to populate the price information for all the fare products and ancillary products.protected abstract voidpopulateProductPricesForOptions(List<? extends ProductData> productList, String transportOfferingCode, String sectorCode, String routeCode, BundleTemplateModel bundleTemplate) This method populates the price information for all the fare products and ancillary products.protected voidpopulatePTCFareBreakDownData(ItineraryPricingInfoData itineraryPricingInfoData, FareSearchRequestData fareSearchRequestData) This method populates the fare information (base fare) per passenger, for every itinerary and pricing point, e.g.protected voidremoveUnusedFareProducts(ItineraryPricingInfoData itineraryPricingInfoData) This method removes all un-selected fare products from bundleTemplateDatavoidsetBundleTemplateService(de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService bundleTemplateService) Sets bundle template service.voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Deprecated.Deprecated since version 3.0.voidsetPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory) Deprecated.Deprecated since version 3.0.voidsetProductsSortStrategy(ProductsSortStrategy<ProductData> productsSortStrategy) Sets products sort strategy.voidsetTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade) Sets travel commerce price facade.
-
Constructor Details
-
AbstractFareInfoHandler
public AbstractFareInfoHandler()
-
-
Method Details
-
handle
public void handle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData) Description copied from interface:FareSearchHandlerHandle method.- Specified by:
handlein interfaceFareSearchHandler- Parameters:
scheduledRoutes- the scheduled routesfareSearchRequestData- the fare search request datafareSelectionData- the fare selection data
-
populateProductPricesForOptions
protected abstract void populateProductPricesForOptions(List<? extends ProductData> productList, String transportOfferingCode, String sectorCode, String routeCode, BundleTemplateModel bundleTemplate) This method populates the price information for all the fare products and ancillary products. The prices are searched in the order of transportoffering, sector, route and default price. The first available price will be set to the product.- Parameters:
productList- the product listtransportOfferingCode- the transport offering codesectorCode- the sector coderouteCode- the route codebundleTemplate- the bundle template
-
populateProductPrices
protected void populateProductPrices(List<? extends ProductData> productList, String searchKey, String searchValue, BundleTemplateModel bundleTemplate) This method populates the price information for all the fare products and ancillary products. The prices are searched for the search key and search value.- Parameters:
productList- the product listsearchKey- the search keysearchValue- the search valuebundleTemplate- the bundle template
-
populateProductPricesAndSort
protected abstract void populateProductPricesAndSort(PricedItineraryData pricedItinerary, ItineraryPricingInfoData itineraryPricingInfoData) Method to populate the price information for all the fare products and ancillary products. The retrieved products are then sorted using strategy.- Parameters:
pricedItinerary- the priced itineraryitineraryPricingInfoData- the itinerary pricing info data
-
isItineraryPricingInfoAvailable
protected boolean isItineraryPricingInfoAvailable(ItineraryPricingInfoData itineraryPricingInfoData) This method checks if the ItineraryPricingInfo is available or not by checking if the price is setup for the fare products and ancillary products.- Parameters:
itineraryPricingInfoData- the itinerary pricing info data- Returns:
- boolean boolean
-
checkValidAncillaryProducts
Check valid ancillary products boolean.- Parameters:
bundleTemplateData- the bundle template data- Returns:
- the boolean
-
populatePTCFareBreakDownData
protected void populatePTCFareBreakDownData(ItineraryPricingInfoData itineraryPricingInfoData, FareSearchRequestData fareSearchRequestData) This method populates the fare information (base fare) per passenger, for every itinerary and pricing point, e.g. economy, economy plus.- Parameters:
itineraryPricingInfoData- the itinerary pricing info datafareSearchRequestData- the fare search request data
-
removeUnusedFareProducts
This method removes all un-selected fare products from bundleTemplateData- Parameters:
itineraryPricingInfoData- ItineraryPricingInfoData object.
-
createPTCFareBreakDownList
protected List<PTCFareBreakdownData> createPTCFareBreakDownList(List<FareInfoData> fareInfoDataList, double baseFare, FareSearchRequestData fareSearchRequestData) This method creates the List of breakdowndataPTCFareBreakdownData. The following information is set here: Passengers base price, total price for all travelers and fare products information.- Parameters:
fareInfoDataList- the fare info data listbaseFare- the base farefareSearchRequestData- the fare search request data- Returns:
- List
list
-
getFareProductFromBundleTemplate
protected FareProductData getFareProductFromBundleTemplate(TravelBundleTemplateData bundleTemplateData) This method returns a fare product from the bundle template. The fare products in the bundle template are in sorted ascending order and the lowest fare price i.e. the first object will be picked up.- Parameters:
bundleTemplateData- the bundle template data- Returns:
- FareProductData fare product from bundle template
-
createFareInfo
Method returns a new instance of FareInfoData with the list of FareDetailsData added- Parameters:
fareDetailsDataList- the fare details data list- Returns:
- FareInfoData fare info data
-
createFareDetails
Method returns a new instance of FareDetailsData with the FareProductData added- Parameters:
fareProductData- the fare product data- Returns:
- FareDetailsData fare details data
-
getTotalFromFareAndAncillaryProducts
protected double getTotalFromFareAndAncillaryProducts(TravelBundleTemplateData bundleTemplateData, FareProductData fareProductData) This method returns the total price for a fare product and ancillary products.- Parameters:
bundleTemplateData- the bundle template datafareProductData- the fare product data- Returns:
- double total from fare and ancillary products
-
createPriceData
Method takes a PriceInformation object and performs a null check. If the object a is null then null will be returned otherwise a new PriceData object is created and returned using the PriceValue on the PriceInformation object- Parameters:
priceInfo- the price info- Returns:
- PriceData price data
-
createPriceData
Method returns a new PriceData using the PriceDataFactory and set sets the priceValue on the new PriceData object- Parameters:
priceValue- the price value- Returns:
- PriceData price data
-
getChildFareProductBundleTemplate
protected BundleTemplateModel getChildFareProductBundleTemplate(TravelBundleTemplateData bundleTemplateData) This method gets the child fareproductbundletemplate of the current bundleTemplate- Parameters:
bundleTemplateData- the bundle template data- Returns:
- BundleTemplateModel child fare product bundle template
-
logNoPriceForTransportOffering
protected void logNoPriceForTransportOffering(String transportOfferingCode, ProductData productData) Log no price for transport offering.- Parameters:
transportOfferingCode- the transport offering codeproductData- the product data
-
logNoPriceForSearchKey
protected void logNoPriceForSearchKey(String searchKey, String searchValue, ProductData productData) Log no price for search key.- Parameters:
searchKey- the search keysearchValue- the search valueproductData- the product data
-
getTravelCommercePriceFacade
Gets travel commerce price facade.- Returns:
- the travelCommercePriceFacade
-
setTravelCommercePriceFacade
Sets travel commerce price facade.- Parameters:
travelCommercePriceFacade- the travelCommercePriceFacade to set
-
getBundleTemplateService
protected de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService getBundleTemplateService()Gets bundle template service.- Returns:
- the bundle template service
-
setBundleTemplateService
public void setBundleTemplateService(de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService bundleTemplateService) Sets bundle template service.- Parameters:
bundleTemplateService- the bundle template service
-
getPriceDataFactory
@Deprecated protected de.hybris.platform.commercefacades.product.PriceDataFactory getPriceDataFactory()Deprecated.Deprecated since version 3.0.Gets price data factory.- Returns:
- the priceDataFactory
-
setPriceDataFactory
@Deprecated public void setPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory) Deprecated.Deprecated since version 3.0.Sets price data factory.- Parameters:
priceDataFactory- the priceDataFactory to set
-
getCommonI18NService
Deprecated.Deprecated since version 3.0.Gets common i 18 n service.- Returns:
- the commonI18NService
-
setCommonI18NService
@Deprecated public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Deprecated.Deprecated since version 3.0.Sets common i 18 n service.- Parameters:
commonI18NService- the commonI18NService to set
-
getProductsSortStrategy
Gets products sort strategy.- Returns:
- the productsSortStrategy
-
setProductsSortStrategy
Sets products sort strategy.- Parameters:
productsSortStrategy- the productsSortStrategy to set
-