Class DefaultTravellerService
java.lang.Object
de.hybris.platform.travelservices.services.impl.DefaultTravellerService
- All Implemented Interfaces:
TravellerService
- Direct Known Subclasses:
DefaultShoppingTravellerService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTraveller(String travellerType, String passengerType, String travellerCode, int passengerNumber, String travellerUidPrefix) Create traveller traveller model.createTraveller(String travellerType, String passengerType, String travellerCode, int passengerNumber, String travellerUidPrefix, String orderOrCartCode) Create traveller traveller model.findSavedTravellersUsingFirstNameText(String nameText, String passengerType, CustomerModel customer) Retrieves a list of saved travelers against a current customer using a text inputed as part of first name fieldfindSavedTravellersUsingLastNameText(String nameText, String passengerType, CustomerModel customer) Retrieves a list of saved travelers against a current customer using a text inputed as part of last name fieldprotected de.hybris.platform.order.CartServicegetCartTravellerForUid(String uid, CartModel cart) Returns the traveller by the uid for given cart.protected de.hybris.platform.servicelayer.config.ConfigurationServiceprotected de.hybris.platform.enumeration.EnumerationServiceReturns the Traveller in the system identified by the given uidgetExistingTraveller(String uid, String versionID) Returns the Traveller in the system identified by the given uid and versionIDprotected de.hybris.platform.servicelayer.model.ModelServiceprotected PassengerTypeServiceprotected TravelKeyGeneratorServiceprotected TravellerDaogetTravellerFromCurrentCart(String travellerCode) Returns the Traveller identified by the code in the current Session Cart if present, null otherwisegetTravellerFromCurrentCartByUID(String travellerUID, CartModel sessionCart) Deprecated to use getCartTravellerForUid() for further implementationsprotected List<TravellerModel>getTravellerListForEntry(Map<Integer, List<TravellerModel>> travellersMap, AbstractOrderEntryModel entry) getTravellers(List<AbstractOrderEntryModel> abstractOrderEntryModels) Method takes a list of AbstractOrderEntryModel and turns a unique list of traveller modelsgetTravellersFromOrder(OrderModel order) Returns the travellers from order.getTravellersPerLeg(AbstractOrderModel abstractOrderModel) Retrieves a list of travellers for each leg of the journey based on abstract order entriesprotected voidsaveTraveller(TravellerModel traveller, int passengerNumber, String travellerUidPrefix, int attemptNo) voidsetCartService(de.hybris.platform.order.CartService cartService) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) voidsetPassengerTypeService(PassengerTypeService passengerTypeService) voidsetTravelKeyGeneratorService(TravelKeyGeneratorService travelKeyGeneratorService) voidsetTravellerDao(TravellerDao travellerDao)
-
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:TravellerServiceCreate traveller traveller model.- Specified by:
createTravellerin interfaceTravellerService- Parameters:
travellerType- the traveller typepassengerType- the passenger typetravellerCode- the traveller codepassengerNumber- the passenger numbertravellerUidPrefix- 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:TravellerServiceCreate traveller traveller model.- Specified by:
createTravellerin interfaceTravellerService- Parameters:
travellerType- the traveller typepassengerType- the passenger typetravellerCode- the traveller codepassengerNumber- the passenger numbertravellerUidPrefix- the traveller uid prefixorderOrCartCode- 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:TravellerServiceReturns the Traveller in the system identified by the given uid- Specified by:
getExistingTravellerin interfaceTravellerService- 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:TravellerServiceReturns the Traveller in the system identified by the given uid and versionID- Specified by:
getExistingTravellerin interfaceTravellerService- Parameters:
uid- The traveller UidversionID- The traveller versionID- Returns:
- TravellerModel existing traveller
- Throws:
de.hybris.platform.servicelayer.exceptions.ModelNotFoundException- the model not found exception
-
getTravellersPerLeg
Description copied from interface:TravellerServiceRetrieves a list of travellers for each leg of the journey based on abstract order entries- Specified by:
getTravellersPerLegin interfaceTravellerService- 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
Description copied from interface:TravellerServiceReturns the Traveller identified by the code in the current Session Cart if present, null otherwise- Specified by:
getTravellerFromCurrentCartin interfaceTravellerService- Parameters:
travellerCode- The code that identifies a Traveller in the Cart- Returns:
- TravellerModel or null
-
getTravellerFromCurrentCartByUID
Deprecated to use getCartTravellerForUid() for further implementations- Specified by:
getTravellerFromCurrentCartByUIDin interfaceTravellerService- Parameters:
travellerUID- The code that identifies a Traveller in the CartsessionCart-- Returns:
-
getTravellers
Description copied from interface:TravellerServiceMethod takes a list of AbstractOrderEntryModel and turns a unique list of traveller models- Specified by:
getTravellersin interfaceTravellerService- Parameters:
abstractOrderEntryModels- the abstract order entry models- Returns:
- travellers
-
findSavedTravellersUsingFirstNameText
public List<TravellerModel> findSavedTravellersUsingFirstNameText(String nameText, String passengerType, CustomerModel customer) Description copied from interface:TravellerServiceRetrieves a list of saved travelers against a current customer using a text inputed as part of first name field- Specified by:
findSavedTravellersUsingFirstNameTextin interfaceTravellerService- Returns:
-
findSavedTravellersUsingLastNameText
public List<TravellerModel> findSavedTravellersUsingLastNameText(String nameText, String passengerType, CustomerModel customer) Description copied from interface:TravellerServiceRetrieves a list of saved travelers against a current customer using a text inputed as part of last name field- Specified by:
findSavedTravellersUsingLastNameTextin interfaceTravellerService- Returns:
-
getCartTravellerForUid
Description copied from interface:TravellerServiceReturns the traveller by the uid for given cart.- Specified by:
getCartTravellerForUidin interfaceTravellerService- Parameters:
uid- the uid of the traveller to retrievecart- the current cart- Returns:
- the traveller
-
getTravellersFromOrder
Description copied from interface:TravellerServiceReturns the travellers from order.- Specified by:
getTravellersFromOrderin interfaceTravellerService- 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
- Returns:
- the passengerTypeService
-
setPassengerTypeService
- Parameters:
passengerTypeService- the passengerTypeService to set
-
getTravellerDao
- Returns:
- the travellerDao
-
setTravellerDao
- Parameters:
travellerDao- the travellerDao to set
-
getTravelKeyGeneratorService
- Returns:
- the travelKeyGeneratorService
-
setTravelKeyGeneratorService
- 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
-