Class DefaultConfigurationLifecycleStrategyImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.services.strategies.lifecycle.impl.SessionServiceAware
-
- de.hybris.platform.sap.productconfig.services.ssc.strategies.lifecycle.impl.DefaultConfigurationLifecycleStrategyImpl
-
- All Implemented Interfaces:
ConfigurationLifecycleStrategy
public class DefaultConfigurationLifecycleStrategyImpl extends SessionServiceAware implements ConfigurationLifecycleStrategy
Default implementation of theConfigurationLifecycleStrategy. It uses the hybris session to store any data and hence delegates to theSessionAccessService.
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationLifecycleStrategyImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigModelcreateConfigurationFromExternalSource(Configuration extConfig)Creates a configuration from the configuration in external format which can be provided from outside, e.g.ConfigModelcreateConfigurationFromExternalSource(KBKey kbKey, java.lang.String extConfig)Creates a configuration from an XML string containing the configuration in external format.ConfigModelcreateDefaultConfiguration(KBKey kbKey)Creates a default configuration for the required knowledge base.protected ConfigurationProvidergetConfigurationProvider()protected ProviderFactorygetProviderFactory()booleanisConfigForCurrentUser(java.lang.String configId)Checks whether the given configuration may be accessed by the current userbooleanisConfigKnown(java.lang.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(java.lang.String sessionId)Releases sessions identified by the provided ID.voidreleaseSession(java.lang.String configId)Releases the configuration sessions identified by the provided ID and all associated resources.ConfigModelretrieveConfigurationFromVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)Get configuration for the base product, initialized with given configuration of the variantConfigModelretrieveConfigurationModel(java.lang.String configId)Retrieve the current state of the configuration model for the requestedconfigId.ConfigModelretrieveConfigurationModel(java.lang.String configId, ConfigurationRetrievalOptions options)Retrieve the current state of the configuration model for the requestedconfigId.java.lang.StringretrieveExternalConfiguration(java.lang.String configId)Retrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.voidsetProviderFactory(ProviderFactory providerFactory)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(java.lang.String userSessionId)Updates ProductConfigurationModel, after user loged in.-
Methods inherited from class de.hybris.platform.sap.productconfig.services.strategies.lifecycle.impl.SessionServiceAware
getSessionAccessService, setSessionAccessService
-
-
-
-
Method Detail
-
createDefaultConfiguration
public ConfigModel createDefaultConfiguration(KBKey kbKey)
Description copied from interface:ConfigurationLifecycleStrategyCreates 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 interfaceConfigurationLifecycleStrategy- Parameters:
kbKey- Information needed to identify a knowledge base- Returns:
- The configurable product with default configuration
-
updateConfiguration
public boolean updateConfiguration(ConfigModel model) throws ConfigurationEngineException
Description copied from interface:ConfigurationLifecycleStrategyChecks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.- Specified by:
updateConfigurationin interfaceConfigurationLifecycleStrategy- Parameters:
model- Updated model- Returns:
true, only if it was necessary to send an updare to the configuration egnine- Throws:
ConfigurationEngineException
-
updateUserLinkToConfiguration
public void updateUserLinkToConfiguration(java.lang.String userSessionId)
Description copied from interface:ConfigurationLifecycleStrategyUpdates ProductConfigurationModel, after user loged in.- Specified by:
updateUserLinkToConfigurationin interfaceConfigurationLifecycleStrategy- Parameters:
userSessionId- user session Id
-
retrieveConfigurationModel
public ConfigModel retrieveConfigurationModel(java.lang.String configId) throws ConfigurationEngineException
Description copied from interface:ConfigurationLifecycleStrategyRetrieve the current state of the configuration model for the requestedconfigId.- Specified by:
retrieveConfigurationModelin interfaceConfigurationLifecycleStrategy- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
retrieveConfigurationModel
public ConfigModel retrieveConfigurationModel(java.lang.String configId, ConfigurationRetrievalOptions options) throws ConfigurationEngineException
Description copied from interface:ConfigurationLifecycleStrategyRetrieve the current state of the configuration model for the requestedconfigId.- Specified by:
retrieveConfigurationModelin interfaceConfigurationLifecycleStrategy- 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
public java.lang.String retrieveExternalConfiguration(java.lang.String configId) throws ConfigurationEngineExceptionDescription copied from interface:ConfigurationLifecycleStrategyRetrieve the current state of the configuration for the requestedconfigIdas an XML string containing the configuration in external format.- Specified by:
retrieveExternalConfigurationin interfaceConfigurationLifecycleStrategy- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration as XML string
- Throws:
ConfigurationEngineException- Service has failed, e.g. because session timed out
-
createConfigurationFromExternalSource
public ConfigModel createConfigurationFromExternalSource(Configuration extConfig)
Description copied from interface:ConfigurationLifecycleStrategyCreates 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 interfaceConfigurationLifecycleStrategy- Parameters:
extConfig- External configuration in external format- Returns:
- Configuration model
-
createConfigurationFromExternalSource
public ConfigModel createConfigurationFromExternalSource(KBKey kbKey, java.lang.String extConfig)
Description copied from interface:ConfigurationLifecycleStrategyCreates 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 interfaceConfigurationLifecycleStrategy- Parameters:
kbKey- Information needed to create a knowledge baseextConfig- External configuration as XML string- Returns:
- Configuration model
-
releaseSession
public void releaseSession(java.lang.String configId)
Description copied from interface:ConfigurationLifecycleStrategyReleases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Specified by:
releaseSessionin interfaceConfigurationLifecycleStrategy- Parameters:
configId- id of the config session
-
releaseExpiredSessions
public void releaseExpiredSessions(java.lang.String sessionId)
Description copied from interface:ConfigurationLifecycleStrategyReleases sessions identified by the provided ID. Accessing the session afterwards is not possible anymore.- Specified by:
releaseExpiredSessionsin interfaceConfigurationLifecycleStrategy- Parameters:
sessionId- id of the user session
-
retrieveConfigurationFromVariant
public ConfigModel retrieveConfigurationFromVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)
Description copied from interface:ConfigurationLifecycleStrategyGet configuration for the base product, initialized with given configuration of the variant- Specified by:
retrieveConfigurationFromVariantin interfaceConfigurationLifecycleStrategy- Returns:
- The pre-filled configuration model
-
isConfigForCurrentUser
public boolean isConfigForCurrentUser(java.lang.String configId)
Description copied from interface:ConfigurationLifecycleStrategyChecks whether the given configuration may be accessed by the current user- Specified by:
isConfigForCurrentUserin interfaceConfigurationLifecycleStrategy- Parameters:
configId- configuration id- Returns:
- true if configuration may be accessed by current user
-
getConfigurationProvider
protected ConfigurationProvider getConfigurationProvider()
-
getProviderFactory
protected ProviderFactory getProviderFactory()
-
setProviderFactory
public void setProviderFactory(ProviderFactory providerFactory)
-
isConfigKnown
public boolean isConfigKnown(java.lang.String configId)
Description copied from interface:ConfigurationLifecycleStrategyChecks 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.- Specified by:
isConfigKnownin interfaceConfigurationLifecycleStrategy- Parameters:
configId- configuration id- Returns:
- true if configuration is persisted and known by hybris
-
-