Class DefaultQuoteService

java.lang.Object
de.hybris.platform.order.impl.DefaultQuoteService
All Implemented Interfaces:
QuoteService

public class DefaultQuoteService extends Object implements QuoteService
Default implementation for QuoteService
  • Field Details

  • Constructor Details

    • DefaultQuoteService

      public DefaultQuoteService()
  • Method Details

    • getCurrentQuoteForCode

      public QuoteModel getCurrentQuoteForCode(String code)
      Description copied from interface: QuoteService
      Returns the latest quote snapshot for the given code, i.e. the one with the highest version.
      Specified by:
      getCurrentQuoteForCode in interface QuoteService
      Parameters:
      code - the code to query for
      Returns:
      latest quote snapshot for the given code
    • getQuoteForCodeAndVersion

      public QuoteModel getQuoteForCodeAndVersion(String code, Integer version)
      Description copied from interface: QuoteService
      Returns a unique QuoteModel for the given code and version.
      Specified by:
      getQuoteForCodeAndVersion in interface QuoteService
      Parameters:
      code - the code to query for
      version - the version to query for
      Returns:
      unique quote for the given code and version
    • getQuotesForCode

      public List<QuoteModel> getQuotesForCode(String code)
      Description copied from interface: QuoteService
      Returns a list of all quotes snapshots for the given code, ordered by version in descending order, i.e. the first item in the returned list is the latest snapshot of the quote.
      Specified by:
      getQuotesForCode in interface QuoteService
      Parameters:
      code - the code to query for
      Returns:
      a list of ordered quote snapshots for the given code
    • createQuoteFromCart

      public QuoteModel createQuoteFromCart(CartModel cart)
      Description copied from interface: QuoteService
      Creates a new quote based on the given cart. Please note that it is the caller's responsibility to persist the quote that is returned by this method. Callers may either set quote specific attributes before persisting the item or leave it to the DefaultQuotePrepareInterceptor to set default values. The cart that is passed into this method is not affected by its logic.
      Specified by:
      createQuoteFromCart in interface QuoteService
      Parameters:
      cart - the cart based on which the new quote will be created
      Returns:
      the new quote
    • createQuoteSnapshot

      public QuoteModel createQuoteSnapshot(QuoteModel quote, QuoteState quoteState)
      Description copied from interface: QuoteService
      Creates a new quote snapshot by cloning the given QuoteModel. The state of the new snapshot is determined by the given QuoteState, its version is the given quote's version incremented by 1. Please note that it is the caller's responsibility to persist the quote that is returned by this method. The original quote passed into this method is not affected by its logic.
      Specified by:
      createQuoteSnapshot in interface QuoteService
      Parameters:
      quote - quote to create the snapshot from
      quoteState - desired state of the quote
      Returns:
      the new quote snapshot.
    • getFlexibleSearchService

      protected FlexibleSearchService getFlexibleSearchService()
    • setFlexibleSearchService

      public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
    • getCreateQuoteFromCartStrategy

      protected CreateQuoteFromCartStrategy getCreateQuoteFromCartStrategy()
    • setCreateQuoteFromCartStrategy

      public void setCreateQuoteFromCartStrategy(CreateQuoteFromCartStrategy createQuoteFromCartStrategy)
    • getCreateQuoteSnapshotStrategy

      protected CreateQuoteSnapshotStrategy getCreateQuoteSnapshotStrategy()
    • setCreateQuoteSnapshotStrategy

      public void setCreateQuoteSnapshotStrategy(CreateQuoteSnapshotStrategy createQuoteSnapshotStrategy)