Interface ConfigurationLifecycleStrategy
- All Known Implementing Classes:
PersistenceConfigurationLifecycleB2BStrategyImpl,PersistenceConfigurationLifecycleStrategyImpl
public interface ConfigurationLifecycleStrategy
This strategy manages the lifecycle of a product runtime configuration.
-
Method Summary
Modifier and TypeMethodDescriptionCreates 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.booleanisConfigForCurrentUser(String configId) Checks whether the given configuration may be accessed by the current userbooleanisConfigKnown(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.voidreleaseExpiredSessions(String userSessionId) Releases sessions identified by the provided ID.voidreleaseSession(String configId) Releases the configuration sessions identified by the provided ID and all associated resources.retrieveConfigurationFromVariant(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.retrieveConfigurationModel(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 requestedconfigId.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.voidupdateUserLinkToConfiguration(String userSessionId) Updates ProductConfigurationModel, after user loged in.
-
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 updare to the configuration egnine- Throws:
ConfigurationEngineException
-
updateUserLinkToConfiguration
Updates ProductConfigurationModel, after user loged in.- Parameters:
userSessionId- user session Id
-
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
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- id of the config session
-
releaseExpiredSessions
Releases sessions identified by the provided ID. Accessing the session afterwards is not possible anymore.- Parameters:
userSessionId- id of the user session
-
retrieveConfigurationFromVariant
Get configuration for the base product, initialized with given configuration of the variant- Parameters:
baseProductCode-variantProductCode-- Returns:
- The pre-filled configuration model
-
isConfigForCurrentUser
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
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 requestedconfigId.- Parameters:
configId- Unique configuration IDgroupId- group Id for which detailed information should be retrievedoverviewOnly- 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
-