Class SimplePricingProviderMockImpl

java.lang.Object
de.hybris.platform.sap.productconfig.runtime.mock.provider.impl.SimplePricingProviderMockImpl
All Implemented Interfaces:
PricingProvider

public class SimplePricingProviderMockImpl extends Object implements PricingProvider
Simple pricing provider that ensures that the mock can determine prices that are stored in the configuration model and later taken from there in asynchronous pricing calls. This class is not meant for productive usage but just show-cases the pricing integration into product configuration. It is also used for integration testing.
  • Constructor Details

    • SimplePricingProviderMockImpl

      public SimplePricingProviderMockImpl()
  • Method Details

    • setActive

      public void setActive(boolean active)
      Parameters:
      active - Asynchronous pricing is active. 'True' is default option for the accelerator, meaning price information is not sent along with the configuration request. Note that the accelerator is not capable of digesting pricing in configuration response and at the same time doing asynchronous requests.
      'True' also needed for OCC deployments. In this case, prices are just read from the cached state of the configuration.
    • getProviderFactory

      protected ProviderFactory getProviderFactory()
      Returns:
      the providerFactory
    • setProviderFactory

      public void setProviderFactory(ProviderFactory providerFactory)
      Parameters:
      providerFactory - the providerFactory to set
    • getPriceSummary

      public PriceSummaryModel getPriceSummary(String configId, ConfigurationRetrievalOptions options) throws PricingEngineException
      Description copied from interface: PricingProvider
      Retrieves if present current total price, base price and selected options price
      Specified by:
      getPriceSummary in interface PricingProvider
      Parameters:
      configId - runtime id of the configuration
      options - configuration retrieval options
      Returns:
      map of current total price, base price and selected options price
      Throws:
      PricingEngineException
    • getPriceSummaryModelMocked

      protected PriceSummaryModel getPriceSummaryModelMocked(String configId)
    • getConfigurationProvider

      protected ConfigurationProviderMockImpl getConfigurationProvider()
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface PricingProvider
      Returns:
      true if pricing provider is active in the implementation
    • fillValuePrices

      public void fillValuePrices(ConfigModel configModel) throws PricingEngineException
      Description copied from interface: PricingProvider
      Fills value prices into the config model
      Specified by:
      fillValuePrices in interface PricingProvider
      Parameters:
      configModel - runtime representation of the configuration
      Throws:
      PricingEngineException
    • fillValuePrices

      public void fillValuePrices(List<PriceValueUpdateModel> updateModels, String configId) throws PricingEngineException
      Description copied from interface: PricingProvider
      Fills absolute value prices or delta prices for all passed PriceValueUpdateModels dependent on setting in backoffice
      Specified by:
      fillValuePrices in interface PricingProvider
      Parameters:
      updateModels - each list entry represents a characteristic for which absolute value prices or delta prices are filled
      configId - KnowledgeBase id belonging to the runtime configuration for which absolute value prices or delta price are calculated
      Throws:
      PricingEngineException
    • fillValuePricesFromPossibleValues

      protected void fillValuePricesFromPossibleValues(Map<String,PriceModel> valuePrices, CsticModel csticModel, String productId)
    • fillValuePrices

      protected void fillValuePrices(ConfigModel config, PriceValueUpdateModel updateModel, Map<String,PriceModel> valuePrices)
    • retrieveRelatedInstance

      protected InstanceModel retrieveRelatedInstance(String requiredInstanceId, InstanceModel currentInstance)
    • getPricingConfigurationParameters

      protected PricingConfigurationParameter getPricingConfigurationParameters()
      Returns:
      the pricingConfigurationParameter