Class DefaultCartRestorationService

java.lang.Object
de.hybris.platform.sap.sapordermgmtservices.cart.impl.DefaultCartRestorationService
All Implemented Interfaces:
CartRestorationService

public class DefaultCartRestorationService extends Object implements CartRestorationService
Default implementation of the restoration service. Task of this class is to create a BOL representation of the cart (which has a counterpart in the SAP back end) from a persisted hybris cart.
  • Field Details

    • SESSION_CART_PARAMETER_NAME

      protected static String SESSION_CART_PARAMETER_NAME
      Hybris session cart is stored in hybris session using this key
  • Constructor Details

    • DefaultCartRestorationService

      public DefaultCartRestorationService()
  • Method Details

    • restoreCart

      public CartRestorationData restoreCart(CartModel fromCart)
      Description copied from interface: CartRestorationService
      Restores a BOL cart from the persisted standard session cart
      Specified by:
      restoreCart in interface CartRestorationService
      Parameters:
      fromCart - Session cart in hybris persistence
      Returns:
      Restorated cart, basing on the BOL cart
    • createItemsFromCart

      protected List<Item> createItemsFromCart(CartModel fromCart)
      Creates a list of BOL items from a hybris cart model. Those cart items carry following attributes copied from the entities of type AbstractOrderEntryModel:
    • ProductId
    • Quantity
    • Parameters:
      fromCart - Cart model
      Returns:
      List of BOL items
    • setInternalSessionCart

      public void setInternalSessionCart(CartModel cart)
      Description copied from interface: CartRestorationService
      Sets session cart (stores it into the session)
      Specified by:
      setInternalSessionCart in interface CartRestorationService
    • getInternalSessionCart

      public CartModel getInternalSessionCart()
      Description copied from interface: CartRestorationService
      Returns the standard session cart, basing on the hybris persistence
      Specified by:
      getInternalSessionCart in interface CartRestorationService
      Returns:
      hybris cart model
    • hasInternalSessionCart

      public boolean hasInternalSessionCart()
      Description copied from interface: CartRestorationService
      Does a standard session cart exist?
      Specified by:
      hasInternalSessionCart in interface CartRestorationService
      Returns:
      true if a hybris session cart exists
    • removeInternalSessionCart

      public void removeInternalSessionCart()
      Description copied from interface: CartRestorationService
      Removes the internal session cart, basing on the hybris persistence
      Specified by:
      removeInternalSessionCart in interface CartRestorationService
    • getSessionService

      public de.hybris.platform.servicelayer.session.SessionService getSessionService()
      Returns:
      Standard session service (needed to access session cart and references to product configuration runtime objects attached to cart entries)
    • setSessionService

      public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService)
      Sets standard session service via spring injection
      Parameters:
      sessionService -
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
      Returns:
      Model service
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Sets standard model service via spring injection
      Parameters:
      modelService -
    • setCartFactory

      public void setCartFactory(de.hybris.platform.order.CartFactory cartFactory)
      Sets standard cart factory via spring injection
      Parameters:
      cartFactory -
    • getCartService

      public CartService getCartService()
      Returns:
      the cartService
    • setCartService

      public void setCartService(CartService cartService)
      Parameters:
      cartService - the cartService to set
    • getCartRestorationServiceHooks

      public List<CartRestorationServiceHook> getCartRestorationServiceHooks()
      Returns:
      the defaultCartRestorationServiceHook
    • setCartRestorationServiceHooks

      public void setCartRestorationServiceHooks(List<CartRestorationServiceHook> defaultCartRestorationServiceHook)
      Parameters:
      defaultCartRestorationServiceHook - the defaultCartRestorationServiceHook to set
    • getItemFactory

      public ItemFactory getItemFactory()
      Returns:
      the itemFactory
    • setItemFactory

      public void setItemFactory(ItemFactory itemFactory)
      Parameters:
      itemFactory - the itemFactory to set