Class AbstractFareInfoHandler

java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.AbstractFareInfoHandler
All Implemented Interfaces:
FareSearchHandler
Direct Known Subclasses:
DealFareInfoHandler, FareInfoHandler

public abstract class AbstractFareInfoHandler extends Object implements FareSearchHandler
Abstract handler responsible for populating the Fare Prices for scheduled route and populates the Passenger breakdown prices on FareSelectionData
  • Constructor Details

    • AbstractFareInfoHandler

      public AbstractFareInfoHandler()
  • Method Details

    • handle

      public void handle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData)
      Description copied from interface: FareSearchHandler
      Handle method.
      Specified by:
      handle in interface FareSearchHandler
      Parameters:
      scheduledRoutes - the scheduled routes
      fareSearchRequestData - the fare search request data
      fareSelectionData - 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 list
      transportOfferingCode - the transport offering code
      sectorCode - the sector code
      routeCode - the route code
      bundleTemplate - 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 list
      searchKey - the search key
      searchValue - the search value
      bundleTemplate - 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 itinerary
      itineraryPricingInfoData - 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

      protected boolean checkValidAncillaryProducts(TravelBundleTemplateData bundleTemplateData)
      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 data
      fareSearchRequestData - the fare search request data
    • removeUnusedFareProducts

      protected void removeUnusedFareProducts(ItineraryPricingInfoData itineraryPricingInfoData)
      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 breakdowndata PTCFareBreakdownData. The following information is set here: Passengers base price, total price for all travelers and fare products information.
      Parameters:
      fareInfoDataList - the fare info data list
      baseFare - the base fare
      fareSearchRequestData - 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

      protected FareInfoData createFareInfo(List<FareDetailsData> fareDetailsDataList)
      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

      protected FareDetailsData createFareDetails(FareProductData fareProductData)
      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 data
      fareProductData - the fare product data
      Returns:
      double total from fare and ancillary products
    • createPriceData

      protected PriceData createPriceData(de.hybris.platform.jalo.order.price.PriceInformation priceInfo)
      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

      protected PriceData createPriceData(double priceValue)
      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 code
      productData - the product data
    • logNoPriceForSearchKey

      protected void logNoPriceForSearchKey(String searchKey, String searchValue, ProductData productData)
      Log no price for search key.
      Parameters:
      searchKey - the search key
      searchValue - the search value
      productData - the product data
    • getTravelCommercePriceFacade

      protected TravelCommercePriceFacade getTravelCommercePriceFacade()
      Gets travel commerce price facade.
      Returns:
      the travelCommercePriceFacade
    • setTravelCommercePriceFacade

      public void setTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade)
      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 protected de.hybris.platform.servicelayer.i18n.CommonI18NService 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

      protected ProductsSortStrategy<ProductData> getProductsSortStrategy()
      Gets products sort strategy.
      Returns:
      the productsSortStrategy
    • setProductsSortStrategy

      public void setProductsSortStrategy(ProductsSortStrategy<ProductData> productsSortStrategy)
      Sets products sort strategy.
      Parameters:
      productsSortStrategy - the productsSortStrategy to set