Interface RecommendationBufferService
-
- All Known Implementing Classes:
DefaultRecommendationBufferService
public interface RecommendationBufferServiceCollection of database usage for recommendation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<SAPRecoImpressionAggrModel>getAggregatedImpressions(int batchSize)Read aListofSAPRecoImpressionAggrModel.java.util.List<SAPRecoClickthroughModel>getClickthroughs(int batchSize)ReadListofSAPRecoClickthroughModel.SAPRecommendationBufferModelgetGenericRecommendation(java.lang.String scenarioId, java.lang.String leadingItems)Get recommendations with scope Gjava.lang.StringgetHashIdsForUser(java.lang.String userId, java.lang.String scenarioId)Get all hash ids for userjava.util.List<SAPRecoImpressionModel>getImpressions(int batchSize)ReadListofSAPRecoImpressionModel.java.util.List<SAPOfferInteractionModel>getOfferInteractions(int batchSize)ReadListofSAPOfferInteractionModel.SAPRecommendationBufferModelgetPersonalizedRecommendation(java.lang.String userId, java.lang.String scenarioId, java.lang.String leadingItems)Get a recommendation.SAPRecommendationBufferModelgetRestrictedRecommendation(java.lang.String scenarioId, java.lang.String leadingItems)Get recommendations with scope RbooleanisRecommendationExpired(SAPRecommendationBufferModel recommendation)Check if a recommendation is expired.voidremoveExpiredMappings()Remove expired mappings based on the expiry offset.voidremoveExpiredRecommendations()Remove expired recommendations based on the expiry offset.voidremoveExpiredTypeMappings()Remove expired mappings based on the expiry offset.voidsaveRecommendation(java.lang.String userId, java.lang.String scenarioId, java.lang.String hashId, java.lang.String leadingItems, java.lang.String recoList, java.lang.String recoType, java.util.Date expiresOn)Add a new recommendation entry.
-
-
-
Method Detail
-
getAggregatedImpressions
java.util.List<SAPRecoImpressionAggrModel> getAggregatedImpressions(int batchSize)
Read aListofSAPRecoImpressionAggrModel.- Parameters:
batchSize- Batch size.- Returns:
ListofSAPRecoImpressionAggrModel.
-
getClickthroughs
java.util.List<SAPRecoClickthroughModel> getClickthroughs(int batchSize)
ReadListofSAPRecoClickthroughModel.- Parameters:
batchSize- Batch size.- Returns:
ListofSAPRecoClickthroughModel
-
getGenericRecommendation
SAPRecommendationBufferModel getGenericRecommendation(java.lang.String scenarioId, java.lang.String leadingItems)
Get recommendations with scope G- Parameters:
scenarioId- Scenario ID.leadingItems- Leading items.- Returns:
SAPRecommendationBufferModel.
-
getRestrictedRecommendation
SAPRecommendationBufferModel getRestrictedRecommendation(java.lang.String scenarioId, java.lang.String leadingItems)
Get recommendations with scope R- Parameters:
scenarioId- Scenario ID.leadingItems- Leading items.- Returns:
SAPRecommendationBufferModel.
-
getImpressions
java.util.List<SAPRecoImpressionModel> getImpressions(int batchSize)
ReadListofSAPRecoImpressionModel.- Parameters:
batchSize- Batch size.- Returns:
ListofSAPRecoImpressionModel
-
getOfferInteractions
java.util.List<SAPOfferInteractionModel> getOfferInteractions(int batchSize)
ReadListofSAPOfferInteractionModel.- Parameters:
batchSize- Batch size.- Returns:
ListofSAPOfferInteractionModel.
-
getPersonalizedRecommendation
SAPRecommendationBufferModel getPersonalizedRecommendation(java.lang.String userId, java.lang.String scenarioId, java.lang.String leadingItems)
Get a recommendation.- Parameters:
userId- User ID.scenarioId- Scenario ID.leadingItems- Leading items.- Returns:
SAPRecommendationBufferModel.
-
isRecommendationExpired
boolean isRecommendationExpired(SAPRecommendationBufferModel recommendation)
Check if a recommendation is expired.- Parameters:
recommendation-SAPRecommendationBufferModel.- Returns:
- true if expired, false otherwise.
-
removeExpiredMappings
void removeExpiredMappings()
Remove expired mappings based on the expiry offset.
-
removeExpiredRecommendations
void removeExpiredRecommendations()
Remove expired recommendations based on the expiry offset.
-
removeExpiredTypeMappings
void removeExpiredTypeMappings()
Remove expired mappings based on the expiry offset.
-
saveRecommendation
void saveRecommendation(java.lang.String userId, java.lang.String scenarioId, java.lang.String hashId, java.lang.String leadingItems, java.lang.String recoList, java.lang.String recoType, java.util.Date expiresOn)Add a new recommendation entry.- Parameters:
userId- User ID.scenarioId- Scenario ID.hashId- Hash ID.leadingItems- Leading items.recoList- Recommendation List.recoType- Recommendation Type.expiresOn- Expire date.
-
getHashIdsForUser
java.lang.String getHashIdsForUser(java.lang.String userId, java.lang.String scenarioId)Get all hash ids for user- Parameters:
userId- User IDscenarioId- Scenario ID- Returns:
- Comma separated list string of hash ids
-
-