Class ConfigurationProviderMockImpl
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.mock.provider.impl.ConfigurationProviderMockImpl
- All Implemented Interfaces:
ConfigurationProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangeConfiguration(ConfigModel model) Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.protected ConfigModelcreateConfigMock(String sapProductId, String variantProductCode, String configIdToUse, boolean persistent) Creates a configuration from the configuration in external format which can be provided from outside, e.g.createConfigurationFromExternalSource(KBKey kbKey, String extConfig) Creates a configuration from an XML string containing the configuration in external format.createDefaultConfiguration(KBKey kbKey) Creates a default configuration for the required knowledge base.protected ConfigModelcreateDefaultIfNull(ConfigModel model, String configId, boolean persistent) protected KBKeycreateKbKey(String sapProductId, String variantProductCode, boolean isChangeableVariantMock) protected voidendPerfTrace(long startTime, String action) protected booleanprotected StringextractConfigIdFromExtConfig(String extConfig) Extracts the config id from an external configuration string.extractKbKey(String productCode, String externalConfig) extracts the KBKey from the external configurationprotected StringgetAllValuePricesForAssignedValues(ConfigModel configModel) protected ConfigMockFactoryprotected ConfigurationMockPersistenceServiceprotected ConfigurationMockIdGenaratorprotected ProductModelgetProductModel(String productCode) protected ProductServiceprotected ProviderFactoryprotected StringincrementVersion(ConfigModel model) booleanisKbForDateExists(String productCode, Date kbDate) booleanisKbVersionExists(KBKey kbKey) booleanisKbVersionValid(KBKey kbKey) protected booleanprotected StringparseAttributeValue(String extConfig, String tag, String attribute) voidreleaseSession(String configId) Releases the configuration sessions identified by the provided ID and all associated resources.voidreleaseSession(String configId, String version) Releases the configuration sessions identified by the provided ID and all associated resources.protected voidremovePrices(ConfigModel model) protected voidremovePrices(InstanceModel instance) protected voidremovePricesIfNeeded(ConfigModel configModel) protected voidresetChangedByFrontEnd(InstanceModel instance) retrieveConfigurationFromVariant(String baseProductCode, String variantProductCode) Simply returns the default configuration of the base product as a variantretrieveConfigurationModel(String configId) Retrieve the current state of the configuration model for the requestedconfigId.retrieveExternalConfiguration(String configId) Retrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.protected voidvoidsetConfigMockFactory(ConfigMockFactory configMockFactory) voidsetConfigurationMockPersistenceService(ConfigurationMockPersistenceService configurationMockPersistenceService) voidsetMockIdGenerator(ConfigurationMockIdGenarator mockIdGenerator) protected voidsetNewAuthorForChangedCstics(InstanceModel instance, String author) voidsetProductService(ProductService productService) voidsetProviderFactory(ProviderFactory providerFactory) voidsetRemovePricesFromConfiguration(boolean removePricesFromConfiguration) protected longbooleanupdateConfiguration(ConfigModel model) Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.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.ConfigurationProvider
enrichModelWithGroup, isReadDomainValuesOnDemandSupported, retrieveConfigurationModel, retrieveConfigurationModel
-
Field Details
-
PREFIX_DEFAULT_CONFIG_FOR_DELTA_PRICING
- See Also:
-
-
Constructor Details
-
ConfigurationProviderMockImpl
public ConfigurationProviderMockImpl()
-
-
Method Details
-
createDefaultConfiguration
Description copied from interface:ConfigurationProviderCreates a default configuration for the required knowledge base. The knowledge base (KB) can be identified e.g. via the product code or via the KB name, version and logical system.- Specified by:
createDefaultConfigurationin interfaceConfigurationProvider- Parameters:
kbKey- Information needed to identify a knowledge base- Returns:
- The configurable product with default configuration
-
createConfigurationFromExternalSource
Description copied from interface:ConfigurationProviderCreates a configuration from the configuration in external format which can be provided from outside, e.g. from the configuration prepared in the back end.
This API does _not_ force the KB related attributes to be existing. In case only the product ID is provided, a matching KB version is determined.- Specified by:
createConfigurationFromExternalSourcein interfaceConfigurationProvider- Parameters:
extConfig- External configuration in external format- Returns:
- Configuration model
-
createConfigMock
protected ConfigModel createConfigMock(String sapProductId, String variantProductCode, String configIdToUse, boolean persistent) -
createConfigurationFromExternalSource
Description copied from interface:ConfigurationProviderCreates a configuration from an XML string containing the configuration in external format.
This API requires the KB related attributes as part of the external configuration to be available, they are directly forwarded to the configuration engine.- Specified by:
createConfigurationFromExternalSourcein interfaceConfigurationProvider- Parameters:
kbKey- Information needed to create a knowledge baseextConfig- External configuration as XML string- Returns:
- Configuration model
-
retrieveConfigurationModel
Description copied from interface:ConfigurationProviderRetrieve the current state of the configuration model for the requestedconfigId.- Specified by:
retrieveConfigurationModelin interfaceConfigurationProvider- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
retrieveExternalConfiguration
Description copied from interface:ConfigurationProviderRetrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.- Specified by:
retrieveExternalConfigurationin interfaceConfigurationProvider- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration as XML string
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
retrieveConfigurationFromVariant
public ConfigModel retrieveConfigurationFromVariant(String baseProductCode, String variantProductCode) Simply returns the default configuration of the base product as a variant- Specified by:
retrieveConfigurationFromVariantin interfaceConfigurationProvider- Returns:
- The pre-filled configuration model
-
updateConfiguration
Description copied from interface:ConfigurationProviderChecks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.- Specified by:
updateConfigurationin interfaceConfigurationProvider- Parameters:
model- Updated model- Returns:
true, only if it was necessary to send an update to the configuration engine- Throws:
ConfigurationEngineException
-
changeConfiguration
Description copied from interface:ConfigurationProviderChecks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any. The version of the runtime configuration must be included in the configuration model and the method returns the new version after the update.- Specified by:
changeConfigurationin interfaceConfigurationProvider- Parameters:
model- Updated model- Returns:
- new configuration runtime version if update successful, otherwise null
- Throws:
ConfigurationEngineException
-
releaseSession
Description copied from interface:ConfigurationProviderReleases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Specified by:
releaseSessionin interfaceConfigurationProvider- Parameters:
configId- session id
-
releaseSession
Description copied from interface:ConfigurationProviderReleases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Specified by:
releaseSessionin interfaceConfigurationProvider- Parameters:
configId- session idversion- version of the runtime configuration
-
extractKbKey
Description copied from interface:ConfigurationProviderextracts the KBKey from the external configuration- Specified by:
extractKbKeyin interfaceConfigurationProvider- Returns:
- returns the kBKey of the given external config
-
isKbForDateExists
- Specified by:
isKbForDateExistsin interfaceConfigurationProvider- Returns:
trueonly if a valid KBVersion exists for the given product and date.
-
isKbVersionExists
- Specified by:
isKbVersionExistsin interfaceConfigurationProvider- Returns:
- returns
trueonly if the KB version identified by the the given KBKey is known by the underlying configuration engine.
-
isKbVersionValid
- Specified by:
isKbVersionValidin interfaceConfigurationProvider- Returns:
- returns
trueonly if the KB version identified by the the given KBKey is known by the underlying configuration engine and if it is still valid on the given date.
-
endPerfTrace
-
startPerfTrace
protected long startPerfTrace() -
removePricesIfNeeded
-
saveCopyForDeltaPricing
-
createKbKey
-
getProductModel
-
removePrices
-
removePrices
-
resetChangedByFrontEnd
-
setNewAuthorForChangedCstics
-
getAllValuePricesForAssignedValues
-
createDefaultIfNull
-
extConfigBelongsToValidProduct
protected boolean extConfigBelongsToValidProduct(ConfigModel model) throws ConfigurationEngineException - Throws:
ConfigurationEngineException
-
extractConfigIdFromExtConfig
Extracts the config id from an external configuration string. The config id is stored as child element of the TEST_PROPERTIES tag. Example:1 - Parameters:
extConfig-- Returns:
- configId
-
parseAttributeValue
-
incrementVersion
-
getConfigMockFactory
-
setConfigMockFactory
-
getProviderFactory
-
setProviderFactory
-
getProductService
-
setProductService
-
getConfigurationMockPersistenceService
-
setConfigurationMockPersistenceService
public void setConfigurationMockPersistenceService(ConfigurationMockPersistenceService configurationMockPersistenceService) -
isRemovePricesFromConfiguration
protected boolean isRemovePricesFromConfiguration() -
setRemovePricesFromConfiguration
public void setRemovePricesFromConfiguration(boolean removePricesFromConfiguration) -
getMockIdGenerator
-
setMockIdGenerator
-