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 Details

    • createDefaultConfiguration

      ConfigModel createDefaultConfiguration(KBKey kbKey)
      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

      boolean updateConfiguration(ConfigModel model) throws ConfigurationEngineException
      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

      String changeConfiguration(ConfigModel model) throws ConfigurationEngineException
      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

      ConfigModel retrieveConfigurationModel(String configId) throws ConfigurationEngineException
      Retrieve the current state of the configuration model for the requested configId.
      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 requested configId.
      Parameters:
      configId - Unique configuration ID
      options - 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

      String retrieveExternalConfiguration(String configId) throws ConfigurationEngineException
      Retrieve the current state of the configuration for the requested configId as 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

      ConfigModel createConfigurationFromExternalSource(Configuration extConfig)
      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

      ConfigModel createConfigurationFromExternalSource(KBKey kbKey, String extConfig)
      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 base
      extConfig - External configuration as XML string
      Returns:
      Configuration model
    • createConfigurationFromExternalSourceWithDate

      default ConfigModel createConfigurationFromExternalSourceWithDate(KBKey kbKey, String extConfig)
      Creates a configuration from an JSON 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. in contrast to createConfigurationFromExternalSource(KBKey, String) this API will respect the date given within the kbKey
      Parameters:
      kbKey - Information needed to create a knowledge base
      extConfig - External configuration as XML string
      Returns:
      Configuration model
    • releaseSession

      void releaseSession(String configId)
      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

      void releaseSession(String configId, String version)
      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
      version - 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

      boolean isKbForDateExists(String productCode, Date kbDate)
      Parameters:
      productCode -
      kbDate -
      Returns:
      true only if a valid KBVersion exists for the given product and date.
    • extractKbKey

      default KBKey extractKbKey(String productCode, String externalConfig)
      extracts the KBKey from the external configuration
      Parameters:
      externalConfig -
      productCode -
      Returns:
      returns the kBKey of the given external config
    • isKbVersionExists

      default boolean isKbVersionExists(KBKey kbKey)
      Parameters:
      kbKey -
      Returns:
      returns true only if the KB version identified by the the given KBKey is known by the underlying configuration engine.
    • isKbVersionValid

      default boolean isKbVersionValid(KBKey kbKey)
      Parameters:
      kbKey -
      Returns:
      returns true only 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 model
      currentGroup - 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 requested configId and currentGroup.
      Parameters:
      configId - Unique configuration ID
      currentGroup - group for which detailed information should be added to the cached configuration model
      overviewOnly - only for configuration overview: group detailed information is not required
      options - 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 true if this configuration provider supports group based requests for configuration read