Class ConfigurationMasterDataServiceImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.runtime.cps.masterdata.service.impl.ConfigurationMasterDataServiceImpl
-
- All Implemented Interfaces:
ConfigurationMasterDataService
public class ConfigurationMasterDataServiceImpl extends java.lang.Object implements ConfigurationMasterDataService
Default implementation ofConfigurationMasterDataService. Accesses a hybris cache viaMasterDataCacheAccessServicefor providing configuration related master data
-
-
Constructor Summary
Constructors Constructor Description ConfigurationMasterDataServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MasterDataCacheAccessServicegetCacheAccessService()CPSMasterDataCharacteristicContainergetCharacteristic(java.lang.String kbId, java.lang.String characteristicId)Gets localised master data for characteristicjava.util.List<java.lang.String>getGroupCharacteristicIDs(java.lang.String kbId, java.lang.String itemKey, java.lang.String itemType, java.lang.String groupId)Gets characteristic ids for group.java.lang.StringgetGroupName(java.lang.String kbId, java.lang.String itemKey, java.lang.String itemType, java.lang.String groupId)Gets localised name for group.protected I18NServicegetI18NService()java.lang.StringgetItemName(java.lang.String kbId, java.lang.String id, java.lang.String type)Gets localised name for itemjava.lang.IntegergetKbBuildNumber(java.lang.String kbId)Retrieves the build number for the specified knowledgebase idCPSMasterDataKnowledgeBaseContainergetMasterData(java.lang.String kbId)Get master data by KB idprotected MasterDataContainerResolvergetMasterDataResolver()java.util.Set<java.lang.String>getPossibleValueIds(java.lang.String kbId, java.lang.String characteristicId)Get all possible value ids for a given characteristicjava.util.Set<java.lang.String>getSpecificPossibleValueIds(java.lang.String kbId, java.lang.String productId, java.lang.String itemType, java.lang.String characteristicId)Get all specific (that have a variant condition) possible value ids for a given characteristic.java.lang.StringgetValueName(java.lang.String kbId, java.lang.String characteristicId, java.lang.String valueId)Gets localised name for valuejava.lang.StringgetValuePricingKey(java.lang.String kbId, java.lang.String productId, java.lang.String characteristicId, java.lang.String valueId)Get pricing key for valuebooleanisCharacteristicNumeric(java.lang.String kbId, java.lang.String csticId)Checks if a characteristic is numericbooleanisProductMultilevel(java.lang.String kbId, java.lang.String id)Gives information whether product is multilevelvoidremoveCachedKb(java.lang.String kbId)Removes the knowledgebase from the hybris cache in order to force a reload from servicevoidsetCacheAccessService(MasterDataCacheAccessService cacheAccessService)voidsetI18NService(I18NService i18nService)voidsetMasterDataResolver(MasterDataContainerResolver masterDataResolver)
-
-
-
Method Detail
-
getMasterData
public CPSMasterDataKnowledgeBaseContainer getMasterData(java.lang.String kbId)
Description copied from interface:ConfigurationMasterDataServiceGet master data by KB id- Specified by:
getMasterDatain interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebase- Returns:
- knowledgebase data for the given id
-
getItemName
public java.lang.String getItemName(java.lang.String kbId, java.lang.String id, java.lang.String type)Description copied from interface:ConfigurationMasterDataServiceGets localised name for item- Specified by:
getItemNamein interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseid- id of the itemtype- type of the item- Returns:
- localised name of the item
-
isProductMultilevel
public boolean isProductMultilevel(java.lang.String kbId, java.lang.String id)Description copied from interface:ConfigurationMasterDataServiceGives information whether product is multilevel- Specified by:
isProductMultilevelin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseid- id of the product- Returns:
- whether product is multilevel
-
getGroupName
public java.lang.String getGroupName(java.lang.String kbId, java.lang.String itemKey, java.lang.String itemType, java.lang.String groupId)Description copied from interface:ConfigurationMasterDataServiceGets localised name for group. In case we are requesting the group name for class nodes, the class name will be returned as the class node doesn't carry UI groups, except for the 'general' dummy group- Specified by:
getGroupNamein interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseitemKey- id of the product or classitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHgroupId- id of the group. Not relevant for class nodes- Returns:
- localised name of the group
-
getCharacteristic
public CPSMasterDataCharacteristicContainer getCharacteristic(java.lang.String kbId, java.lang.String characteristicId)
Description copied from interface:ConfigurationMasterDataServiceGets localised master data for characteristic- Specified by:
getCharacteristicin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebasecharacteristicId- id of the characteristic- Returns:
- localised master data of the characteristic
-
getValueName
public java.lang.String getValueName(java.lang.String kbId, java.lang.String characteristicId, java.lang.String valueId)Description copied from interface:ConfigurationMasterDataServiceGets localised name for value- Specified by:
getValueNamein interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebasecharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- localised name of the value
-
getGroupCharacteristicIDs
public java.util.List<java.lang.String> getGroupCharacteristicIDs(java.lang.String kbId, java.lang.String itemKey, java.lang.String itemType, java.lang.String groupId)Description copied from interface:ConfigurationMasterDataServiceGets characteristic ids for group. In case we are requesting the characteristics for class nodes, all characteristic assigned to the class node will be returned as the class node does not carry any group besides the 'general' dummy group- Specified by:
getGroupCharacteristicIDsin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseitemKey- id of the product or a class nodeitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHgroupId- id of the group. Not relevant for class nodes- Returns:
- list of characteristic ids belonging to the group
-
getValuePricingKey
public java.lang.String getValuePricingKey(java.lang.String kbId, java.lang.String productId, java.lang.String characteristicId, java.lang.String valueId)Description copied from interface:ConfigurationMasterDataServiceGet pricing key for value- Specified by:
getValuePricingKeyin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseproductId- id of the productcharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- pricing key for the given value
-
getSpecificPossibleValueIds
public java.util.Set<java.lang.String> getSpecificPossibleValueIds(java.lang.String kbId, java.lang.String productId, java.lang.String itemType, java.lang.String characteristicId)Description copied from interface:ConfigurationMasterDataServiceGet all specific (that have a variant condition) possible value ids for a given characteristic. For class nodes, which don't carry variant key assignments, an empty Set is returned- Specified by:
getSpecificPossibleValueIdsin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebaseproductId- id of the product of of a class nodeitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHcharacteristicId- id of the characteristic- Returns:
- list of possible value ids
-
getPossibleValueIds
public java.util.Set<java.lang.String> getPossibleValueIds(java.lang.String kbId, java.lang.String characteristicId)Description copied from interface:ConfigurationMasterDataServiceGet all possible value ids for a given characteristic- Specified by:
getPossibleValueIdsin interfaceConfigurationMasterDataService- Parameters:
kbId- id of the knowledgebasecharacteristicId- id of the characteristic- Returns:
- list of possible value ids
-
isCharacteristicNumeric
public boolean isCharacteristicNumeric(java.lang.String kbId, java.lang.String csticId)Description copied from interface:ConfigurationMasterDataServiceChecks if a characteristic is numeric- Specified by:
isCharacteristicNumericin interfaceConfigurationMasterDataService- Parameters:
kbId- Id of the knowledgebasecsticId- Id of the characteristic- Returns:
- whether characteristic is numeric
-
getKbBuildNumber
public java.lang.Integer getKbBuildNumber(java.lang.String kbId)
Description copied from interface:ConfigurationMasterDataServiceRetrieves the build number for the specified knowledgebase id- Specified by:
getKbBuildNumberin interfaceConfigurationMasterDataService- Parameters:
kbId- Id of the knowledgebase- Returns:
- build number of the knowledgebase
-
removeCachedKb
public void removeCachedKb(java.lang.String kbId)
Description copied from interface:ConfigurationMasterDataServiceRemoves the knowledgebase from the hybris cache in order to force a reload from service- Specified by:
removeCachedKbin interfaceConfigurationMasterDataService- Parameters:
kbId- Id of the knowledgebase
-
getCacheAccessService
protected MasterDataCacheAccessService getCacheAccessService()
- Returns:
- the cacheAccessService
-
setCacheAccessService
public void setCacheAccessService(MasterDataCacheAccessService cacheAccessService)
- Parameters:
cacheAccessService- the cacheAccessService to set
-
getI18NService
protected I18NService getI18NService()
- Returns:
- the I18N Service
-
setI18NService
public void setI18NService(I18NService i18nService)
- Parameters:
i18nService- the i18NService to set
-
getMasterDataResolver
protected MasterDataContainerResolver getMasterDataResolver()
-
setMasterDataResolver
public void setMasterDataResolver(MasterDataContainerResolver masterDataResolver)
-
-