Class FareAvailabilityHandler
java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.FareAvailabilityHandler
- All Implemented Interfaces:
FareSearchHandler
Concrete implementation of the
FareSearchHandler interface. Handler is responsible for checking the
availability of all the PricedItineraryData on the FareSelectionData-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAncillaryProductsAvailability(TravelBundleTemplateData bundleTemplate, int passengerNumber) Method to check the availability of a BundleTemplate based on the list of Products and the number of passengers.protected voidcheckAvailability(ItineraryPricingInfoData itineraryPricingInfoData, FareSearchRequestData fareSearchRequestData) protected voidcheckBundleAvailabilityByAncillaryProducts(ItineraryPricingInfoData itineraryPricingInfoData, int passengerNumber) Method to set the availability based on the stockLevel of the ancillary Products.protected voidcheckBundleAvailabilityByFareProducts(ItineraryPricingInfoData itineraryPricingInfoData, int passengerNumber) Method to set the availability based on the stockLevel of the FareProducts.protected voidcheckFareProductAvailability(List<String> transportOfferingCodes, int passengerNumber, Map<String, TransportOfferingModel> transportOfferingModelMap, List<FareProductData> filteredFares, FareProductData fareProduct, ProductModel productModel) protected booleancheckIncludedAncillariesAvailability(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.protected booleancheckNonFareProductsAvailability(TravelBundleTemplateData bundleTemplate, int passengerNumber) Method to check the availability of a bundleTemplate based on the availability of its nonFareProducts and the number of passengers.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.protected Map<String,AncillaryAvailabilityStrategy> protected TravelCommerceStockServiceprotected de.hybris.platform.product.ProductServiceprotected intgetTotalNumberOfPassengers(List<PassengerTypeQuantityData> passengerTypes) This methods works out the total number of passenger for the given list of Passenger Type Quantityprotected TransportOfferingServicevoidhandle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData) Handle method.protected booleanisAvailable(PricedItineraryData pricedItinerary) Method to check the availability of a priceItinerary based on the availability of its bundleTemplatesprotected booleanisProductAvailable(int passengerNumber, List<String> transportOfferingCodes, Map<String, TransportOfferingModel> transportOfferingModelMap, ProductModel productModel) voidsetAncillaryAvailabilityStrategiesMap(Map<String, AncillaryAvailabilityStrategy> ancillaryAvailabilityStrategiesMap) voidsetCommerceStockService(TravelCommerceStockService commerceStockService) voidsetProductService(de.hybris.platform.product.ProductService productService) voidsetTransportOfferingService(TransportOfferingService transportOfferingService)
-
Constructor Details
-
FareAvailabilityHandler
public FareAvailabilityHandler()
-
-
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
-
checkAvailability
protected void checkAvailability(ItineraryPricingInfoData itineraryPricingInfoData, FareSearchRequestData fareSearchRequestData) -
getTotalNumberOfPassengers
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 filteredtransportOfferingsList- as the list of codes of the TransportOfferings where the stock level of the FareProduct should be checkedpassengerNumber- 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
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
- Returns:
- the commerceStockService
-
setCommerceStockService
- Parameters:
commerceStockService- the commerceStockService to set
-
getTransportOfferingService
- Returns:
- the transportOfferingService
-
setTransportOfferingService
- Parameters:
transportOfferingService- the transportOfferingService to set
-
getAncillaryAvailabilityStrategiesMap
- Returns:
- the ancillaryAvailabilityStrategiesMap
-
setAncillaryAvailabilityStrategiesMap
public void setAncillaryAvailabilityStrategiesMap(Map<String, AncillaryAvailabilityStrategy> ancillaryAvailabilityStrategiesMap) - Parameters:
ancillaryAvailabilityStrategiesMap- the setAncillaryAvailabilityStrategiesMap to set
-