Class MockSessionService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.session.impl.DefaultSessionService
-
- de.hybris.platform.servicelayer.session.MockSessionService
-
- All Implemented Interfaces:
SessionService
,java.io.Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
SAPMockSessionService
public class MockSessionService extends DefaultSessionService
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
Nested classes/interfaces inherited from interface de.hybris.platform.servicelayer.session.SessionService
SessionService.SessionAttributeLoader<T>
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description MockSessionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeSession(Session session)
Closed the givenSession
Session
createNewSession()
Creates a newSession
.Session
createSession()
Must be overwritten! Use <lookup-method> in spring.java.lang.Object
executeInLocalView(SessionExecutionBody body)
Executes the givenSessionExecutionBody
in a localSessionContext
java.lang.Object
executeInLocalView(SessionExecutionBody body, UserModel model)
Executes the givenSessionExecutionBody
in a localSessionContext
and sets session user to given UserModel.Session
getCurrentSession()
<T> T
getOrLoadAttribute(java.lang.String name, SessionService.SessionAttributeLoader<T> loader)
Returns for the given name the content which is stored in the currentSession
or loads a new value atomically by calling the loader instance.Session
getSession(java.lang.String id)
get session by Session id-
Methods inherited from class de.hybris.platform.servicelayer.session.impl.DefaultSessionService
closeCurrentSession, executeInLocalViewWithParams, getAllAttributes, getAttribute, getBoundSession, getRawSession, hasCurrentSession, removeAttribute, setAttribute, setModelService
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getCurrentSession
public Session getCurrentSession()
- Specified by:
getCurrentSession
in interfaceSessionService
- Overrides:
getCurrentSession
in classDefaultSessionService
- Returns:
- the current
Session
-
getSession
public Session getSession(java.lang.String id)
get session by Session id- Specified by:
getSession
in interfaceSessionService
- Overrides:
getSession
in classDefaultSessionService
-
createNewSession
public Session createNewSession()
Description copied from interface:SessionService
Creates a newSession
.- Specified by:
createNewSession
in interfaceSessionService
- Overrides:
createNewSession
in classDefaultSessionService
-
executeInLocalView
public java.lang.Object executeInLocalView(SessionExecutionBody body)
Description copied from interface:SessionService
Executes the givenSessionExecutionBody
in a localSessionContext
- Specified by:
executeInLocalView
in interfaceSessionService
- Overrides:
executeInLocalView
in classDefaultSessionService
-
closeSession
public void closeSession(Session session)
Description copied from interface:SessionService
Closed the givenSession
- Specified by:
closeSession
in interfaceSessionService
- Overrides:
closeSession
in classDefaultSessionService
- Parameters:
session
- the session which will be closed
-
createSession
public Session createSession()
Description copied from class:DefaultSessionService
Must be overwritten! Use <lookup-method> in spring.- Overrides:
createSession
in classDefaultSessionService
-
executeInLocalView
public java.lang.Object executeInLocalView(SessionExecutionBody body, UserModel model)
Description copied from interface:SessionService
Executes the givenSessionExecutionBody
in a localSessionContext
and sets session user to given UserModel.- Specified by:
executeInLocalView
in interfaceSessionService
- Overrides:
executeInLocalView
in classDefaultSessionService
-
getOrLoadAttribute
public <T> T getOrLoadAttribute(java.lang.String name, SessionService.SessionAttributeLoader<T> loader)
Description copied from interface:SessionService
Returns for the given name the content which is stored in the currentSession
or loads a new value atomically by calling the loader instance.- Specified by:
getOrLoadAttribute
in interfaceSessionService
- Overrides:
getOrLoadAttribute
in classDefaultSessionService
-
-