Class DefaultTmaPoService
java.lang.Object
de.hybris.platform.b2ctelcoservices.services.impl.DefaultTmaPoService
- All Implemented Interfaces:
TmaPoService
Default implementation of the
TmaPoService.- Since:
- 6.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.getAllParents(TmaProductOfferingModel poModel) Returns all parents for the given product offering.getBpoForCode(String code) Returns aTmaBundledProductOfferingModelfor the given code.getBundledProdOfferOptionFor(TmaBundledProductOfferingModel bundledProductOffering, TmaProductOfferingModel productOffering) Returns the bundled product offering option part of the provided bpo which is referred to the provided product offering.protected TmaCommercePriceServicegetConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering) Computes and returns the configurableTmaProductSpecCharacteristicModelof a given product.getConfigurableProductSpecCharValueUses(TmaProductOfferingModel productOffering) Gets the configurable product spec characteristics value uses.protected de.hybris.platform.servicelayer.config.ConfigurationServiceSearches for the the group next to the group which contains the PO given as parameter; It returns: the group with index 0, if PO given as parameter is in a group with index higher than 0 or, the group with index 1, if PO given as parameter is in a group with index 0 or, emptyOptionalif no group is found.getIntermediateBpos(TmaProductOfferingModel currentPo, TmaBundledProductOfferingModel targetBpo) Returns the list of BPOs between the provided PO and the target BPO.protected de.hybris.platform.servicelayer.model.ModelServicegetOfferingGroupForPoAndBpo(TmaProductOfferingModel productOffering, TmaBundledProductOfferingModel parent) Retrieves theTmaProductOfferingGroupModelfor a given product inside the givenTmaBundledProductOfferingModelparent.Returns the operational product corresponding to the specified action.getParentIdsFrom(TmaProductOfferingModel productOffering) Returns the set of all parents product offering ids for a given product offering.getPoForCode(String code) Returns aTmaProductOfferingModelfor the given code.getPoForCodeAndPriceContext(String code, TmaPriceContext priceContext) Returns aTmaProductOfferingModelfor the given code and prices of theTmaProductOfferingModelbased on theTmaPriceContextDatagetProductOffering(String productOfferingCode, TmaSubscribedProductAction cartAction) Returns a product offering for the given product code and cart action.getProductOfferingGroupsByProperties(Map<String, String> propertyPattern) Returns the set of @{link TmaProductOfferingGroupModel} based on key and value in map where key is the property name and the value is the pattern value of the propertygetProductOfferings(CatalogVersionModel catalogVersion) Returns product offering list for corresponding catalog versiongetProductOfferings(Collection<CatalogVersionModel> catalogVersions, TmaProductOfferingSearchContext productOfferingSearchContext) Finds theTmaProductOfferingModelfor a given collectionCatalogVersionModelandTmaProductOfferingSearchContextgetProductOfferingsByProperties(Map<String, String> propertyPattern) Returns the set ofTmaProductOfferingModelbased on key and value in map where key is the property name and the value is the pattern value of the propertyprotected de.hybris.platform.product.ProductServicegetProductsForCode(String code) Return the list ofTmaProductOfferingModelbased on product codegetSpoListForBpo(TmaBundledProductOfferingModel bundleProductOffering) This method will traverses down the hierarchy of a given bundle product offering to find out all the child spos.getSposAndFixedBposFor(TmaBundledProductOfferingModel bundledProductOffering) Returns the list of all children product offeringsTmaSimpleProductOfferingModelandTmaFixedBundledProductOfferingModelfor a given bundled product offering.protected TmaProductDaoprotected TmaProductOfferingDaobooleanisPoEligibleForProcessType(TmaProcessType processType, TmaProductOfferingModel product, TmaBundledProductOfferingModel bpo) Verifies if the given product is eligible for the given process type.booleanThis method checks if the given cart action requires an operational product.booleanisValidChild(TmaProductOfferingModel child, TmaBundledProductOfferingModel parent) Verifies if the given child is eligible to be attached on the given parent.booleanisValidParent(TmaProductOfferingModel product, TmaBundledProductOfferingModel parent) Verifies if the givenTmaBundledProductOfferingModelparent is a valid parent for the given product offering.voidRemoves the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.voidRemoves the product offering by id.voidsetCommercePriceService(TmaCommercePriceService commercePriceService) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) voidsetProductService(de.hybris.platform.product.ProductService productService) voidsetTmaProductOfferingDao(TmaProductOfferingDao tmaProductOfferingDao)
-
Constructor Details
-
DefaultTmaPoService
-
-
Method Details
-
getPoForCode
Description copied from interface:TmaPoServiceReturns aTmaProductOfferingModelfor the given code.- Specified by:
getPoForCodein interfaceTmaPoService- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
getPoForCodeAndPriceContext
public TmaProductOfferingModel getPoForCodeAndPriceContext(String code, TmaPriceContext priceContext) Description copied from interface:TmaPoServiceReturns aTmaProductOfferingModelfor the given code and prices of theTmaProductOfferingModelbased on theTmaPriceContextData- Specified by:
getPoForCodeAndPriceContextin interfaceTmaPoService- Parameters:
code- identifier ofTmaProductOfferingModelpriceContext- priceContextTmaPriceContextto retrieve prices of theTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
addPoChildToParent
public void addPoChildToParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child) Description copied from interface:TmaPoServiceAdds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.- Specified by:
addPoChildToParentin interfaceTmaPoService- Parameters:
parent- bundled product offering under which the child is addedchild- child to be added
-
removePoChildFromParent
public void removePoChildFromParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child) Description copied from interface:TmaPoServiceRemoves the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.- Specified by:
removePoChildFromParentin interfaceTmaPoService- Parameters:
parent- bundled product offering from which the child is removedchild- product offering child to be removed
-
getAllParents
Description copied from interface:TmaPoServiceReturns all parents for the given product offering.- Specified by:
getAllParentsin interfaceTmaPoService- Parameters:
poModel- product offering- Returns:
CollectionofTmaBundledProductOfferingModel
-
getGroupNextToProductGroup
public Optional<TmaProductOfferingGroupModel> getGroupNextToProductGroup(TmaBundledProductOfferingModel bpo, TmaProductOfferingModel po) Description copied from interface:TmaPoServiceSearches for the the group next to the group which contains the PO given as parameter; It returns: the group with index 0, if PO given as parameter is in a group with index higher than 0 or, the group with index 1, if PO given as parameter is in a group with index 0 or, emptyOptionalif no group is found.- Specified by:
getGroupNextToProductGroupin interfaceTmaPoService- Parameters:
bpo- theTmaBundledProductOfferingModelpo- theTmaProductOfferingModel- Returns:
OptionalofTmaProductOfferingGroupModel
-
getBpoForCode
Description copied from interface:TmaPoServiceReturns aTmaBundledProductOfferingModelfor the given code.- Specified by:
getBpoForCodein interfaceTmaPoService- Parameters:
code- identifier ofTmaBundledProductOfferingModel- Returns:
TmaBundledProductOfferingModel
-
isPoEligibleForProcessType
public boolean isPoEligibleForProcessType(TmaProcessType processType, TmaProductOfferingModel product, TmaBundledProductOfferingModel bpo) Description copied from interface:TmaPoServiceVerifies if the given product is eligible for the given process type. Eligibility is performed considering the process types defined on the subscription price plans of the given product. If the BPO is given then the checks are performed against price plan overrides of the BPO where the product is defined as affected product.- Specified by:
isPoEligibleForProcessTypein interfaceTmaPoService- Parameters:
processType- the process type that is going to be verifiedproduct- the product checked if eligible for given process typebpo- the BPO where product is part of- Returns:
- true/ false depending on the eligibility of the given product for the process type
-
isValidParent
public boolean isValidParent(TmaProductOfferingModel product, TmaBundledProductOfferingModel parent) Description copied from interface:TmaPoServiceVerifies if the givenTmaBundledProductOfferingModelparent is a valid parent for the given product offering. A valid parent it not necessary a first direct parent, it can also be a parent of one of product parents.- Specified by:
isValidParentin interfaceTmaPoService- Parameters:
product- the given product offering against the checks are madeparent- the given parent to be check if is valid- Returns:
- true if all Set elements are valid product parents codes, false otherwise
-
getOfferingGroupForPoAndBpo
public Optional<TmaProductOfferingGroupModel> getOfferingGroupForPoAndBpo(TmaProductOfferingModel productOffering, TmaBundledProductOfferingModel parent) Description copied from interface:TmaPoServiceRetrieves theTmaProductOfferingGroupModelfor a given product inside the givenTmaBundledProductOfferingModelparent.- Specified by:
getOfferingGroupForPoAndBpoin interfaceTmaPoService- Parameters:
productOffering- theTmaProductOfferingModelwhose product offering group will be identifiedparent- theTmaBundledProductOfferingModelused for filtering the product offering groups- Returns:
- the
TmaProductOfferingGroupModelconfigured for the given product if any
-
getProductOfferings
public SearchPageData<TmaProductOfferingModel> getProductOfferings(Collection<CatalogVersionModel> catalogVersions, TmaProductOfferingSearchContext productOfferingSearchContext) Description copied from interface:TmaPoServiceFinds theTmaProductOfferingModelfor a given collectionCatalogVersionModelandTmaProductOfferingSearchContext- Specified by:
getProductOfferingsin interfaceTmaPoService- Parameters:
catalogVersions- catalog versions used to query for productsproductOfferingSearchContext- product search context object stores all attributes for search- Returns:
- page of
TmaProductOfferingModelwrapped onSearchResult
-
getConfigurableProductSpecCharacteristics
public Set<TmaProductSpecCharacteristicModel> getConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering) Description copied from interface:TmaPoServiceComputes and returns the configurableTmaProductSpecCharacteristicModelof a given product.- Specified by:
getConfigurableProductSpecCharacteristicsin interfaceTmaPoService- Parameters:
productOffering- the product offering- Returns:
- the configurable characteristics
-
getConfigurableProductSpecCharValueUses
public Set<TmaProductSpecCharValueUseModel> getConfigurableProductSpecCharValueUses(TmaProductOfferingModel productOffering) Description copied from interface:TmaPoServiceGets the configurable product spec characteristics value uses.- Specified by:
getConfigurableProductSpecCharValueUsesin interfaceTmaPoService- Parameters:
productOffering- the product offering- Returns:
- the configurable product spec characteristics value uses
-
removeProductOffering
Description copied from interface:TmaPoServiceRemoves the product offering by id.- Specified by:
removeProductOfferingin interfaceTmaPoService- Parameters:
id- the id of the product offering .
-
getOperationalProductOffering
public Optional<TmaOperationalProductOfferingModel> getOperationalProductOffering(TmaSubscribedProductAction action) Description copied from interface:TmaPoServiceReturns the operational product corresponding to the specified action.- Specified by:
getOperationalProductOfferingin interfaceTmaPoService- Parameters:
action- the action that should be supported by the operational product.- Returns:
- The first operational product found that supports the given action, if any.
-
getProductOffering
public ProductModel getProductOffering(String productOfferingCode, TmaSubscribedProductAction cartAction) Description copied from interface:TmaPoServiceReturns a product offering for the given product code and cart action.- Specified by:
getProductOfferingin interfaceTmaPoService- Parameters:
productOfferingCode- the code used for getting a PO if the action is keepcartAction- the cart action- Returns:
- the product offering for the product code and cart action.
-
isServiceRequestAction
Description copied from interface:TmaPoServiceThis method checks if the given cart action requires an operational product.- Specified by:
isServiceRequestActionin interfaceTmaPoService- Parameters:
action- the input action to be checked.- Returns:
- true if an operational Po is used; false otherwise
-
getProductsForCode
Description copied from interface:TmaPoServiceReturn the list ofTmaProductOfferingModelbased on product code- Specified by:
getProductsForCodein interfaceTmaPoService- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
getProductOfferingsByProperties
public Set<TmaProductOfferingModel> getProductOfferingsByProperties(Map<String, String> propertyPattern) Description copied from interface:TmaPoServiceReturns the set ofTmaProductOfferingModelbased on key and value in map where key is the property name and the value is the pattern value of the property- Specified by:
getProductOfferingsByPropertiesin interfaceTmaPoService- Parameters:
propertyPattern- map which has property as key and pattern as value- Returns:
- Set of
TmaProductOfferingModel
-
getProductOfferingGroupsByProperties
public Set<TmaProductOfferingGroupModel> getProductOfferingGroupsByProperties(Map<String, String> propertyPattern) Description copied from interface:TmaPoServiceReturns the set of @{link TmaProductOfferingGroupModel} based on key and value in map where key is the property name and the value is the pattern value of the property- Specified by:
getProductOfferingGroupsByPropertiesin interfaceTmaPoService- Parameters:
propertyPattern- map which has propertyPattern as key and pattern as value- Returns:
- Set of
TmaProductOfferingGroupModel
-
getProductOfferings
Returns product offering list for corresponding catalog version- Specified by:
getProductOfferingsin interfaceTmaPoService- Parameters:
catalogVersion- for which product offerings will be retrieved- Returns:
- List of
TmaProductOfferingModel
-
getSpoListForBpo
public List<TmaSimpleProductOfferingModel> getSpoListForBpo(TmaBundledProductOfferingModel bundleProductOffering) This method will traverses down the hierarchy of a given bundle product offering to find out all the child spos. There might be a case when a given bpo has a child bpo and further this child bpo have many child spos. Returns the list of all child simple product offerings of a given bundle product offering.- Specified by:
getSpoListForBpoin interfaceTmaPoService- Parameters:
bundleProductOffering- the bundle product offering- Returns:
- the child spos of the bundle product offering
-
getBundledProdOfferOptionFor
public Optional<TmaBundledProdOfferOptionModel> getBundledProdOfferOptionFor(TmaBundledProductOfferingModel bundledProductOffering, TmaProductOfferingModel productOffering) Description copied from interface:TmaPoServiceReturns the bundled product offering option part of the provided bpo which is referred to the provided product offering.- Specified by:
getBundledProdOfferOptionForin interfaceTmaPoService- Parameters:
bundledProductOffering- The Bundled Product OfferingproductOffering- The product offering- Returns:
- The
TmaBundledProdOfferOptionModelfrom the bpo which refers to the product offering
-
getIntermediateBpos
public List<TmaBundledProductOfferingModel> getIntermediateBpos(TmaProductOfferingModel currentPo, TmaBundledProductOfferingModel targetBpo) Description copied from interface:TmaPoServiceReturns the list of BPOs between the provided PO and the target BPO.- Specified by:
getIntermediateBposin interfaceTmaPoService- Parameters:
currentPo- The product offeringtargetBpo- The target bundled product offering- Returns:
- List of
TmaBundledProductOfferingModel
-
isValidChild
Description copied from interface:TmaPoServiceVerifies if the given child is eligible to be attached on the given parent. Eligible means that child must be a SPO either a Fixed BPO if the parent is a Fixed BPO- Specified by:
isValidChildin interfaceTmaPoService- Parameters:
child- The PO which is going to be checked if it is eligible for attaching on a Fixed BPOparent- The BPO depending on we know if the child PO is eligible or not- Returns:
- true/ false depending on the eligibility of the given product offering
-
getSposAndFixedBposFor
public List<TmaProductOfferingModel> getSposAndFixedBposFor(TmaBundledProductOfferingModel bundledProductOffering) Description copied from interface:TmaPoServiceReturns the list of all children product offeringsTmaSimpleProductOfferingModelandTmaFixedBundledProductOfferingModelfor a given bundled product offering.- Specified by:
getSposAndFixedBposForin interfaceTmaPoService- Parameters:
bundledProductOffering- the bundle product offering- Returns:
- the child spos or fixed bpos of the product offering
-
getParentIdsFrom
Description copied from interface:TmaPoServiceReturns the set of all parents product offering ids for a given product offering.- Specified by:
getParentIdsFromin interfaceTmaPoService- Parameters:
productOffering- the product offering- Returns:
- A set containing the parents ids of the product offering
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService() -
getProductService
protected de.hybris.platform.product.ProductService getProductService() -
getCommercePriceService
-
getTmaProductOfferingDao
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService() -
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) -
setProductService
public void setProductService(de.hybris.platform.product.ProductService productService) -
setCommercePriceService
-
setTmaProductOfferingDao
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) -
getTmaProductDao
-