Class DefaultNDCCarrierOfferDataValidationStrategy
java.lang.Object
de.hybris.platform.ndc182shoppingfacades.facades.order.strategies.impl.DefaultNDCCarrierOfferDataValidationStrategy
- All Implemented Interfaces:
OrderCreateRequestValidationStrategy<NDCCarrierOfferData>
public class DefaultNDCCarrierOfferDataValidationStrategy
extends Object
implements OrderCreateRequestValidationStrategy<NDCCarrierOfferData>
The ndc 18.2 implementation of
OrderCreateRequestValidationStrategy interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected de.hybris.platform.servicelayer.config.ConfigurationServiceGets configuration service.protected NDCPassengerTypeServiceGets ndc passenger type service.protected TransportFacilityServiceGets transport facility service.protected TransportOfferingServiceGets transport offering service.voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.voidsetNdcPassengerTypeService(NDCPassengerTypeService ndcPassengerTypeService) Sets ndc passenger type service.voidsetTransportFacilityService(TransportFacilityService transportFacilityService) Sets transport facility service.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidvalidate(List<NDCCarrierOfferData> ndcOfferDataList, IATAOrderCreateRQ orderCreateRQ) This method validates a NDCCarrierOfferData.protected voidvalidateFlights(NDCCarrierOfferData ndcCarrierOfferData, List<PaxSegmentType> paxSegmentList) Validates all the (distinct) transport offerings included in the offer.protected voidvalidateNdcOfferDataByPaxList(List<NDCPassengerData> ndcPassengerDataList, List<String> selectedOfferPaxList, List<PaxType> paxTypeList) Validates the ndc offer data by pax list.protected voidvalidateOffer(NDCCarrierOfferData carrierOfferData, SelectedOfferType selectedOffer, List<PaxType> paxList) This method checks if each offer listed in the orderCreateRQ message is identical to the offer (with the same ID) retrieved from the cache.protected voidvalidatePaxSegment(TransportOfferingModel transportOfferingModel, PaxSegmentType paxSegment) This method verifies if the paxSegment associated to the transport offering has the same informations (dep/arrival date, flight number, origin/destination location codes and carrierDesignCode).protected voidvalidatePaxSegmentDepartureAndArrivalDate(PaxSegmentType paxSegment, TransportOfferingModel transportOfferingModel, String transportOfferingCode) Validates pax segment departure and arrival date.
-
Constructor Details
-
DefaultNDCCarrierOfferDataValidationStrategy
public DefaultNDCCarrierOfferDataValidationStrategy()
-
-
Method Details
-
validate
public void validate(List<NDCCarrierOfferData> ndcOfferDataList, IATAOrderCreateRQ orderCreateRQ) throws NDCException This method validates a NDCCarrierOfferData. Checks if 1) the offer is identical to the one in the orderCreateRQ message, 2) all the distinct transport offerings included in the offer are present in the paxSegmentList of the request message, 3) the journey is not an open journey (the destination of the inbound (if present) is equal to the origin of the outbound.- Specified by:
validatein interfaceOrderCreateRequestValidationStrategy<NDCCarrierOfferData>- Parameters:
ndcOfferDataList- the ndcOfferDataListorderCreateRQ- the orderCreateRQ- Throws:
NDCException
-
validateOffer
protected void validateOffer(NDCCarrierOfferData carrierOfferData, SelectedOfferType selectedOffer, List<PaxType> paxList) throws NDCException This method checks if each offer listed in the orderCreateRQ message is identical to the offer (with the same ID) retrieved from the cache.- Parameters:
carrierOfferData- the carrier offer dataselectedOffer- the selected offerpaxList- the pax list- Throws:
NDCException- the ndc exception
-
validateNdcOfferDataByPaxList
protected void validateNdcOfferDataByPaxList(List<NDCPassengerData> ndcPassengerDataList, List<String> selectedOfferPaxList, List<PaxType> paxTypeList) throws NDCException Validates the ndc offer data by pax list. For each offerItem checks if the list of the passengers (and the type) is the same. Note that an offerItem has the type of passenger in its paxList.- Parameters:
ndcPassengerDataList- the ndcPassengerDataListselectedOfferPaxList- the selectedOfferPaxListpaxTypeList- the pax type list- Throws:
NDCException- the ndc exception
-
validateFlights
protected void validateFlights(NDCCarrierOfferData ndcCarrierOfferData, List<PaxSegmentType> paxSegmentList) throws NDCException Validates all the (distinct) transport offerings included in the offer. For each transport offering retrieves the transport offering model from the db and (if exists) verifies if: 1) the departure date is in the future, 2) the transport offering is listed in the paxSegmentList and all the informations in the paxSegment are identical.- Parameters:
ndcCarrierOfferData- the ndc carrier offer datapaxSegmentList- the pax segment list- Throws:
NDCException- the ndc exception
-
validatePaxSegment
protected void validatePaxSegment(TransportOfferingModel transportOfferingModel, PaxSegmentType paxSegment) throws NDCException This method verifies if the paxSegment associated to the transport offering has the same informations (dep/arrival date, flight number, origin/destination location codes and carrierDesignCode).- Parameters:
transportOfferingModel- the transport offering modelpaxSegment- the pax segment- Throws:
NDCException- the ndc exception
-
validatePaxSegmentDepartureAndArrivalDate
protected void validatePaxSegmentDepartureAndArrivalDate(PaxSegmentType paxSegment, TransportOfferingModel transportOfferingModel, String transportOfferingCode) throws NDCException Validates pax segment departure and arrival date.- Parameters:
paxSegment- the pax segmenttransportOfferingModel- the transport offering modeltransportOfferingCode- the transport offering code- Throws:
NDCException- the ndc exception
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transport offering service
-
setTransportOfferingService
Sets transport offering service.- Parameters:
transportOfferingService- the transport offering service
-
getTransportFacilityService
Gets transport facility service.- Returns:
- the transport facility service
-
setTransportFacilityService
Sets transport facility service.- Parameters:
transportFacilityService- the transport facility service
-
getNdcPassengerTypeService
Gets ndc passenger type service.- Returns:
- the ndc passenger type service
-
setNdcPassengerTypeService
Sets ndc passenger type service.- Parameters:
ndcPassengerTypeService- the ndc passenger type service
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()Gets configuration service.- Returns:
- the configuration service
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.- Parameters:
configurationService- the configuration service
-