Class DefaultShoppingMerchandisingFacade
java.lang.Object
de.hybris.platform.shoppingfacades.facades.impl.DefaultShoppingMerchandisingFacade
- All Implemented Interfaces:
ShoppingMerchandisingFacade
- Direct Known Subclasses:
DefaultPROSMerchandisingFacade
public abstract class DefaultShoppingMerchandisingFacade
extends Object
implements ShoppingMerchandisingFacade
The Shopping implementation of the
ShoppingMerchandisingFacade interface. This abstract class performs the ancillary
search through the merchandising API.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcreateMerchandisingChangeFee(Integer entryId) This method creates a change fee when an existing merchandising entry is updated, removed or deleted.protected abstract AncillaryResponseDatacreateShoppingAncillaries(List<String> transportOfferingCodes) This method creates and sends a merchandising request in order to retrieve all the available ancillaries.protected abstract BaggageResponseDatacreateShoppingBaggages(List<String> transportOfferingCodes) This method creates and sends a merchandising request in order to retrieve all the available charged baggages.protected voiddiscardAncillaryProducts(List<String> returnedProducts, AncillaryResponseData ancillaryResponseData) This method filters out the ancillary products that should be evaluated as part of the rules but not returned after rule evaluationprotected voiddiscardBaggageProducts(List<String> returnedProducts, BaggageResponseData baggageResponseData) This method filters out the products that should be evaluated as part of the rules but not returned after rule evaluationprotected voidfilterAncillaryProducts(OfferRequestData offerRequestData, AncillaryResponseData ancillaryResponseData) This method shows ancillary products that are evaluated using rulesprotected voidfilterBaggageProducts(OfferRequestData offerRequestData, BaggageResponseData baggageResponseData) This method shows baggage products that are evaluated using rulesprotected de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData,AncillaryResponseData> Gets ancillary response data converter.protected TravelCartServiceGets cart service.protected OffersFacadeGets offers facade.protected TransportOfferingServiceGets transport offering service.protected TravelRulesServiceGets travel rules service.protected voidpopulateCommerceAncillaries(OfferRequestData offerRequest, AncillaryResponseData ancillaryResponseData, List<String> transportOfferingCodes) Populate commerce ancillaries.protected voidpopulateCommerceBaggageProducts(BaggageResponseData baggageResponseData) Populates the baggage Response Data with commerce baggage products.searchAncillaries(List<String> transportOfferingCodes) This method performs the merchandising request for searching all the available ancillaries.This method performs the merchandising request for searching all the available baggages.searchBaggages(List<String> transportOfferingCodes) This method performs the merchandising request for searching all the charged baggages.voidsetAncillaryResponseDataConverter(de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData, AncillaryResponseData> ancillaryResponseDataConverter) Sets ancillary response data converter.voidsetCartService(TravelCartService cartService) Sets cart service.voidsetOffersFacade(OffersFacade offersFacade) Sets offers facade.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidsetTravelRulesService(TravelRulesService travelRulesService) Sets travel rules service.abstract voidvalidateMerchandisingEntries(AbstractOrderModel orderModel) Validate shopping ancillaries in the cart with merchandising response.
-
Constructor Details
-
DefaultShoppingMerchandisingFacade
public DefaultShoppingMerchandisingFacade()
-
-
Method Details
-
searchAncillaries
public AncillaryResponseData searchAncillaries(List<String> transportOfferingCodes) throws MerchandisingRequestException, InvalidSessionCartException, FarePriceException This method performs the merchandising request for searching all the available ancillaries. The response will enriched with commerce ancillaries and will be filtered accordingly to the list of flights and by visibility rules.- Specified by:
searchAncillariesin interfaceShoppingMerchandisingFacade- Parameters:
transportOfferingCodes- the list of flight codes to be used in order to filter the merchandising response- Returns:
- the AncillaryResponseData
- Throws:
MerchandisingRequestException- to be thrown when a bad request response is returned from the merchandising api call.InvalidSessionCartException- to be thrown either when there is no cart in the session or when the cart is empty.FarePriceException- to be thrown when a fare price response is missing in the cart.
-
searchBaggages
public BaggageResponseData searchBaggages() throws MerchandisingRequestException, InvalidSessionCartException, FarePriceExceptionThis method performs the merchandising request for searching all the available baggages. The response will be enriched with commerce baggage products and filtered by visibility rules.- Specified by:
searchBaggagesin interfaceShoppingMerchandisingFacade- Returns:
- the BaggageResponseData
- Throws:
MerchandisingRequestException- thrown when an errors occurs during a merchandising requestInvalidSessionCartException- thrown when there is no cart in the sessionFarePriceException- thrown when an error occurs during a fare price request.
-
populateCommerceBaggageProducts
Populates the baggage Response Data with commerce baggage products.- Parameters:
baggageResponseData- the baggage response data
-
validateMerchandisingEntries
public abstract void validateMerchandisingEntries(AbstractOrderModel orderModel) throws TravelCartValidationException Description copied from interface:ShoppingMerchandisingFacadeValidate shopping ancillaries in the cart with merchandising response.- Specified by:
validateMerchandisingEntriesin interfaceShoppingMerchandisingFacade- Parameters:
orderModel- the cart model- Throws:
TravelCartValidationException
-
searchBaggages
public BaggageResponseData searchBaggages(List<String> transportOfferingCodes) throws MerchandisingRequestException, InvalidSessionCartException, FarePriceException This method performs the merchandising request for searching all the charged baggages. The response will be filtered accordingly to the list of flights.- Specified by:
searchBaggagesin interfaceShoppingMerchandisingFacade- Parameters:
transportOfferingCodes- the list of flight codes to be used in order to filter the merchandising response- Returns:
- the BaggageResponseData
- Throws:
MerchandisingRequestException- to be thrown when a bad request response is returned from the merchandising api call.InvalidSessionCartException- to be thrown either when there is no cart in the session or when the cart is empty.FarePriceException- to be thrown when a fare price response is missing in the cart.
-
createMerchandisingChangeFee
Description copied from interface:ShoppingMerchandisingFacadeThis method creates a change fee when an existing merchandising entry is updated, removed or deleted.- Specified by:
createMerchandisingChangeFeein interfaceShoppingMerchandisingFacade- Parameters:
entryId- the entry id- Throws:
CancelFlightException- the cancel flight exception
-
createShoppingBaggages
protected abstract BaggageResponseData createShoppingBaggages(List<String> transportOfferingCodes) throws InvalidSessionCartException, FarePriceException, MerchandisingRequestException This method creates and sends a merchandising request in order to retrieve all the available charged baggages. The response will be filtered accordingly to the list of flights and converted in a BaggageResponseData.- Parameters:
transportOfferingCodes- the list of flight codes- Returns:
- the BaggageResponseData
- Throws:
InvalidSessionCartExceptionFarePriceExceptionMerchandisingRequestException
-
createShoppingAncillaries
protected abstract AncillaryResponseData createShoppingAncillaries(List<String> transportOfferingCodes) throws MerchandisingRequestException, InvalidSessionCartException, FarePriceException This method creates and sends a merchandising request in order to retrieve all the available ancillaries. The response will be filtered accordingly to the list of flights and converted in an AncillaryResponseData.- Parameters:
transportOfferingCodes- the list of flight codes- Returns:
- the AncillaryResponseData
- Throws:
MerchandisingRequestException- the merchandising request exceptionInvalidSessionCartException- the invalid session cart exceptionFarePriceException- the fare price exception
-
populateCommerceAncillaries
protected void populateCommerceAncillaries(OfferRequestData offerRequest, AncillaryResponseData ancillaryResponseData, List<String> transportOfferingCodes) Populate commerce ancillaries.- Parameters:
offerRequest- the offer requestancillaryResponseData- the ancillary response datatransportOfferingCodes- the transport offering codes
-
filterAncillaryProducts
protected void filterAncillaryProducts(OfferRequestData offerRequestData, AncillaryResponseData ancillaryResponseData) This method shows ancillary products that are evaluated using rules- Parameters:
offerRequestData- the offer request dataancillaryResponseData- the ancillary response data
-
discardAncillaryProducts
protected void discardAncillaryProducts(List<String> returnedProducts, AncillaryResponseData ancillaryResponseData) This method filters out the ancillary products that should be evaluated as part of the rules but not returned after rule evaluation- Parameters:
returnedProducts- the returned productsancillaryResponseData- the ancillary response data
-
filterBaggageProducts
protected void filterBaggageProducts(OfferRequestData offerRequestData, BaggageResponseData baggageResponseData) This method shows baggage products that are evaluated using rules- Parameters:
offerRequestData- the offer request databaggageResponseData- the baggage response data
-
discardBaggageProducts
protected void discardBaggageProducts(List<String> returnedProducts, BaggageResponseData baggageResponseData) This method filters out the products that should be evaluated as part of the rules but not returned after rule evaluation- Parameters:
returnedProducts- the returned productsbaggageResponseData- the baggage response data
-
getCartService
Gets cart service.- Returns:
- the cart service
-
setCartService
Sets cart service.- Parameters:
cartService- the cart service
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transport offering
-
setTransportOfferingService
Sets transport offering service.- Parameters:
transportOfferingService- the transport offering service
-
getOffersFacade
Gets offers facade.- Returns:
- the offers facade
-
setOffersFacade
Sets offers facade.- Parameters:
offersFacade- the offers facade
-
getTravelRulesService
Gets travel rules service.- Returns:
- the travelRulesService
-
setTravelRulesService
Sets travel rules service.- Parameters:
travelRulesService- the travelRulesService to set
-
getAncillaryResponseDataConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData,AncillaryResponseData> getAncillaryResponseDataConverter()Gets ancillary response data converter.- Returns:
- the ancillary response data converter
-
setAncillaryResponseDataConverter
public void setAncillaryResponseDataConverter(de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData, AncillaryResponseData> ancillaryResponseDataConverter) Sets ancillary response data converter.- Parameters:
ancillaryResponseDataConverter- the ancillary response data converter
-