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.String
CX_ACTION_RESULTS
static java.lang.String
CX_ACTION_RESULTS_TIME
static java.lang.String
CX_DEFAULT_ACTION_RESULTS
-
Constructor Summary
Constructors Constructor Description DefaultCxActionResultService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearActionResultsInSession(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 CxActionResultDao
getActionResultDao()
protected int
getActionResultMaxRepeat()
java.util.List<CxAbstractActionResult>
getActionResults(UserModel user, CatalogVersionModel catalogVersion)
Retrieves action results from the current session for given user and catalog version.protected CxConfigurationService
getCxConfigurationService()
java.util.Optional<CxResultsModel>
getCxResults(UserModel user, CatalogVersionModel cv)
Returns user result persisted in databaseprotected CxUserSegmentSessionService
getCxUserSegmentSessionService()
protected java.lang.String
getDefaultResultsKey(UserModel user, CatalogVersionModel catalogVersion)
protected DefaultSessionTokenService
getDefaultSessionTokenService()
protected ModelService
getModelService()
protected java.lang.String
getResultsKey(UserModel user, CatalogVersionModel catalogVersion)
protected java.lang.String
getResultsTimeKey(UserModel user, CatalogVersionModel catalogVersion)
protected SerializationService
getSerializationService()
protected SessionService
getSessionService()
protected java.util.Optional<CxResultsModel>
getSingleResult(java.lang.String resultsKey)
protected TimeService
getTimeService()
protected UserService
getUserService()
protected void
loadActionResultsInSession(UserModel user, CxResultsModel r)
void
loadActionResultsInSession(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 void
loadActionResultsInSessionInternal(UserModel user, java.util.Collection<CatalogVersionModel> catalogVersions)
protected void
loadSegmentsIntoSession(UserModel user, CxResultsModel r)
protected void
saveDefaultResult(CxResultsModel results)
void
setActionResultDao(CxActionResultDao actionResultDao)
void
setActionResultsInSession(UserModel user, CatalogVersionModel catalogVersion, java.util.List<CxAbstractActionResult> actionResults)
Stores action results in the current session for given user and catalog versionvoid
setCxConfigurationService(CxConfigurationService cxConfigurationService)
void
setCxUserSegmentSessionService(CxUserSegmentSessionService cxUserSegmentSessionService)
void
setDefaultSessionTokenService(DefaultSessionTokenService defaultSessionTokenService)
void
setModelService(ModelService modelService)
void
setSerializationService(SerializationService serializationService)
void
setSessionService(SessionService sessionService)
void
setTimeService(TimeService timeService)
void
setUserService(UserService userService)
protected boolean
shouldHandleSegments()
void
storeActionResults(UserModel user, CatalogVersionModel cv, java.util.List<CxAbstractActionResult> actionResults)
Save action resultsvoid
storeDefaultActionResults(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:CxActionResultService
Stores action results in the current session for given user and catalog version- Specified by:
setActionResultsInSession
in 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:CxActionResultService
Load action results stored on the persisted user for the catalog versions and store them on the session.- Specified by:
loadActionResultsInSession
in 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:
storeDefaultActionResults
in 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:CxActionResultService
Save action results- Specified by:
storeActionResults
in 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:CxActionResultService
Returns user result persisted in database- Specified by:
getCxResults
in 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:CxActionResultService
Removes action results from the current session for given user and catalog version- Specified by:
clearActionResultsInSession
in 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:CxActionResultService
Retrieves action results from the current session for given user and catalog version.- Specified by:
getActionResults
in 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)
-
-