Class FareAvailabilityHandler

java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.FareAvailabilityHandler
All Implemented Interfaces:
FareSearchHandler

public class FareAvailabilityHandler extends Object implements FareSearchHandler
Concrete implementation of the FareSearchHandler interface. Handler is responsible for checking the availability of all the PricedItineraryData on the FareSelectionData
  • Constructor Details

    • FareAvailabilityHandler

      public FareAvailabilityHandler()
  • 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
    • checkAvailability

      protected void checkAvailability(ItineraryPricingInfoData itineraryPricingInfoData, FareSearchRequestData fareSearchRequestData)
    • getTotalNumberOfPassengers

      protected int getTotalNumberOfPassengers(List<PassengerTypeQuantityData> passengerTypes)
      This methods works out the total number of passenger for the given list of Passenger Type Quantity
      Parameters:
      passengerTypes - the list of Passenger Type Quantity for the current Search Request
    • checkBundleAvailabilityByFareProducts

      protected void checkBundleAvailabilityByFareProducts(ItineraryPricingInfoData itineraryPricingInfoData, int passengerNumber)
      Method to set the availability based on the stockLevel of the FareProducts.
      Parameters:
      itineraryPricingInfoData -
      passengerNumber -
    • filterFareProducts

      protected List<FareProductData> filterFareProducts(List<FareProductData> fareProducts, List<TransportOfferingData> transportOfferingsList, int passengerNumber)
      Method to filter the FareProducts list based on the stockLevel and the number of passengers.
      Parameters:
      fareProducts - as the list of FareProducts to be filtered
      transportOfferingsList - as the list of codes of the TransportOfferings where the stock level of the FareProduct should be checked
      passengerNumber - as the number of passengers
      Returns:
      List the list of products filtered
    • checkFareProductAvailability

      protected void checkFareProductAvailability(List<String> transportOfferingCodes, int passengerNumber, Map<String,TransportOfferingModel> transportOfferingModelMap, List<FareProductData> filteredFares, FareProductData fareProduct, ProductModel productModel)
    • checkBundleAvailabilityByAncillaryProducts

      protected void checkBundleAvailabilityByAncillaryProducts(ItineraryPricingInfoData itineraryPricingInfoData, int passengerNumber)
      Method to set the availability based on the stockLevel of the ancillary Products.
      Parameters:
      itineraryPricingInfoData -
      passengerNumber -
    • checkAncillaryProductsAvailability

      protected boolean checkAncillaryProductsAvailability(TravelBundleTemplateData bundleTemplate, int passengerNumber)
      Method to check the availability of a BundleTemplate based on the list of Products and the number of passengers.
      Parameters:
      bundleTemplate -
      passengerNumber -
      Returns:
      boolean value based on the availability of the bundleTemplate
    • checkNonFareProductsAvailability

      protected boolean checkNonFareProductsAvailability(TravelBundleTemplateData bundleTemplate, int passengerNumber)
      Method to check the availability of a bundleTemplate based on the availability of its nonFareProducts and the number of passengers. The method will return true if all the nonFareProducts are available, false otherwise.
      Parameters:
      bundleTemplate -
      passengerNumber -
      Returns:
      true if all the nonFareProducts are available, false otherwise.
    • checkIncludedAncillariesAvailability

      protected boolean checkIncludedAncillariesAvailability(TravelBundleTemplateData bundleTemplate, int passengerNumber)
      Method to check the availability of a bundleTemplate based on the availability of its includedAncillaries products and the number of passengers. The method will return true if all the includedAncillaries are available, false otherwise.
      Parameters:
      bundleTemplate -
      passengerNumber -
      Returns:
      true if all the includedAncillaries are available, false otherwise.
    • isProductAvailable

      protected boolean isProductAvailable(int passengerNumber, List<String> transportOfferingCodes, Map<String,TransportOfferingModel> transportOfferingModelMap, ProductModel productModel)
    • isAvailable

      protected boolean isAvailable(PricedItineraryData pricedItinerary)
      Method to check the availability of a priceItinerary based on the availability of its bundleTemplates
      Parameters:
      pricedItinerary - as the pricedItinerary to be checked
      Returns:
      boolean value based on the availability of the pricedItinerary
    • getProductService

      protected de.hybris.platform.product.ProductService getProductService()
      Returns:
      the productService
    • setProductService

      public void setProductService(de.hybris.platform.product.ProductService productService)
      Parameters:
      productService - the productService to set
    • getCommerceStockService

      protected TravelCommerceStockService getCommerceStockService()
      Returns:
      the commerceStockService
    • setCommerceStockService

      public void setCommerceStockService(TravelCommerceStockService commerceStockService)
      Parameters:
      commerceStockService - the commerceStockService to set
    • getTransportOfferingService

      protected TransportOfferingService getTransportOfferingService()
      Returns:
      the transportOfferingService
    • setTransportOfferingService

      public void setTransportOfferingService(TransportOfferingService transportOfferingService)
      Parameters:
      transportOfferingService - the transportOfferingService to set
    • getAncillaryAvailabilityStrategiesMap

      protected Map<String,AncillaryAvailabilityStrategy> getAncillaryAvailabilityStrategiesMap()
      Returns:
      the ancillaryAvailabilityStrategiesMap
    • setAncillaryAvailabilityStrategiesMap

      public void setAncillaryAvailabilityStrategiesMap(Map<String,AncillaryAvailabilityStrategy> ancillaryAvailabilityStrategiesMap)
      Parameters:
      ancillaryAvailabilityStrategiesMap - the setAncillaryAvailabilityStrategiesMap to set