Class DefaultUserRecommendationService<P extends UserRecommendation>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.recommendationengine.service.DefaultUserRecommendationService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,UserRecommendationService<P>
public class DefaultUserRecommendationService<P extends UserRecommendation>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements UserRecommendationService<P>
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUserRecommendationService
(UserRecommendationRepository<com.broadleafcommerce.data.tracking.core.Trackable> userRecommendationRepository, CustomerReferenceRepository<com.broadleafcommerce.data.tracking.core.Trackable> customerReferenceRepository, CatalogItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> catalogItemRepository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogItemRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected CustomerReferenceRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected UserRecommendationRepository<com.broadleafcommerce.data.tracking.core.Trackable>
hydrate
(UserRecommendation userRecommendation, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates the Catalog Item relationship onto theUserRecommendationItem
.readByCustomerId
(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read User Recommendation by the Broadleaf Customer Context IDJpaCustomerReference.getContextId()
readByCustomerUsername
(String customerUsername, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read User Recommendation by the Broadleaf Customer UsernameJpaCustomerReference.getUsername()
readByUserId
(String userId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read User Recommendation by the Numerical Customer Reference ID which is used by the ALS Recommendation Training ModelJpaCustomerReference.getNumericId()
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Constructor Details
-
DefaultUserRecommendationService
public DefaultUserRecommendationService(UserRecommendationRepository<com.broadleafcommerce.data.tracking.core.Trackable> userRecommendationRepository, CustomerReferenceRepository<com.broadleafcommerce.data.tracking.core.Trackable> customerReferenceRepository, CatalogItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> catalogItemRepository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Details
-
readByUserId
public Optional<P> readByUserId(@NonNull String userId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:UserRecommendationService
Read User Recommendation by the Numerical Customer Reference ID which is used by the ALS Recommendation Training ModelJpaCustomerReference.getNumericId()
- Specified by:
readByUserId
in interfaceUserRecommendationService<P extends UserRecommendation>
- Parameters:
userId
- - the numerical customer reference identifier- Returns:
-
readByCustomerId
public Optional<P> readByCustomerId(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:UserRecommendationService
Read User Recommendation by the Broadleaf Customer Context IDJpaCustomerReference.getContextId()
- Specified by:
readByCustomerId
in interfaceUserRecommendationService<P extends UserRecommendation>
- Parameters:
customerId
- - Broadleaf's customer identifier- Returns:
-
readByCustomerUsername
public Optional<P> readByCustomerUsername(String customerUsername, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:UserRecommendationService
Read User Recommendation by the Broadleaf Customer UsernameJpaCustomerReference.getUsername()
- Specified by:
readByCustomerUsername
in interfaceUserRecommendationService<P extends UserRecommendation>
- Parameters:
customerUsername
- - Broadleaf's customer username- Returns:
-
hydrate
public UserRecommendation hydrate(UserRecommendation userRecommendation, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:UserRecommendationService
Hydrates the Catalog Item relationship onto theUserRecommendationItem
. that are in the {@link {@link UserRecommendation#getItems()}- Specified by:
hydrate
in interfaceUserRecommendationService<P extends UserRecommendation>
- Parameters:
userRecommendation
- The recommendation to hydrate- Returns:
- The hydrated
userRecommendation
.
-
getUserRecommendationRepository
protected UserRecommendationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getUserRecommendationRepository() -
getCustomerReferenceRepository
protected CustomerReferenceRepository<com.broadleafcommerce.data.tracking.core.Trackable> getCustomerReferenceRepository() -
getCatalogItemRepository
protected CatalogItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> getCatalogItemRepository()
-