Class DefaultTransportOfferingService

java.lang.Object
de.hybris.platform.travelservices.services.impl.DefaultTransportOfferingService
All Implemented Interfaces:
TransportOfferingService
Direct Known Subclasses:
DefaultBackofficeTransportOfferingService, DefaultShoppingTransportOfferingService

public class DefaultTransportOfferingService extends Object implements TransportOfferingService
Default implementation of TransportOfferingService
  • Constructor Details

    • DefaultTransportOfferingService

      public DefaultTransportOfferingService()
  • Method Details

    • getTransportOfferings

      public List<TransportOfferingModel> getTransportOfferings(String number, Date departureDate)
      Description copied from interface: TransportOfferingService
      Get a list of TransportOfferingModel by number and departureDate.
      Specified by:
      getTransportOfferings in interface TransportOfferingService
      Parameters:
      number - the number of requested transport offering
      departureDate - the departure date of requested transport offering
      Returns:
      List transport offerings
    • getTransportOffering

      public TransportOfferingModel getTransportOffering(String code)
      Description copied from interface: TransportOfferingService
      Get a TransportOfferingModel by code.
      Specified by:
      getTransportOffering in interface TransportOfferingService
      Parameters:
      code - the unique code for a transport offering
      Returns:
      TransportOfferingModel transport offering
    • getTransportOfferings

      public List<TransportOfferingModel> getTransportOfferings()
      Description copied from interface: TransportOfferingService
      Get a list of all TransportOfferingModel configured in the system.
      Specified by:
      getTransportOfferings in interface TransportOfferingService
      Returns:
      List transport offerings
    • getTransportOfferings

      public List<TransportOfferingModel> getTransportOfferings(Collection<String> transportOfferingCodes)
      Description copied from interface: TransportOfferingService
      Returns a list of TransportOfferingModel based on the given list of codes.
      Specified by:
      getTransportOfferings in interface TransportOfferingService
      Parameters:
      transportOfferingCodes - the collection of codes
      Returns:
      the list of Transport Offerings found
    • getTransportOfferingsMap

      public Map<String,TransportOfferingModel> getTransportOfferingsMap(Collection<String> transportOfferingCodes)
      Description copied from interface: TransportOfferingService
      Returns a map with keys being Transport Offering codes and as values the respective TransportOfferingModel.
      Specified by:
      getTransportOfferingsMap in interface TransportOfferingService
      Parameters:
      transportOfferingCodes - the collection of codes
      Returns:
      the map of Transport Offering
    • getTransportOfferingsFromOrderEntries

      public List<TransportOfferingModel> getTransportOfferingsFromOrderEntries(List<AbstractOrderEntryModel> orderEntryList)
      Description copied from interface: TransportOfferingService
      Method takes a list of AbstractOrderEntryModel and turns a unique list of transport offering models
      Specified by:
      getTransportOfferingsFromOrderEntries in interface TransportOfferingService
      Parameters:
      orderEntryList - the order entry list
      Returns:
      transport offerings from order entries
    • createTransportOfferingForScheduleConfiguration

      public List<TransportOfferingModel> createTransportOfferingForScheduleConfiguration(ScheduleConfigurationModel scheduleConfiguration)
      Description copied from interface: TransportOfferingService
      Returns a list of TransportOfferingModels generated from a given ScheduleConfigurationModel.
      Specified by:
      createTransportOfferingForScheduleConfiguration in interface TransportOfferingService
      Returns:
    • doIterateScheduleConfiguration

      protected TransportOfferingModel doIterateScheduleConfiguration(ScheduleConfigurationModel scheduleConfiguration, LocalDate date)
      Method iterates ScheduleConfigurationDayModel and create TransportOfferingModel if configured scheduleConfigurationDay's DayOfWeek matches with date.
      Parameters:
      scheduleConfiguration - the schedule configuration
      date - the date
      Returns:
      the transport offering model
    • validateUniqueTransportOfferingCode

      protected boolean validateUniqueTransportOfferingCode(String code)
      Parameters:
      code -
      Returns:
    • populateTransportOffering

      protected void populateTransportOffering(ScheduleConfigurationDayModel scheduleConfigurationDay, TransportOfferingModel transportOffering, ScheduleConfigurationModel scheduleConfiguration, LocalDate date)
      Parameters:
      scheduleConfigurationDay - the schedule configuration day
      transportOffering - the transport offering
      scheduleConfiguration - the schedule configuration
      date - the date
    • getArrivalTime

      protected Date getArrivalTime(ScheduleConfigurationModel scheduleConfiguration, ScheduleConfigurationDayModel scheduleConfigurationDay, TransportOfferingModel transportOffering)
      Method returns the flight arrival time(considering time zone) by adding flight duration to departure time.
      Parameters:
      scheduleConfiguration - the schedule configuration
      scheduleConfigurationDay - the schedule configuration day
      transportOffering - the transport offering
      Returns:
      the arrival time
    • getDepartureTime

      protected Date getDepartureTime(LocalDate date, Date departureTime, ScheduleConfigurationModel scheduleConfiguration)
      Method returns the flight departure time by combining start date and time.
      Parameters:
      date - the date
      departureTime - the departure time
      scheduleConfiguration - the schedule configuration
      Returns:
      the departure time
    • isTransportOfferingInThePast

      public boolean isTransportOfferingInThePast(TransportOfferingModel transportOfferingModel)
      Return true if the transport offering provided is in the past
      Specified by:
      isTransportOfferingInThePast in interface TransportOfferingService
      Parameters:
      transportOfferingModel - the TransportOfferingModel
      Returns:
      true if the departure date of the transport offering is in the past.
    • getTransportOfferingDao

      protected TransportOfferingDao getTransportOfferingDao()
      Returns:
      the transportOfferingDao
    • setTransportOfferingDao

      public void setTransportOfferingDao(TransportOfferingDao transportOfferingDao)
      Parameters:
      transportOfferingDao - the transportOfferingDao to set
    • getModelService

      public de.hybris.platform.servicelayer.model.ModelService getModelService()
      Returns:
      the modelService
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Parameters:
      modelService - the modelService to set
    • getTravelVendorService

      protected TravelVendorService getTravelVendorService()
      Gets travel vendor service.
      Returns:
      the travel vendor service
    • setTravelVendorService

      public void setTravelVendorService(TravelVendorService travelVendorService)
      Sets travel vendor service.
      Parameters:
      travelVendorService - the travel vendor service
    • getConfigurationService

      protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
      Returns:
      configurationService
    • setConfigurationService

      public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService)
      Parameters:
      configurationService - the configurationService to set
    • getTravelKeyGeneratorService

      protected TravelKeyGeneratorService getTravelKeyGeneratorService()
      Returns:
      travelKeyGeneratorService
    • setTravelKeyGeneratorService

      public void setTravelKeyGeneratorService(TravelKeyGeneratorService travelKeyGeneratorService)
      Parameters:
      travelKeyGeneratorService - the travelKeyGeneratorService to set
    • getTransportOfferings

      public de.hybris.platform.servicelayer.search.SearchResult<TransportOfferingModel> getTransportOfferings(int batchSize, int offset)
      Description copied from interface: TransportOfferingService
      Get a batchSize list of TransportOfferingModel configured in the system.
      Specified by:
      getTransportOfferings in interface TransportOfferingService
      Parameters:
      batchSize - the size of search result
      offset - the offset
      Returns:
      SearchResult transport offerings
    • getTimeService

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

      public void setTimeService(de.hybris.platform.servicelayer.time.TimeService timeService)
      Sets time service.
      Parameters:
      timeService - the time service