Class DefaultTravellerService

java.lang.Object
de.hybris.platform.travelservices.services.impl.DefaultTravellerService
All Implemented Interfaces:
TravellerService
Direct Known Subclasses:
DefaultShoppingTravellerService

public class DefaultTravellerService extends Object implements TravellerService
Class is responsible for providing concrete implementation of the TravellerService interface. The class uses the travellerDao class to query the database and return TravellerModel type.
  • Constructor Details

    • DefaultTravellerService

      public DefaultTravellerService()
  • Method Details

    • createTraveller

      public TravellerModel createTraveller(String travellerType, String passengerType, String travellerCode, int passengerNumber, String travellerUidPrefix)
      Description copied from interface: TravellerService
      Create traveller traveller model.
      Specified by:
      createTraveller in interface TravellerService
      Parameters:
      travellerType - the traveller type
      passengerType - the passenger type
      travellerCode - the traveller code
      passengerNumber - the passenger number
      travellerUidPrefix - the traveller uid prefix
      Returns:
      traveller model
    • createTraveller

      public TravellerModel createTraveller(String travellerType, String passengerType, String travellerCode, int passengerNumber, String travellerUidPrefix, String orderOrCartCode)
      Description copied from interface: TravellerService
      Create traveller traveller model.
      Specified by:
      createTraveller in interface TravellerService
      Parameters:
      travellerType - the traveller type
      passengerType - the passenger type
      travellerCode - the traveller code
      passengerNumber - the passenger number
      travellerUidPrefix - the traveller uid prefix
      orderOrCartCode - the order or cart code that needs to be set in the versionID
      Returns:
      traveller model
    • saveTraveller

      protected void saveTraveller(TravellerModel traveller, int passengerNumber, String travellerUidPrefix, int attemptNo)
    • getExistingTraveller

      public TravellerModel getExistingTraveller(String uid) throws de.hybris.platform.servicelayer.exceptions.ModelNotFoundException
      Description copied from interface: TravellerService
      Returns the Traveller in the system identified by the given uid
      Specified by:
      getExistingTraveller in interface TravellerService
      Parameters:
      uid - The traveller Uid
      Returns:
      TravellerModel existing traveller
      Throws:
      de.hybris.platform.servicelayer.exceptions.ModelNotFoundException - the model not found exception
    • getExistingTraveller

      public TravellerModel getExistingTraveller(String uid, String versionID) throws de.hybris.platform.servicelayer.exceptions.ModelNotFoundException
      Description copied from interface: TravellerService
      Returns the Traveller in the system identified by the given uid and versionID
      Specified by:
      getExistingTraveller in interface TravellerService
      Parameters:
      uid - The traveller Uid
      versionID - The traveller versionID
      Returns:
      TravellerModel existing traveller
      Throws:
      de.hybris.platform.servicelayer.exceptions.ModelNotFoundException - the model not found exception
    • getTravellersPerLeg

      public Map<Integer,List<TravellerModel>> getTravellersPerLeg(AbstractOrderModel abstractOrderModel)
      Description copied from interface: TravellerService
      Retrieves a list of travellers for each leg of the journey based on abstract order entries
      Specified by:
      getTravellersPerLeg in interface TravellerService
      Parameters:
      abstractOrderModel - - given cart/order model
      Returns:
      list of travellers for each leg of the journey
    • getTravellerListForEntry

      protected List<TravellerModel> getTravellerListForEntry(Map<Integer,List<TravellerModel>> travellersMap, AbstractOrderEntryModel entry)
    • getTravellerFromCurrentCart

      public TravellerModel getTravellerFromCurrentCart(String travellerCode)
      Description copied from interface: TravellerService
      Returns the Traveller identified by the code in the current Session Cart if present, null otherwise
      Specified by:
      getTravellerFromCurrentCart in interface TravellerService
      Parameters:
      travellerCode - The code that identifies a Traveller in the Cart
      Returns:
      TravellerModel or null
    • getTravellerFromCurrentCartByUID

      public TravellerModel getTravellerFromCurrentCartByUID(String travellerUID, CartModel sessionCart)
      Deprecated to use getCartTravellerForUid() for further implementations
      Specified by:
      getTravellerFromCurrentCartByUID in interface TravellerService
      Parameters:
      travellerUID - The code that identifies a Traveller in the Cart
      sessionCart -
      Returns:
    • getTravellers

      public List<TravellerModel> getTravellers(List<AbstractOrderEntryModel> abstractOrderEntryModels)
      Description copied from interface: TravellerService
      Method takes a list of AbstractOrderEntryModel and turns a unique list of traveller models
      Specified by:
      getTravellers in interface TravellerService
      Parameters:
      abstractOrderEntryModels - the abstract order entry models
      Returns:
      travellers
    • findSavedTravellersUsingFirstNameText

      public List<TravellerModel> findSavedTravellersUsingFirstNameText(String nameText, String passengerType, CustomerModel customer)
      Description copied from interface: TravellerService
      Retrieves a list of saved travelers against a current customer using a text inputed as part of first name field
      Specified by:
      findSavedTravellersUsingFirstNameText in interface TravellerService
      Returns:
    • findSavedTravellersUsingLastNameText

      public List<TravellerModel> findSavedTravellersUsingLastNameText(String nameText, String passengerType, CustomerModel customer)
      Description copied from interface: TravellerService
      Retrieves a list of saved travelers against a current customer using a text inputed as part of last name field
      Specified by:
      findSavedTravellersUsingLastNameText in interface TravellerService
      Returns:
    • getCartTravellerForUid

      public TravellerModel getCartTravellerForUid(String uid, CartModel cart)
      Description copied from interface: TravellerService
      Returns the traveller by the uid for given cart.
      Specified by:
      getCartTravellerForUid in interface TravellerService
      Parameters:
      uid - the uid of the traveller to retrieve
      cart - the current cart
      Returns:
      the traveller
    • getTravellersFromOrder

      public List<TravellerModel> getTravellersFromOrder(OrderModel order)
      Description copied from interface: TravellerService
      Returns the travellers from order.
      Specified by:
      getTravellersFromOrder in interface TravellerService
      Parameters:
      order - the order
      Returns:
      the list of travellers
    • getModelService

      protected 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
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Returns:
      the enumerationService
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Parameters:
      enumerationService - the enumerationService to set
    • getPassengerTypeService

      protected PassengerTypeService getPassengerTypeService()
      Returns:
      the passengerTypeService
    • setPassengerTypeService

      public void setPassengerTypeService(PassengerTypeService passengerTypeService)
      Parameters:
      passengerTypeService - the passengerTypeService to set
    • getTravellerDao

      protected TravellerDao getTravellerDao()
      Returns:
      the travellerDao
    • setTravellerDao

      public void setTravellerDao(TravellerDao travellerDao)
      Parameters:
      travellerDao - the travellerDao to set
    • getTravelKeyGeneratorService

      protected TravelKeyGeneratorService getTravelKeyGeneratorService()
      Returns:
      the travelKeyGeneratorService
    • setTravelKeyGeneratorService

      public void setTravelKeyGeneratorService(TravelKeyGeneratorService travelKeyGeneratorService)
      Parameters:
      travelKeyGeneratorService - the travelKeyGeneratorService 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
    • getConfigurationService

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

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