Class DefaultCxActionResultService
- java.lang.Object
-
- de.hybris.platform.personalizationservices.action.impl.DefaultCxActionResultService
-
- All Implemented Interfaces:
CxActionResultService
public class DefaultCxActionResultService extends java.lang.Object implements CxActionResultService
Default implementation ofCxActionResultService.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCX_ACTION_RESULTSstatic java.lang.StringCX_ACTION_RESULTS_TIMEstatic java.lang.StringCX_DEFAULT_ACTION_RESULTS
-
Constructor Summary
Constructors Constructor Description DefaultCxActionResultService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearActionResultsInSession(UserModel user, CatalogVersionModel catalogVersion)Removes action results from the current session for given user and catalog versionprotected java.util.Optional<CxResultsModel>createActionResults(java.lang.String resultsKey, UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)protected java.util.Optional<CxResultsModel>findResults(UserModel user, CatalogVersionModel catalogVersion)protected CxActionResultDaogetActionResultDao()protected intgetActionResultMaxRepeat()java.util.List<CxAbstractActionResult>getActionResults(UserModel user, CatalogVersionModel catalogVersion)Retrieves action results from the current session for given user and catalog version.protected CxConfigurationServicegetCxConfigurationService()java.util.Optional<CxResultsModel>getCxResults(UserModel user, CatalogVersionModel cv)Returns user result persisted in databaseprotected CxUserSegmentSessionServicegetCxUserSegmentSessionService()protected java.lang.StringgetDefaultResultsKey(UserModel user, CatalogVersionModel catalogVersion)protected DefaultSessionTokenServicegetDefaultSessionTokenService()protected ModelServicegetModelService()protected java.lang.StringgetResultsKey(UserModel user, CatalogVersionModel catalogVersion)protected java.lang.StringgetResultsTimeKey(UserModel user, CatalogVersionModel catalogVersion)protected SerializationServicegetSerializationService()protected SessionServicegetSessionService()protected java.util.Optional<CxResultsModel>getSingleResult(java.lang.String resultsKey)protected TimeServicegetTimeService()protected UserServicegetUserService()protected voidloadActionResultsInSession(UserModel user, CxResultsModel r)voidloadActionResultsInSession(UserModel user, java.util.Collection<CatalogVersionModel> catalogVersions)Load action results stored on the persisted user for the catalog versions and store them on the session.protected voidloadActionResultsInSessionInternal(UserModel user, java.util.Collection<CatalogVersionModel> catalogVersions)protected voidloadSegmentsIntoSession(UserModel user, CxResultsModel r)protected voidsaveDefaultResult(CxResultsModel results)voidsetActionResultDao(CxActionResultDao actionResultDao)voidsetActionResultsInSession(UserModel user, CatalogVersionModel catalogVersion, java.util.List<CxAbstractActionResult> actionResults)Stores action results in the current session for given user and catalog versionvoidsetCxConfigurationService(CxConfigurationService cxConfigurationService)voidsetCxUserSegmentSessionService(CxUserSegmentSessionService cxUserSegmentSessionService)voidsetDefaultSessionTokenService(DefaultSessionTokenService defaultSessionTokenService)voidsetModelService(ModelService modelService)voidsetSerializationService(SerializationService serializationService)voidsetSessionService(SessionService sessionService)voidsetTimeService(TimeService timeService)voidsetUserService(UserService userService)protected booleanshouldHandleSegments()voidstoreActionResults(UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)Save action resultsvoidstoreDefaultActionResults(UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)* Save default action results
-
-
-
Field Detail
-
CX_ACTION_RESULTS
public static final java.lang.String CX_ACTION_RESULTS
- See Also:
- Constant Field Values
-
CX_ACTION_RESULTS_TIME
public static final java.lang.String CX_ACTION_RESULTS_TIME
- See Also:
- Constant Field Values
-
CX_DEFAULT_ACTION_RESULTS
public static final java.lang.String CX_DEFAULT_ACTION_RESULTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setActionResultsInSession
public void setActionResultsInSession(UserModel user, CatalogVersionModel catalogVersion, java.util.List<CxAbstractActionResult> actionResults)
Description copied from interface:CxActionResultServiceStores action results in the current session for given user and catalog version- Specified by:
setActionResultsInSessionin interfaceCxActionResultService- Parameters:
user- user for which action results should be storedcatalogVersion- Catalog versionactionResults- action results to store
-
loadActionResultsInSession
public void loadActionResultsInSession(UserModel user, java.util.Collection<CatalogVersionModel> catalogVersions)
Description copied from interface:CxActionResultServiceLoad action results stored on the persisted user for the catalog versions and store them on the session.- Specified by:
loadActionResultsInSessionin interfaceCxActionResultService- Parameters:
user- user to load the action results fromcatalogVersions- catalog versions to load the action results for
-
getActionResultMaxRepeat
protected int getActionResultMaxRepeat()
-
loadActionResultsInSessionInternal
protected void loadActionResultsInSessionInternal(UserModel user, java.util.Collection<CatalogVersionModel> catalogVersions)
-
findResults
protected java.util.Optional<CxResultsModel> findResults(UserModel user, CatalogVersionModel catalogVersion)
-
loadActionResultsInSession
protected void loadActionResultsInSession(UserModel user, CxResultsModel r)
-
loadSegmentsIntoSession
protected void loadSegmentsIntoSession(UserModel user, CxResultsModel r)
-
shouldHandleSegments
protected boolean shouldHandleSegments()
-
storeDefaultActionResults
public void storeDefaultActionResults(UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)
Description copied from interface:CxActionResultService* Save default action results- Specified by:
storeDefaultActionResultsin interfaceCxActionResultService- Parameters:
user- user for whom we save resultscv- catalog version for which we save resultsactionResults- action results to save
-
saveDefaultResult
protected void saveDefaultResult(CxResultsModel results)
-
storeActionResults
public void storeActionResults(UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)
Description copied from interface:CxActionResultServiceSave action results- Specified by:
storeActionResultsin interfaceCxActionResultService- Parameters:
user- user for whom we save resultscv- catalog version for which we save resultsactionResults- action results to save
-
createActionResults
protected java.util.Optional<CxResultsModel> createActionResults(java.lang.String resultsKey, UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)
-
getSingleResult
protected java.util.Optional<CxResultsModel> getSingleResult(java.lang.String resultsKey)
-
getCxResults
public java.util.Optional<CxResultsModel> getCxResults(UserModel user, CatalogVersionModel cv)
Description copied from interface:CxActionResultServiceReturns user result persisted in database- Specified by:
getCxResultsin interfaceCxActionResultService- Parameters:
user- user to get results forcv- catalog version for which we retrieve result- Returns:
- result for given parameters or Optional.empty
-
clearActionResultsInSession
public void clearActionResultsInSession(UserModel user, CatalogVersionModel catalogVersion)
Description copied from interface:CxActionResultServiceRemoves action results from the current session for given user and catalog version- Specified by:
clearActionResultsInSessionin interfaceCxActionResultService- Parameters:
user- for which action results should be removedcatalogVersion- Catalog version
-
getActionResults
public java.util.List<CxAbstractActionResult> getActionResults(UserModel user, CatalogVersionModel catalogVersion)
Description copied from interface:CxActionResultServiceRetrieves action results from the current session for given user and catalog version.- Specified by:
getActionResultsin interfaceCxActionResultService- Parameters:
user- for which action results should be retrievedcatalogVersion- Catalog version- Returns:
- Collection of action results (may be empty). Not null.
-
getResultsKey
protected java.lang.String getResultsKey(UserModel user, CatalogVersionModel catalogVersion)
-
getResultsTimeKey
protected java.lang.String getResultsTimeKey(UserModel user, CatalogVersionModel catalogVersion)
-
getDefaultResultsKey
protected java.lang.String getDefaultResultsKey(UserModel user, CatalogVersionModel catalogVersion)
-
getSessionService
protected SessionService getSessionService()
-
getCxConfigurationService
protected CxConfigurationService getCxConfigurationService()
-
getSerializationService
protected SerializationService getSerializationService()
-
getModelService
protected ModelService getModelService()
-
getTimeService
protected TimeService getTimeService()
-
getUserService
protected UserService getUserService()
-
getDefaultSessionTokenService
protected DefaultSessionTokenService getDefaultSessionTokenService()
-
getActionResultDao
protected CxActionResultDao getActionResultDao()
-
getCxUserSegmentSessionService
protected CxUserSegmentSessionService getCxUserSegmentSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
setSerializationService
public void setSerializationService(SerializationService serializationService)
-
setModelService
public void setModelService(ModelService modelService)
-
setTimeService
public void setTimeService(TimeService timeService)
-
setCxConfigurationService
public void setCxConfigurationService(CxConfigurationService cxConfigurationService)
-
setUserService
public void setUserService(UserService userService)
-
setDefaultSessionTokenService
public void setDefaultSessionTokenService(DefaultSessionTokenService defaultSessionTokenService)
-
setActionResultDao
public void setActionResultDao(CxActionResultDao actionResultDao)
-
setCxUserSegmentSessionService
public void setCxUserSegmentSessionService(CxUserSegmentSessionService cxUserSegmentSessionService)
-
-