Class DefaultDealBundleTemplateFacade

java.lang.Object
de.hybris.platform.travelfacades.facades.packages.impl.DefaultDealBundleTemplateFacade
All Implemented Interfaces:
DealBundleTemplateFacade

public class DefaultDealBundleTemplateFacade extends Object implements DealBundleTemplateFacade
Default implementation of the DealBundleTemplateFacade
  • Constructor Details

    • DefaultDealBundleTemplateFacade

      public DefaultDealBundleTemplateFacade()
  • Method Details

    • getFormattedDealValidDates

      public List<String> getFormattedDealValidDates(String dealStartingDatePattern, String dealDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates in dd/MM/yyyy format for the availability of the deal based on the dealStartingPattern and the given date.
      Specified by:
      getFormattedDealValidDates in interface DealBundleTemplateFacade
      Parameters:
      dealStartingDatePattern - cronJob expression representing the valid dates for deal.
      dealDepartureDate - the date to use as a startingDate for the deal requested
      Returns:
      the list of valid dates
    • getDealValidDates

      public List<Date> getDealValidDates(String dealStartingDatePattern, String dealDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern and the given date.
      Specified by:
      getDealValidDates in interface DealBundleTemplateFacade
      Parameters:
      dealStartingDatePattern - cronJob expression representing the valid dates for deal.
      dealDepartureDate - the date to use as a startingDate for the deal requested
      Returns:
      the list of valid dates
    • getDealValidDates

      public List<Date> getDealValidDates(String dealStartingDatePattern, Date dealDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern and the given date.
      Specified by:
      getDealValidDates in interface DealBundleTemplateFacade
      Parameters:
      dealStartingDatePattern - cronJob expression representing the valid dates for deal.
      dealDepartureDate - the date to use as a startingDate for the deal requested
      Returns:
      the list of valid dates
    • getDealValidDates

      public Set<Date> getDealValidDates(DealBundleTemplateModel bundleTemplateModel, Date dealDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern, availabilityDates and the given date range in the yyyy-MM-dd format.
      Specified by:
      getDealValidDates in interface DealBundleTemplateFacade
      Parameters:
      bundleTemplateModel - the bundleTemplateModel
      dealDepartureDate - the date to use as a startingDate for the deal requested
      Returns:
      the set of valid dates
    • getDealValidDatesFromRange

      public Set<Date> getDealValidDatesFromRange(String dealId, Date startingDate, Date endingDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern, availabilityDates and the given date range in the yyyy-MM-dd format.
      Specified by:
      getDealValidDatesFromRange in interface DealBundleTemplateFacade
      Parameters:
      dealId - the dealId
      startingDate - the date to use as a startingDate for the deal requested
      endingDate - the date to use as a endingDate for the deal requested
      Returns:
      the list of valid dates
    • getDealValidDatesFromRange

      public Set<Date> getDealValidDatesFromRange(DealBundleTemplateModel bundleTemplateModel, String startingDate, String endingDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern, availabilityDates and the given date range in the yyyy-MM-dd format.
      Specified by:
      getDealValidDatesFromRange in interface DealBundleTemplateFacade
      Parameters:
      bundleTemplateModel - the bundleTemplateModel
      startingDate - the date to use as a startingDate for the deal requested
      endingDate - the date to use as a endingDate for the deal requested
      Returns:
      the list of valid dates
    • getDealBundleDates

      protected Set<Date> getDealBundleDates(DealBundleTemplateModel bundleTemplateModel, Date dealStartDate, Date dealEndDate)
      Get all the available deal date within the given range taking care of startingDatePattern and availabilityDates
      Parameters:
      bundleTemplateModel - the bundleTemplateModel
      dealStartDate - the dealStartDate
      dealEndDate - the dealEndDate
      Returns:
      Set
    • getFormattedDealValidDatesFromRange

      public Set<String> getFormattedDealValidDatesFromRange(DealBundleTemplateModel bundleTemplateModel, String startingDate, String endingDate)
      Description copied from interface: DealBundleTemplateFacade
      Evaluates valid dates for the availability of the deal based on the dealStartingPattern, availabilityDates and the given date range in the yyyy-MM-dd format.
      Specified by:
      getFormattedDealValidDatesFromRange in interface DealBundleTemplateFacade
      Parameters:
      bundleTemplateModel - the bundleTemplateModel
      startingDate - the date to use as a startingDate for the deal requested
      endingDate - the date to use as a endingDate for the deal requested
      Returns:
      the list of valid dates in the yyyy-MM-dd format
    • getPackageRequestData

      public PackageRequestData getPackageRequestData(String dealBundleTemplateId, String selectedDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Returns the PackageRequestData populated from the given dealBundleTemplateId
      Specified by:
      getPackageRequestData in interface DealBundleTemplateFacade
      Parameters:
      dealBundleTemplateId - the dealBundleTemplateId to use to populate the PackagesResponseData
      selectedDepartureDate - the date to use as a selectedDepartureDate for the deal requested
      Returns:
      the PackageRequestData
    • getPackageRequestData

      @Deprecated protected PackageRequestData getPackageRequestData(String dealBundleTemplateId, Date departureDate)
      Deprecated.
      since version 2003
      the logic was moved to pipeline manager to be configurable for different search flows
      use DealSearchRequestPipelineManager.executePipeline(DealBundleTemplateModel, Date) instead.
      Builds package request data for the given deal id and departure date
      Parameters:
      dealBundleTemplateId - the deal bundle template id
      departureDate - the departure date
      Returns:
      the PackageRequestData
    • getDealBundleTemplateById

      public DealBundleTemplateModel getDealBundleTemplateById(String dealBundleTemplateId)
      Description copied from interface: DealBundleTemplateFacade
      Returns the DealBundleTemplateModel corresponding to the given dealBundleTemplateId
      Specified by:
      getDealBundleTemplateById in interface DealBundleTemplateFacade
      Parameters:
      dealBundleTemplateId - the id of the DealBundleTemplate
      Returns:
      the DealBundleTemplateModel corresponding to the given id, null if no DealBundleTemplates are found.
    • getDealValidCronJobExpressionById

      public String getDealValidCronJobExpressionById(String dealBundleTemplateId)
      Description copied from interface: DealBundleTemplateFacade
      Returns the CronJobExpression for the deal availability corresponding to the given dealBundleTemplateId
      Specified by:
      getDealValidCronJobExpressionById in interface DealBundleTemplateFacade
      Parameters:
      dealBundleTemplateId - the id of the DealBundleTemplate
      Returns:
      the cronJobExpression corresponding to the given id, Empty if no DealBundleTemplates are found.
    • getTransportPackageRequest

      protected TransportPackageRequestData getTransportPackageRequest(DealBundleTemplateModel dealBundleTemplateModel, Date departureDate, Date returnDate)
      Returns the TransportPackageRequest created for the given dealBundleTemplate
      Parameters:
      dealBundleTemplateModel - the dealBundleTemplateModel
      departureDate - the departureDate
      returnDate - the returnDate
      Returns:
      the TransportPackageRequestData
    • getFareSearchRequest

      protected FareSearchRequestData getFareSearchRequest(BundleTemplateModel transportBundleTemplateModel, Date departureDate, Date returnDate)
      Returns the FareSearchRequestData created from the given transportBundleTemplateModel
      Parameters:
      transportBundleTemplateModel - the transportBundleTemplateModel
      departureDate - the departureDate
      returnDate - the returnDate
      Returns:
      the FareSearchRequestData
    • createPassengerTypeQuantities

      protected List<PassengerTypeQuantityData> createPassengerTypeQuantities(BundleTemplateModel bundleTemplateModel)
      Returns the list of PassengerTypeQuantityData created from the given GuestCountModel list
      Parameters:
      bundleTemplateModel - the list of GuestCountModel
      Returns:
      List
    • getAccommodationPackageRequest

      protected AccommodationPackageRequestData getAccommodationPackageRequest(DealBundleTemplateModel dealBundleTemplateModel, Date departureDate, Date returnDate)
      Returns the AccommodationPackageRequest created for the given dealBundleTemplate
      Parameters:
      dealBundleTemplateModel - the dealBundleTemplateModel
      departureDate - the departureDate
      returnDate - the returnDate
      Returns:
      the AccommodationPackageRequest
    • getAccommodationAvailabilityRequest

      protected AccommodationAvailabilityRequestData getAccommodationAvailabilityRequest(AccommodationBundleTemplateModel accommodationBundleTemplateModel, Date departureDate, Date returnDate)
      Returns the AccommodationAvailabilityRequestData created from the given accommodationBundleTemplateModel
      Parameters:
      accommodationBundleTemplateModel - the accommodationBundleTemplateModel
      departureDate - the departureDate
      returnDate - the returnDate
      Returns:
      the AccommodationAvailabilityRequestData
    • getBundleTemplates

      protected List<BundleTemplateData> getBundleTemplates(DealBundleTemplateModel dealBundleTemplateModel)
      Returns the list of BundleTemplateData created for the given dealBundleTemplate
      Parameters:
      dealBundleTemplateModel - the dealBundleTemplateModel
      Returns:
      the list of BundleTemplateData
    • getFirstDealDate

      protected Date getFirstDealDate(DealBundleTemplateModel dealBundleTemplateModel)
      Returns the first date from the current date that matches the startingDate pattern and availability dates for the given packageId
      Parameters:
      dealBundleTemplateModel - the dealBundleTemplateModel
      Returns:
      the first date from the current date that matches the startingDate pattern for the given packageId
    • getPackageResponseDetails

      public PackagesResponseData getPackageResponseDetails(PackageRequestData packageRequestData)
      Description copied from interface: DealBundleTemplateFacade
      Performs a search for the DealBundleTemplate based on the PackagesRequestData and the given date.
      Specified by:
      getPackageResponseDetails in interface DealBundleTemplateFacade
      Parameters:
      packageRequestData - the PackageRequestData
      Returns:
      the PackageRequestData with the deal bundle template details matching the request parameters and the given starting date
    • isDealBundleTemplateMatchesCart

      public boolean isDealBundleTemplateMatchesCart(String dealBundleTemplateId)
      Description copied from interface: DealBundleTemplateFacade
      Checks if the deal bundle template exists in the cart.
      Specified by:
      isDealBundleTemplateMatchesCart in interface DealBundleTemplateFacade
      Parameters:
      dealBundleTemplateId - the deal bundle template id
      Returns:
      the boolean
    • isDepartureDateInCartEquals

      public boolean isDepartureDateInCartEquals(Date dealDepartureDate)
      Description copied from interface: DealBundleTemplateFacade
      Checks if is departure date in cart equals.
      Specified by:
      isDepartureDateInCartEquals in interface DealBundleTemplateFacade
      Parameters:
      dealDepartureDate - the deal departure date
      Returns:
      true, if is departure date in cart equals
    • isDealAbstractOrder

      public boolean isDealAbstractOrder(AbstractOrderModel abstractOrderModel)
      Description copied from interface: DealBundleTemplateFacade
      Checks whether given abstract order contains a deal
      Specified by:
      isDealAbstractOrder in interface DealBundleTemplateFacade
      Returns:
    • getDealBundleTemplateIdFromAbstractOrder

      public String getDealBundleTemplateIdFromAbstractOrder(AbstractOrderModel abstractOrderModel)
      Description copied from interface: DealBundleTemplateFacade
      Returns the deal bundle template id contained in the given abstract order. It returns an empty string if the abstractOrder doesn't contain any deal.
      Specified by:
      getDealBundleTemplateIdFromAbstractOrder in interface DealBundleTemplateFacade
      Parameters:
      abstractOrderModel - as the abstract order model
      Returns:
      a string corresponding to the deal bundle template id
    • getBundleTemplateFromEntryGroup

      protected BundleTemplateModel getBundleTemplateFromEntryGroup(AbstractOrderEntryModel entryModel)
      Gets bundle template from entry group.
      Parameters:
      entryModel - the entry model
      Returns:
      the bundle template from entry group
    • getDealBundleTemplateService

      protected DealBundleTemplateService getDealBundleTemplateService()
      Returns:
      the dealBundleTemplateService
    • setDealBundleTemplateService

      public void setDealBundleTemplateService(DealBundleTemplateService dealBundleTemplateService)
      Parameters:
      dealBundleTemplateService - the dealBundleTemplateService to set
    • getPassengerTypeConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<PassengerTypeModel,PassengerTypeData> getPassengerTypeConverter()
      Returns:
      the passengerTypeConverter
    • setPassengerTypeConverter

      public void setPassengerTypeConverter(de.hybris.platform.servicelayer.dto.converter.Converter<PassengerTypeModel,PassengerTypeData> passengerTypeConverter)
      Parameters:
      passengerTypeConverter - the passengerTypeConverter to set
    • getDealBundleTemplateConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel,BundleTemplateData> getDealBundleTemplateConverter()
      Returns:
      the dealBundleTemplateConverter
    • setDealBundleTemplateConverter

      public void setDealBundleTemplateConverter(de.hybris.platform.servicelayer.dto.converter.Converter<BundleTemplateModel,BundleTemplateData> dealBundleTemplateConverter)
      Parameters:
      dealBundleTemplateConverter - the dealBundleTemplateConverter to set
    • getDealOriginDestinationInfoDataConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<RouteBundleTemplateModel,DealOriginDestinationInfoData> getDealOriginDestinationInfoDataConverter()
      Gets deal origin destination info data converter.
      Returns:
      the deal origin destination info data converter
    • setDealOriginDestinationInfoDataConverter

      public void setDealOriginDestinationInfoDataConverter(de.hybris.platform.servicelayer.dto.converter.Converter<RouteBundleTemplateModel,DealOriginDestinationInfoData> dealOriginDestinationInfoDataConverter)
      Sets deal origin destination info data converter.
      Parameters:
      dealOriginDestinationInfoDataConverter - the deal origin destination info data converter
    • getTimeService

      protected de.hybris.platform.servicelayer.time.TimeService getTimeService()
      Returns:
      the timeService
    • setTimeService

      public void setTimeService(de.hybris.platform.servicelayer.time.TimeService timeService)
      Parameters:
      timeService - the timeService to set
    • getDealSearchResponsePipelineManager

      protected DealSearchResponsePipelineManager getDealSearchResponsePipelineManager()
      Returns:
      the dealSearchResponsePipelineManager
    • setDealSearchResponsePipelineManager

      public void setDealSearchResponsePipelineManager(DealSearchResponsePipelineManager dealSearchResponsePipelineManager)
      Parameters:
      dealSearchResponsePipelineManager - the dealSearchResponsePipelineManager to set
    • getCartService

      protected de.hybris.platform.order.CartService getCartService()
      Returns:
      the cartService
    • setCartService

      public void setCartService(de.hybris.platform.order.CartService cartService)
      Parameters:
      cartService - the cartService to set
    • getBundleTemplateService

      protected de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService getBundleTemplateService()
      Returns:
      the bundleTemplateService
    • setBundleTemplateService

      public void setBundleTemplateService(de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService bundleTemplateService)
      Parameters:
      bundleTemplateService - the bundleTemplateService to set
    • getDealService

      protected DealService getDealService()
      Get dealService
      Returns:
      dealService
    • setDealService

      public void setDealService(DealService dealService)
      Set dealService
      Parameters:
      dealService - the dealService