Class PersistenceConfigurationCopyStrategyImpl
java.lang.Object
de.hybris.platform.sap.productconfig.services.strategies.lifecycle.impl.PersistenceConfigurationCopyStrategyImpl
- All Implemented Interfaces:
ConfigurationCopyStrategy
public class PersistenceConfigurationCopyStrategyImpl
extends Object
implements ConfigurationCopyStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyProductConfigurationDependentObjects(Map<String, String> oldConfigId2newConfigIdMap) deepCopyConfiguration(String configId, String productCode, String externalConfiguration, boolean force) Deep Copies a configuration.voidfinalizeClone(AbstractOrderModel source, AbstractOrderModel target) Hook to be called after a document with a configuration attached was cloned.protected voidfinalizeCloneEntry(AbstractOrderEntryModel entry, Map<String, String> oldConfigId2newConfigIdMap, ProductConfigurationRelatedObjectType targetObjectType) voidfinalizeCloneShallowCopy(AbstractOrderModel source, AbstractOrderModel target) Hook to be called after a document with a configuration attached was cloned.protected ConfigurationAssignmentResolverStrategyprotected BaseSiteServiceprotected ProductConfigurationCacheAccessServiceprotected ConfigurationDeepCopyHandlerprotected ConfigurationDependencyHandlerprotected ProductConfigurationPersistenceServiceprotected UserServiceprotected voidprepareEnvironment(AbstractOrderModel source) protected booleanprotected voidreplaceProductConfiguration(AbstractOrderEntryModel sourceEntry, AbstractOrderEntryModel cloneEntry, Consumer<ProductConfigurationModel> replacementStrategy) protected voidreplaceWithDeepCopy(AbstractOrderEntryModel cloneEntry, ProductConfigurationModel oldConfiguration, Map<String, String> oldConfigId2newConfigIdMap) protected voidreplaceWithShallowCopy(AbstractOrderEntryModel cloneEntry, ProductConfigurationModel oldConfiguration) voidsetAssignmentResolverStrategy(ConfigurationAssignmentResolverStrategy assignmentResolverStrategy) voidsetBaseSiteService(BaseSiteService baseSiteService) voidsetCacheAccessService(ProductConfigurationCacheAccessService cacheAccessService) voidsetConfigDeepCopyHandler(ConfigurationDeepCopyHandler configDeepCopyHandler) voidsetConfigurationDependencyHandler(ConfigurationDependencyHandler configurationDependencyHandler) voidsetPersistenceService(ProductConfigurationPersistenceService persistenceService) voidsetUserService(UserService userService) protected UserModel
-
Constructor Details
-
PersistenceConfigurationCopyStrategyImpl
public PersistenceConfigurationCopyStrategyImpl()
-
-
Method Details
-
deepCopyConfiguration
public String deepCopyConfiguration(String configId, String productCode, String externalConfiguration, boolean force) Description copied from interface:ConfigurationCopyStrategyDeep Copies a configuration. The implementation can decide if a deep copy is needed; if not, the input ID is simply returned.- Specified by:
deepCopyConfigurationin interfaceConfigurationCopyStrategy- Parameters:
configId- ID of existing configurationproductCode- optional - product code of configurable product to be copiedexternalConfiguration- optional - externalConfiguration, if provided this will be used as source, instead of obtaining the external config via the provided configIdforce- iftruea deep copy is enforced- Returns:
- ID of new configuration if a deep copy was performed; input otherwise
-
finalizeClone
Description copied from interface:ConfigurationCopyStrategyHook to be called after a document with a configuration attached was cloned. It might be necessary to clone the respective configuration, as well. This happens typically were the configuration is stored in an external system and only reference in hybris (CPS). In case the configuration is attached in an external serialized form, no more actions are necessary (SSC).- Specified by:
finalizeClonein interfaceConfigurationCopyStrategy- Parameters:
source- source documenttarget- target document
-
prepareEnvironment
-
finalizeCloneShallowCopy
Description copied from interface:ConfigurationCopyStrategyHook to be called after a document with a configuration attached was cloned. It might be necessary to copy (no deep copy) the respective configuration, as well. This happens typically were the configuration is stored in an external system and only reference in hybris (CPS). In case the configuration is attached in an external serialized form, no more actions are necessary (SSC).- Specified by:
finalizeCloneShallowCopyin interfaceConfigurationCopyStrategy- Parameters:
source- source documenttarget- target document
-
copyProductConfigurationDependentObjects
-
updateCurrentUserIfRequired
-
finalizeCloneEntry
protected void finalizeCloneEntry(AbstractOrderEntryModel entry, Map<String, String> oldConfigId2newConfigIdMap, ProductConfigurationRelatedObjectType targetObjectType) -
replaceProductConfiguration
protected void replaceProductConfiguration(AbstractOrderEntryModel sourceEntry, AbstractOrderEntryModel cloneEntry, Consumer<ProductConfigurationModel> replacementStrategy) -
replaceWithDeepCopy
protected void replaceWithDeepCopy(AbstractOrderEntryModel cloneEntry, ProductConfigurationModel oldConfiguration, Map<String, String> oldConfigId2newConfigIdMap) -
replaceWithShallowCopy
protected void replaceWithShallowCopy(AbstractOrderEntryModel cloneEntry, ProductConfigurationModel oldConfiguration) -
replaceBaseSiteIfPossible
-
getConfigDeepCopyHandler
-
setConfigDeepCopyHandler
-
getPersistenceService
-
setPersistenceService
-
getBaseSiteService
-
setBaseSiteService
-
getUserService
-
setUserService
-
getAssignmentResolverStrategy
-
setAssignmentResolverStrategy
public void setAssignmentResolverStrategy(ConfigurationAssignmentResolverStrategy assignmentResolverStrategy) -
getConfigurationDependencyHandler
-
setConfigurationDependencyHandler
public void setConfigurationDependencyHandler(ConfigurationDependencyHandler configurationDependencyHandler) -
getCacheAccessService
-
setCacheAccessService
-