Interface ConfigurationLifecycleStrategy

All Known Implementing Classes:
PersistenceConfigurationLifecycleB2BStrategyImpl, PersistenceConfigurationLifecycleStrategyImpl

public interface ConfigurationLifecycleStrategy
This strategy manages the lifecycle of a product runtime configuration.
  • 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 updare to the configuration egnine
      Throws:
      ConfigurationEngineException
    • updateUserLinkToConfiguration

      void updateUserLinkToConfiguration(String userSessionId)
      Updates ProductConfigurationModel, after user loged in.
      Parameters:
      userSessionId - user session Id
    • 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

      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
    • 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 - id of the config session
    • releaseExpiredSessions

      void releaseExpiredSessions(String userSessionId)
      Releases sessions identified by the provided ID. Accessing the session afterwards is not possible anymore.
      Parameters:
      userSessionId - id of the user session
    • retrieveConfigurationFromVariant

      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
    • isConfigForCurrentUser

      boolean isConfigForCurrentUser(String configId)
      Checks whether the given configuration may be accessed by the current user
      Parameters:
      configId - configuration id
      Returns:
      true if configuration may be accessed by current user
    • isConfigKnown

      boolean isConfigKnown(String configId)
      Checks whether the given configuration is persisted/known.
      In case configuration was created by an external system, it may not be known, but may still be processed within hybris.
      Parameters:
      configId - configuration id
      Returns:
      true if configuration is persisted and known by hybris
    • 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.
      Parameters:
      configId - Unique configuration ID
      groupId - group Id for which detailed information should be retrieved
      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