Interface ConfigurationProvider
- All Known Implementing Classes:
ConfigurationProviderMockImpl,DummyConfigurationProvider
public interface ConfigurationProvider
ConfigurationProvider provides access to all required interactions with SSC configuration an pricing engine.
-
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.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.default voidenrichModelWithGroup(ConfigModel cachedModel, String currentGroup) Enriches cached configuration model with data for the given groupdefault KBKeyextractKbKey(String productCode, String externalConfig) extracts the KBKey from the external configurationbooleanisKbForDateExists(String productCode, Date kbDate) default booleanisKbVersionExists(KBKey kbKey) default booleanisKbVersionValid(KBKey kbKey) default booleanvoidreleaseSession(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.default ConfigModelretrieveConfigurationFromVariant(String baseProductCode, String variantProductCode) Get configuration for the base product, initialized with given configuration of the variantretrieveConfigurationModel(String configId) Retrieve the current state of the configuration model for the requestedconfigId.default ConfigModelretrieveConfigurationModel(String configId, ConfigurationRetrievalOptions options) Retrieve the current state of the configuration model for the requestedconfigId.default ConfigModelretrieveConfigurationModel(String configId, String groupId, boolean overviewOnly, ConfigurationRetrievalOptions options) Retrieve the current state of the configuration model for the requestedconfigIdandcurrentGroup.retrieveExternalConfiguration(String configId) Retrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.booleanupdateConfiguration(ConfigModel model) Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.
-
Method Details
-
createDefaultConfiguration
Creates 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.- Parameters:
kbKey- Information needed to identify a knowledge base- Returns:
- The configurable product with default configuration
-
updateConfiguration
Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.- Parameters:
model- Updated model- Returns:
true, only if it was necessary to send an update to the configuration engine- Throws:
ConfigurationEngineException
-
changeConfiguration
Checks 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.- Parameters:
model- Updated model- Returns:
- new configuration runtime version if update successful, otherwise null
- Throws:
ConfigurationEngineException
-
retrieveConfigurationModel
Retrieve the current state of the configuration model for the requestedconfigId.- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
retrieveConfigurationModel
default ConfigModel retrieveConfigurationModel(String configId, ConfigurationRetrievalOptions options) throws ConfigurationEngineException Retrieve the current state of the configuration model for the requestedconfigId.- Parameters:
configId- Unique configuration IDoptions- options to consider while reading the configuration, such as additional/updated variant conditions for pricing- Returns:
- The actual configuration
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
retrieveExternalConfiguration
Retrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration as XML string
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
createConfigurationFromExternalSource
Creates 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.- Parameters:
extConfig- External configuration in external format- Returns:
- Configuration model
-
createConfigurationFromExternalSource
Creates 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.- Parameters:
kbKey- Information needed to create a knowledge baseextConfig- External configuration as XML string- Returns:
- Configuration model
-
releaseSession
Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Parameters:
configId- session id
-
releaseSession
Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Parameters:
configId- session idversion- version of the runtime configuration
-
retrieveConfigurationFromVariant
default ConfigModel retrieveConfigurationFromVariant(String baseProductCode, String variantProductCode) Get configuration for the base product, initialized with given configuration of the variant- Parameters:
baseProductCode-variantProductCode-- Returns:
- The pre-filled configuration model
-
isKbForDateExists
- Parameters:
productCode-kbDate-- Returns:
trueonly if a valid KBVersion exists for the given product and date.
-
extractKbKey
extracts the KBKey from the external configuration- Parameters:
externalConfig-productCode-- Returns:
- returns the kBKey of the given external config
-
isKbVersionExists
- Parameters:
kbKey-- Returns:
- returns
trueonly if the KB version identified by the the given KBKey is known by the underlying configuration engine.
-
isKbVersionValid
- Parameters:
kbKey-- 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.
-
enrichModelWithGroup
default void enrichModelWithGroup(ConfigModel cachedModel, String currentGroup) throws ConfigurationEngineException Enriches cached configuration model with data for the given group- Parameters:
cachedModel- already cached configuration modelcurrentGroup- group for which detailed information should be added to the cached configuration model- Throws:
ConfigurationEngineException
-
retrieveConfigurationModel
default ConfigModel retrieveConfigurationModel(String configId, String groupId, boolean overviewOnly, ConfigurationRetrievalOptions options) throws ConfigurationEngineException Retrieve the current state of the configuration model for the requestedconfigIdandcurrentGroup.- Parameters:
configId- Unique configuration IDcurrentGroup- group for which detailed information should be added to the cached configuration modeloverviewOnly- only for configuration overview: group detailed information is not requiredoptions- options to consider while reading the configuration, such as additional/updated variant conditions for pricing- Returns:
- The actual configuration
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
isReadDomainValuesOnDemandSupported
default boolean isReadDomainValuesOnDemandSupported()- Returns:
- returns
trueif this configuration provider supports group based requests for configuration read
-