Class CharonFacadeImpl
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.cps.impl.CharonFacadeImpl
- All Implemented Interfaces:
CharonFacade
Default implementation of
CharonFacade. This bean has prototype scope-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CPSCreateConfigInputassembleCreateDefaultConfigurationRequest(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey) protected StringcompileGroupNamesForRequest(List<String> groupNames) protected CPSExternalConfigurationconvertFromStringToStructured(String externalConfiguration) protected CPSCharacteristicInputcreateCharacteristicInput(CPSCharacteristic characteristic) createConfigurationFromExternal(CPSExternalConfiguration externalConfigStructured, String contextProduct) Creates a new runtime configuration from the external typed representation of the configurationcreateConfigurationFromExternal(String externalConfiguration, String contextProduct) Creates a new runtime configuration from the external representation of the configuration.createConfigurationFromExternalWithDate(String externalConfiguration, String contextProduct, Date date) Creates a new runtime configuration from the external representation of the configurationcreateDefaultConfiguration(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey) Create default configuration and handle cookiesprotected Stringprotected de.hybris.platform.apiregistryservices.services.ApiRegistryClientServiceprotected Stringprotected CPSCachegetCache()protected ConfigurationClientBaseprotected CommerceExternalConfigurationStrategygetConfiguration(String configId) Gets configuration, sends cookies along with request.protected CPSConfigurationParentReferenceStrategyprotected CPSContextSuppliergetExternalConfiguration(String configId) Retrieves the external representation for a given runtime configurationprotected de.hybris.platform.servicelayer.i18n.I18NServicegetItemWithGroupDetails(String configId, String instanceId, List<String> groupNames) Reads an item within a configuration and returns all details only for the specified groups of this instanceprotected KnowledgebaseKeyComparatorprotected de.hybris.platform.sap.productconfig.runtime.interf.services.UniqueKeyGeneratorprotected com.fasterxml.jackson.databind.ObjectMapperprotected ProductConfigurationPassportServiceprotected RequestErrorHandlerprotected CPSResponseAttributeStrategyprotected rx.Schedulerprotected StringhandleGeneralGroupId(String groupId) protected StringhandleUpdateOwnCharacteristics(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion, String itemId) protected StringhandleUpdateSubItems(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion) booleanAre domain values ready on demand, on group level?protected CPSExternalConfigurationplaceGetExternalConfigurationRequest(String configId) voidreleaseSession(String configId, String version) Deletes the session for the specified runtime configuration on the clientprotected CPSConfigurationretrieveConfiguration(String configId) protected CPSConfigurationretrieveConfigurationAndSaveResponseAttributes(rx.Observable<com.hybris.charon.RawResponse<CPSConfiguration>> rawResponse) protected CPSConfigurationretrieveConfigurationFromClient(String configId) protected CPSItemretrieveItemAndSaveResponseAttributes(rx.Observable<com.hybris.charon.RawResponse<CPSItem>> rawResponse, String configId) voidsetApiRegistryClientService(de.hybris.platform.apiregistryservices.services.ApiRegistryClientService apiRegistryClientService) voidvoidsetClient(ConfigurationClientBase newClient) Sets charon client from outside.voidsetCommerceExternalConfigurationStrategy(CommerceExternalConfigurationStrategy commerceExternalConfigurationStrategy) voidsetConfigurationParentReferenceStrategy(CPSConfigurationParentReferenceStrategy configurationParentReferenceStrategy) voidsetContextSupplier(CPSContextSupplier contextSupplier) voidsetI18NService(de.hybris.platform.servicelayer.i18n.I18NService i18nService) voidsetKbKeyComparator(KnowledgebaseKeyComparator kbKeyComparator) voidsetKeyGenerator(de.hybris.platform.sap.productconfig.runtime.interf.services.UniqueKeyGenerator keyGenerator) protected voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) voidsetPassportService(ProductConfigurationPassportService sapPassportService) voidsetReadDomainValuesOnDemand(boolean readDomainValuesOnDemand) voidsetRequestErrorHandler(RequestErrorHandler requestErrorHandler) voidsetResponseStrategy(CPSResponseAttributeStrategy responseStrategy) protected voidtraceJsonRequestBody(String prefix, Object obj) updateConfiguration(CPSConfiguration configuration) Updates configuration, sends cookies along with request.protected StringupdateConfiguration(String cfgId, String version, String itemId, String csticId, CPSCharacteristicInput changes) protected StringupdateCPSCharacteristic(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion, String itemId)
-
Field Details
-
ETAG_NOT_FOUND
- See Also:
-
AUTO_CLEAN_UP_FALSE
- See Also:
-
PASSPORT_CREATE_CONFIG
- See Also:
-
PASSPORT_CREATE_FROM_EXT_CONFIG
- See Also:
-
PASSPORT_UPDATE_CONFIG
- See Also:
-
PASSPORT_GET_CONFIG
- See Also:
-
PASSPORT_GET_EXT_CONFIG
- See Also:
-
PASSPORT_DELETE_CONFIG
- See Also:
-
GET_CONFIG_SELECT_ALL
- See Also:
-
GET_CONFIG_SELECT_ALL_WITHOUT_POSSIBLE_VALUES
- See Also:
-
-
Constructor Details
-
CharonFacadeImpl
public CharonFacadeImpl()
-
-
Method Details
-
getPassportService
- Returns:
- the passportService
-
getApiRegistryClientService
protected de.hybris.platform.apiregistryservices.services.ApiRegistryClientService getApiRegistryClientService() -
getCommerceExternalConfigurationStrategy
- Returns:
- the commerceExternalConfigurationStrategy
-
createDefaultConfiguration
public CPSConfiguration createDefaultConfiguration(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey) Description copied from interface:CharonFacadeCreate default configuration and handle cookies- Specified by:
createDefaultConfigurationin interfaceCharonFacade- Parameters:
kbKey- key of the knowledgebase- Returns:
- runtime configuration
-
assembleCreateDefaultConfigurationRequest
protected CPSCreateConfigInput assembleCreateDefaultConfigurationRequest(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey) -
getExternalConfiguration
public String getExternalConfiguration(String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException Description copied from interface:CharonFacadeRetrieves the external representation for a given runtime configuration- Specified by:
getExternalConfigurationin interfaceCharonFacade- Parameters:
configId- id of the runtime configuration- Returns:
- external representation of the runtime configuration
- Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException- Service has failed, e.g. because session timed out
-
placeGetExternalConfigurationRequest
protected CPSExternalConfiguration placeGetExternalConfigurationRequest(String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
createConfigurationFromExternal
public CPSConfiguration createConfigurationFromExternal(String externalConfiguration, String contextProduct) Description copied from interface:CharonFacadeCreates a new runtime configuration from the external representation of the configuration. The KB version will not be re-determined.- Specified by:
createConfigurationFromExternalin interfaceCharonFacade- Parameters:
externalConfiguration- external representation of the configurationcontextProduct- context product- Returns:
- runtime configuration based on the external representation
-
createConfigurationFromExternalWithDate
public CPSConfiguration createConfigurationFromExternalWithDate(String externalConfiguration, String contextProduct, Date date) Description copied from interface:CharonFacadeCreates a new runtime configuration from the external representation of the configuration- Specified by:
createConfigurationFromExternalWithDatein interfaceCharonFacade- Parameters:
externalConfiguration- external representation of the configurationcontextProduct- context productdate- this date will be sent to CPS Service and a KB re-determination happens in order to find the most current KB version Otherwise the result will be exactly the same as callingCharonFacade.createConfigurationFromExternal(CPSExternalConfiguration, String)- Returns:
- runtime configuration based on the external representation
-
createConfigurationFromExternal
public CPSConfiguration createConfigurationFromExternal(CPSExternalConfiguration externalConfigStructured, String contextProduct) Description copied from interface:CharonFacadeCreates a new runtime configuration from the external typed representation of the configuration- Specified by:
createConfigurationFromExternalin interfaceCharonFacade- Parameters:
externalConfigStructured- structured external configurationcontextProduct- context product- Returns:
- Runtime representation
-
getAutoCleanUpFlag
-
convertFromStringToStructured
-
releaseSession
Description copied from interface:CharonFacadeDeletes the session for the specified runtime configuration on the client- Specified by:
releaseSessionin interfaceCharonFacade- Parameters:
configId- id of the runtime configuration to be deletedversion- version of the runtime configuration to be deleted
-
updateConfiguration
public String updateConfiguration(CPSConfiguration configuration) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException Description copied from interface:CharonFacadeUpdates configuration, sends cookies along with request. The cookies are handled internally and received from theCPSResponseAttributeStrategy- Specified by:
updateConfigurationin interfaceCharonFacade- Parameters:
configuration- runtime configuration that includes only the updates- Returns:
- version of the updated runtime configuration
- Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException- when service call fails
-
updateCPSCharacteristic
protected String updateCPSCharacteristic(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion, String itemId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
handleUpdateSubItems
protected String handleUpdateSubItems(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
handleUpdateOwnCharacteristics
protected String handleUpdateOwnCharacteristics(org.apache.commons.lang.mutable.MutableBoolean updateWasDone, CPSItem item, String cfgId, String currentVersion, String itemId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
createCharacteristicInput
-
updateConfiguration
protected String updateConfiguration(String cfgId, String version, String itemId, String csticId, CPSCharacteristicInput changes) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
encode
-
getConfiguration
public CPSConfiguration getConfiguration(String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException Description copied from interface:CharonFacadeGets configuration, sends cookies along with request. The cookies are handled internally and received from theCPSResponseAttributeStrategy- Specified by:
getConfigurationin interfaceCharonFacade- Parameters:
configId- configuration id- Returns:
- current state of the runtime configuration
- Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException- when service call fails
-
retrieveConfiguration
protected CPSConfiguration retrieveConfiguration(String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
retrieveConfigurationFromClient
protected CPSConfiguration retrieveConfigurationFromClient(String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
-
getKbKeyComparator
-
setKbKeyComparator
-
setCommerceExternalConfigurationStrategy
public void setCommerceExternalConfigurationStrategy(CommerceExternalConfigurationStrategy commerceExternalConfigurationStrategy) - Parameters:
commerceExternalConfigurationStrategy-
-
getRequestErrorHandler
-
setRequestErrorHandler
- Parameters:
requestErrorHandler- For wrapping the http errors we receive from the REST service call
-
getClient
-
setClient
Sets charon client from outside. Only used in test environments- Parameters:
newClient- Charon client representing REST calls for product configuration.
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
protected void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
getScheduler
protected rx.Scheduler getScheduler() -
getContextSupplier
- Returns:
- the contextSupplier
-
setContextSupplier
- Parameters:
contextSupplier- the contextSupplier to set
-
getI18NService
protected de.hybris.platform.servicelayer.i18n.I18NService getI18NService() -
setI18NService
public void setI18NService(de.hybris.platform.servicelayer.i18n.I18NService i18nService) - Parameters:
i18nService- the i18NService to set
-
getCache
-
setCache
-
traceJsonRequestBody
-
retrieveConfigurationAndSaveResponseAttributes
protected CPSConfiguration retrieveConfigurationAndSaveResponseAttributes(rx.Observable<com.hybris.charon.RawResponse<CPSConfiguration>> rawResponse) -
retrieveItemAndSaveResponseAttributes
-
getResponseStrategy
-
setResponseStrategy
-
getConfigurationParentReferenceStrategy
-
setConfigurationParentReferenceStrategy
public void setConfigurationParentReferenceStrategy(CPSConfigurationParentReferenceStrategy configurationParentReferenceStrategy) -
setApiRegistryClientService
public void setApiRegistryClientService(de.hybris.platform.apiregistryservices.services.ApiRegistryClientService apiRegistryClientService) -
setPassportService
-
isReadDomainValuesOnDemand
public boolean isReadDomainValuesOnDemand()Description copied from interface:CharonFacadeAre domain values ready on demand, on group level?- Specified by:
isReadDomainValuesOnDemandin interfaceCharonFacade- Returns:
- Domain values read on demand?
-
setReadDomainValuesOnDemand
public void setReadDomainValuesOnDemand(boolean readDomainValuesOnDemand) -
getItemWithGroupDetails
public CPSItem getItemWithGroupDetails(String configId, String instanceId, List<String> groupNames) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException Description copied from interface:CharonFacadeReads an item within a configuration and returns all details only for the specified groups of this instance- Specified by:
getItemWithGroupDetailsin interfaceCharonFacade- Parameters:
configId- Configuration IDinstanceId- Instance Id for which group data are requestedgroupNames- List of requested group names for which we want to read the group details.- Returns:
- Requested characteristic groups including domain values and all details
- Throws:
de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException- Indicates that the CPS call could not be performed
-
compileGroupNamesForRequest
-
handleGeneralGroupId
-
setKeyGenerator
public void setKeyGenerator(de.hybris.platform.sap.productconfig.runtime.interf.services.UniqueKeyGenerator keyGenerator) -
getKeyGenerator
protected de.hybris.platform.sap.productconfig.runtime.interf.services.UniqueKeyGenerator getKeyGenerator()
-