Class RecommendationService
- java.lang.Object
-
- com.hybris.ymkt.recommendation.services.RecommendationService
-
public class RecommendationService extends java.lang.ObjectThis service perform the 'get recommendation' actions, such as reading all scenario hashes of a user or read the recommendation for a given scenario and context.
-
-
Field Summary
Fields Modifier and Type Field Description protected CartServicecartServiceprotected static java.lang.StringGENERIC_RECOMMENDATIONprotected static org.apache.olingo.odata2.api.ep.EntityProviderReadPropertiesNO_READ_PROPERTIESprotected ODataServiceoDataServiceprotected static java.lang.StringPERSONALIZED_RECOMMENDATIONprotected RecentViewedItemsServicerecentViewedItemsServiceprotected static java.lang.StringRECOMMENDATION_SCENARIOSprotected RecommendationBufferServicerecommendationBufferServiceprotected intrequestTimeoutThresholdprotected static java.lang.StringRESTRICTED_RECOMMENDATIONprotected UserContextServiceuserContextService
-
Constructor Summary
Constructors Constructor Description RecommendationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RecommendationScenariocreateRecommendationScenario(RecommendationContext context)java.util.List<java.lang.String>getCartItemsFromSession()Returns product currently in the cartprotected SAPRecommendationBufferModelgetFallbackRecommendationByType(java.lang.String userId, java.lang.String scenarioId, java.util.List<java.lang.String> leadingItems, java.lang.String recommendationType)java.util.List<java.lang.String>getProductRecommendation(RecommendationContext context)ReadProductRecommendationDatas according toRecommendationContext.voidsetCartService(CartService cartService)voidsetODataService(ODataService oDataService)voidsetRecentViewedItemsService(RecentViewedItemsService recentViewedItemsService)voidsetRecommendationBufferService(RecommendationBufferService recommendationBufferService)voidsetRequestTimeoutThreshold(int requestTimeoutThreshold)voidsetUserContextService(UserContextService userContextService)
-
-
-
Field Detail
-
NO_READ_PROPERTIES
protected static final org.apache.olingo.odata2.api.ep.EntityProviderReadProperties NO_READ_PROPERTIES
-
RECOMMENDATION_SCENARIOS
protected static final java.lang.String RECOMMENDATION_SCENARIOS
- See Also:
- Constant Field Values
-
GENERIC_RECOMMENDATION
protected static final java.lang.String GENERIC_RECOMMENDATION
- See Also:
- Constant Field Values
-
PERSONALIZED_RECOMMENDATION
protected static final java.lang.String PERSONALIZED_RECOMMENDATION
- See Also:
- Constant Field Values
-
RESTRICTED_RECOMMENDATION
protected static final java.lang.String RESTRICTED_RECOMMENDATION
- See Also:
- Constant Field Values
-
cartService
protected CartService cartService
-
oDataService
protected ODataService oDataService
-
recentViewedItemsService
protected RecentViewedItemsService recentViewedItemsService
-
recommendationBufferService
protected RecommendationBufferService recommendationBufferService
-
userContextService
protected UserContextService userContextService
-
requestTimeoutThreshold
protected int requestTimeoutThreshold
-
-
Method Detail
-
createRecommendationScenario
protected RecommendationScenario createRecommendationScenario(RecommendationContext context)
-
getCartItemsFromSession
public java.util.List<java.lang.String> getCartItemsFromSession()
Returns product currently in the cart- Returns:
Listof
-
getFallbackRecommendationByType
protected SAPRecommendationBufferModel getFallbackRecommendationByType(java.lang.String userId, java.lang.String scenarioId, java.util.List<java.lang.String> leadingItems, java.lang.String recommendationType)
-
getProductRecommendation
public java.util.List<java.lang.String> getProductRecommendation(RecommendationContext context)
ReadProductRecommendationDatas according toRecommendationContext.- Parameters:
context- Parameters of the recommendations to read.- Returns:
ListofProductRecommendationData
-
setCartService
public void setCartService(CartService cartService)
-
setODataService
public void setODataService(ODataService oDataService)
-
setRecentViewedItemsService
public void setRecentViewedItemsService(RecentViewedItemsService recentViewedItemsService)
-
setRecommendationBufferService
public void setRecommendationBufferService(RecommendationBufferService recommendationBufferService)
-
setRequestTimeoutThreshold
public void setRequestTimeoutThreshold(int requestTimeoutThreshold)
-
setUserContextService
public void setUserContextService(UserContextService userContextService)
-
-