Class MockConfigurationService
- java.lang.Object
-
- de.hybris.platform.sap.sapproductconfigsombol.transaction.util.impl.MockConfigurationService
-
- All Implemented Interfaces:
ProductConfigurationService
public class MockConfigurationService extends java.lang.Object implements ProductConfigurationService
This is mock implementation of the ConfigurationService
-
-
Constructor Summary
Constructors Constructor Description MockConfigurationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalculateNumberOfIncompleteCsticsAndSolvableConflicts(java.lang.String configId)Get the number of errors (conflict, not filled mandatory fields), as it is set at the cart itemConfigModelcreateConfigurationForVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.ConfigModelcreateConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration)Creates a configuration from the external string representation (which contains the configuration in XML format)ConfigModelcreateConfigurationFromExternalSource(Configuration extConfig)/** Create aConfigModelbased on aConfigurationfor the provided product code.ConfigModelcreateDefaultConfiguration(KBKey kbKey)Based on the hybris product code, provided via theKBKey.productCode, the configuration engine will provide a default configuration for the requested product.KBKeyextractKbKey(java.lang.String productCode, java.lang.String externalConfig)Extracts the KBKey from the external configurationintgetTotalNumberOfIssues(ConfigModel configModel)Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)booleanhasKbForDate(java.lang.String productCode, java.util.Date kbDate)Checks whether a kb version exists for a given product and datebooleanhasKbForVersion(KBKey kbKey, java.lang.String externalConfig)Checks whether kb version specified in the external config still existsbooleanisKbVersionValid(KBKey kbKey)Checks whether kb version exists and is valid for specified datevoidreleaseSession(java.lang.String configId)Releases the configuration sessions identified by the provided ID and all associated resources.ConfigModelretrieveConfigurationModel(java.lang.String configId)Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.java.lang.StringretrieveExternalConfiguration(java.lang.String configId)Retrieve the actual configuration model for the requestedconfigIdin a XML format.voidupdateConfiguration(ConfigModel model)Update the configuration model within the configuration engine.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.sap.productconfig.services.intf.ProductConfigurationService
createConfigurationFromExternal, createConfigurationFromExternal, releaseSession
-
-
-
-
Method Detail
-
createDefaultConfiguration
public ConfigModel createDefaultConfiguration(KBKey kbKey)
Description copied from interface:ProductConfigurationServiceBased on the hybris product code, provided via theKBKey.productCode, the configuration engine will provide a default configuration for the requested product.- Specified by:
createDefaultConfigurationin interfaceProductConfigurationService- Parameters:
kbKey- The product code for the configurable product- Returns:
- The configurable product with default configuration
-
createConfigurationForVariant
public ConfigModel createConfigurationForVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)
Description copied from interface:ProductConfigurationServiceBased on the hybris product code, the configuration engine will provide a configuration for the requested product variant.- Specified by:
createConfigurationForVariantin interfaceProductConfigurationService- Parameters:
baseProductCode- The product code for the configurable base productvariantProductCode- The product code for the specific product variant- Returns:
- The configurable product with default configuration
-
updateConfiguration
public void updateConfiguration(ConfigModel model)
Description copied from interface:ProductConfigurationServiceUpdate the configuration model within the configuration engine.- Specified by:
updateConfigurationin interfaceProductConfigurationService- Parameters:
model- Updated model
-
retrieveConfigurationModel
public ConfigModel retrieveConfigurationModel(java.lang.String configId)
Description copied from interface:ProductConfigurationServiceRetrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.- Specified by:
retrieveConfigurationModelin interfaceProductConfigurationService- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
-
retrieveExternalConfiguration
public java.lang.String retrieveExternalConfiguration(java.lang.String configId)
Description copied from interface:ProductConfigurationServiceRetrieve the actual configuration model for the requestedconfigIdin a XML format.- Specified by:
retrieveExternalConfigurationin interfaceProductConfigurationService- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration as XML string
-
createConfigurationFromExternal
public ConfigModel createConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration)
Description copied from interface:ProductConfigurationServiceCreates a configuration from the external string representation (which contains the configuration in XML format)- Specified by:
createConfigurationFromExternalin interfaceProductConfigurationService- Parameters:
kbKey- Key attributes needed to create a modelexternalConfiguration- Configuration as XML string- Returns:
- Configuration model
-
createConfigurationFromExternalSource
public ConfigModel createConfigurationFromExternalSource(Configuration extConfig)
Description copied from interface:ProductConfigurationService/** Create aConfigModelbased on aConfigurationfor the provided product code.- Specified by:
createConfigurationFromExternalSourcein interfaceProductConfigurationService- Parameters:
extConfig- Configuration in a data structure- Returns:
- Configuration model
-
releaseSession
public void releaseSession(java.lang.String configId)
Description copied from interface:ProductConfigurationServiceReleases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Specified by:
releaseSessionin interfaceProductConfigurationService- Parameters:
configId- session id
-
calculateNumberOfIncompleteCsticsAndSolvableConflicts
public int calculateNumberOfIncompleteCsticsAndSolvableConflicts(java.lang.String configId)
Description copied from interface:ProductConfigurationServiceGet the number of errors (conflict, not filled mandatory fields), as it is set at the cart item- Specified by:
calculateNumberOfIncompleteCsticsAndSolvableConflictsin interfaceProductConfigurationService- Parameters:
configId- id of the configuration- Returns:
- Total number of errors
-
hasKbForDate
public boolean hasKbForDate(java.lang.String productCode, java.util.Date kbDate)Description copied from interface:ProductConfigurationServiceChecks whether a kb version exists for a given product and date- Specified by:
hasKbForDatein interfaceProductConfigurationService- Parameters:
productCode- product codekbDate- date of the knowledgebase- Returns:
- true if KB version for the date exists
-
hasKbForVersion
public boolean hasKbForVersion(KBKey kbKey, java.lang.String externalConfig)
Description copied from interface:ProductConfigurationServiceChecks whether kb version specified in the external config still exists- Specified by:
hasKbForVersionin interfaceProductConfigurationService- Parameters:
kbKey- knowledgebase key which is used to extract product codeexternalConfig- external configuration- Returns:
- true if KB version specified in the external config exists
-
getTotalNumberOfIssues
public int getTotalNumberOfIssues(ConfigModel configModel)
Description copied from interface:ProductConfigurationServiceReturns the total number of issues (number of solvable conflicts + number of incomplete cstics)- Specified by:
getTotalNumberOfIssuesin interfaceProductConfigurationService- Parameters:
configModel- configuration model- Returns:
- total number of issues
-
isKbVersionValid
public boolean isKbVersionValid(KBKey kbKey)
Description copied from interface:ProductConfigurationServiceChecks whether kb version exists and is valid for specified date- Specified by:
isKbVersionValidin interfaceProductConfigurationService- Parameters:
kbKey- knowledgebase key- Returns:
- true if KB version exists and is valid
-
extractKbKey
public KBKey extractKbKey(java.lang.String productCode, java.lang.String externalConfig)
Description copied from interface:ProductConfigurationServiceExtracts the KBKey from the external configuration- Specified by:
extractKbKeyin interfaceProductConfigurationService- Parameters:
productCode- product codeexternalConfig- external config- Returns:
- returns the kBKey of the given external config
-
-