Class DefaultShoppingAutoAccommodationAllocationStrategy
java.lang.Object
de.hybris.platform.travelservices.strategies.impl.DefaultAutoAccommodationAllocationStrategy
de.hybris.platform.shoppingservices.strategies.impl.DefaultShoppingAutoAccommodationAllocationStrategy
- All Implemented Interfaces:
AutoAccommodationAllocationStrategy
public class DefaultShoppingAutoAccommodationAllocationStrategy
extends DefaultAutoAccommodationAllocationStrategy
Shopping extension of
DefaultAutoAccommodationAllocationStrategy class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidautoAllocateSeat(AbstractOrderModel abstractOrderModel, Integer legNumber, List<String> travellerReferences) This strategy follows one rule that is to allocate the first available seat.protected ShoppingAccommodationMapServiceGets the shoppingAccommodationMapServiceprotected voidgetTransportOfferingTravelAccommodationMap(AbstractOrderModel abstractOrderModel, List<TravellerModel> travellers, Map<TransportOfferingModel, Map<TravellerModel, ConfiguredAccommodationModel>> transportOfferingTravellerAccomodationMap, TransportOfferingModel transportOffering, Optional<TransportVehicleInfoModel> vehicleInfo, long numberOfSeatsToAllocate) Gets the accommodation mapvoidsetShoppingAccommodationMapService(ShoppingAccommodationMapService shoppingAccommodationMapService) Sets the shoppingAccommodationMapServiceMethods inherited from class de.hybris.platform.travelservices.strategies.impl.DefaultAutoAccommodationAllocationStrategy
findAvailableSeat, getAccommodationMapConfiguration, getAccommodationMapService, getCommerceStockService, getConfiguredAccomNumberComparator, getFirstAvailableSeat, getModelService, getSelectedAccommodations, getTransportOfferings, getTransportOfferingTravelAccommodationMap, getTravellerService, getTravelRoute, isSeatAllocatedForTravellerInTransportOffering, isSeatAvailable, saveAllocatedAccomodations, setAccommodationMapService, setCommerceStockService, setConfiguredAccomNumberComparator, setModelService, setTravellerService
-
Constructor Details
-
DefaultShoppingAutoAccommodationAllocationStrategy
public DefaultShoppingAutoAccommodationAllocationStrategy()
-
-
Method Details
-
autoAllocateSeat
public void autoAllocateSeat(AbstractOrderModel abstractOrderModel, Integer legNumber, List<String> travellerReferences) This strategy follows one rule that is to allocate the first available seat. Accommodation types are represented in the following hierarchy Decks -> Cabin -> Rows -> Columns -> Seats. So, finding the first seat available, resembles the traditional DFS(Depth first search) algorithm.- Specified by:
autoAllocateSeatin interfaceAutoAccommodationAllocationStrategy- Overrides:
autoAllocateSeatin classDefaultAutoAccommodationAllocationStrategy- Parameters:
abstractOrderModel- the abstract order modellegNumber- the leg numbertravellerReferences- the traveller references
-
getTransportOfferingTravelAccommodationMap
protected void getTransportOfferingTravelAccommodationMap(AbstractOrderModel abstractOrderModel, List<TravellerModel> travellers, Map<TransportOfferingModel, Map<TravellerModel, ConfiguredAccommodationModel>> transportOfferingTravellerAccomodationMap, TransportOfferingModel transportOffering, Optional<TransportVehicleInfoModel> vehicleInfo, long numberOfSeatsToAllocate) Gets the accommodation map- Parameters:
abstractOrderModel- the abstract order modeltravellers- the travellerstransportOfferingTravellerAccomodationMap- the transportOfferingTravellerAccomodationMaptransportOffering- the transportOfferingvehicleInfo- the vehicleInfonumberOfSeatsToAllocate- the number of seats to allocate
-
getShoppingAccommodationMapService
Gets the shoppingAccommodationMapService- Returns:
- the shoppingAccommodationMapService
-
setShoppingAccommodationMapService
public void setShoppingAccommodationMapService(ShoppingAccommodationMapService shoppingAccommodationMapService) Sets the shoppingAccommodationMapService- Parameters:
shoppingAccommodationMapService- the shoppingAccommodationMapService
-