Class SimplePricingProviderMockImpl
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.mock.provider.impl.SimplePricingProviderMockImpl
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillValuePrices(ConfigModel configModel) Fills value prices into the config modelprotected voidfillValuePrices(ConfigModel config, PriceValueUpdateModel updateModel, Map<String, PriceModel> valuePrices) voidfillValuePrices(List<PriceValueUpdateModel> updateModels, String configId) Fills absolute value prices or delta prices for all passed PriceValueUpdateModels dependent on setting in backofficeprotected voidfillValuePricesFromPossibleValues(Map<String, PriceModel> valuePrices, CsticModel csticModel, String productId) protected ConfigurationMockPersistenceServiceprotected ConfigModelgetPersistedConfig(String configId) getPriceSummary(String configId, ConfigurationRetrievalOptions options) Retrieves if present current total price, base price and selected options priceprotected PriceSummaryModelgetPriceSummaryModelMocked(String configId) protected PricingConfigurationParameterprotected ProviderFactorybooleanisActive()protected InstanceModelretrieveRelatedInstance(String requiredInstanceId, InstanceModel currentInstance) voidsetActive(boolean active) voidsetConfigurationMockPersistenceService(ConfigurationMockPersistenceService configurationMockPersistenceService) voidsetProviderFactory(ProviderFactory providerFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.sap.productconfig.runtime.interf.PricingProvider
fillValuePrices, fillValuePrices
-
Constructor Details
-
SimplePricingProviderMockImpl
public SimplePricingProviderMockImpl()
-
-
Method Details
-
getPriceSummary
public PriceSummaryModel getPriceSummary(String configId, ConfigurationRetrievalOptions options) throws PricingEngineException Description copied from interface:PricingProviderRetrieves if present current total price, base price and selected options price- Specified by:
getPriceSummaryin interfacePricingProvider- Parameters:
configId- runtime id of the configurationoptions- configuration retrieval options- Returns:
- map of current total price, base price and selected options price
- Throws:
PricingEngineException
-
getPriceSummaryModelMocked
-
isActive
public boolean isActive()- Specified by:
isActivein interfacePricingProvider- Returns:
- true if pricing provider is active in the implementation
-
fillValuePrices
Description copied from interface:PricingProviderFills value prices into the config model- Specified by:
fillValuePricesin interfacePricingProvider- Parameters:
configModel- runtime representation of the configuration- Throws:
PricingEngineException
-
fillValuePrices
public void fillValuePrices(List<PriceValueUpdateModel> updateModels, String configId) throws PricingEngineException Description copied from interface:PricingProviderFills absolute value prices or delta prices for all passed PriceValueUpdateModels dependent on setting in backoffice- Specified by:
fillValuePricesin interfacePricingProvider- Parameters:
updateModels- each list entry represents a characteristic for which absolute value prices or delta prices are filledconfigId- KnowledgeBase id belonging to the runtime configuration for which absolute value prices or delta price are calculated- Throws:
PricingEngineException
-
getPersistedConfig
-
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
-
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
-
setProviderFactory
-
getConfigurationMockPersistenceService
-
setConfigurationMockPersistenceService
public void setConfigurationMockPersistenceService(ConfigurationMockPersistenceService configurationMockPersistenceService)
-