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 voidcloseSession(Session session)Closed the givenSessionSessioncreateNewSession()Creates a newSession.SessioncreateSession()Must be overwritten! Use <lookup-method> in spring.java.lang.ObjectexecuteInLocalView(SessionExecutionBody body)Executes the givenSessionExecutionBodyin a localSessionContextjava.lang.ObjectexecuteInLocalView(SessionExecutionBody body, UserModel model)Executes the givenSessionExecutionBodyin a localSessionContextand sets session user to given UserModel.SessiongetCurrentSession()<T> TgetOrLoadAttribute(java.lang.String name, SessionService.SessionAttributeLoader<T> loader)Returns for the given name the content which is stored in the currentSessionor loads a new value atomically by calling the loader instance.SessiongetSession(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:
getCurrentSessionin interfaceSessionService- Overrides:
getCurrentSessionin classDefaultSessionService- Returns:
- the current
Session
-
getSession
public Session getSession(java.lang.String id)
get session by Session id- Specified by:
getSessionin interfaceSessionService- Overrides:
getSessionin classDefaultSessionService
-
createNewSession
public Session createNewSession()
Description copied from interface:SessionServiceCreates a newSession.- Specified by:
createNewSessionin interfaceSessionService- Overrides:
createNewSessionin classDefaultSessionService
-
executeInLocalView
public java.lang.Object executeInLocalView(SessionExecutionBody body)
Description copied from interface:SessionServiceExecutes the givenSessionExecutionBodyin a localSessionContext- Specified by:
executeInLocalViewin interfaceSessionService- Overrides:
executeInLocalViewin classDefaultSessionService
-
closeSession
public void closeSession(Session session)
Description copied from interface:SessionServiceClosed the givenSession- Specified by:
closeSessionin interfaceSessionService- Overrides:
closeSessionin classDefaultSessionService- Parameters:
session- the session which will be closed
-
createSession
public Session createSession()
Description copied from class:DefaultSessionServiceMust be overwritten! Use <lookup-method> in spring.- Overrides:
createSessionin classDefaultSessionService
-
executeInLocalView
public java.lang.Object executeInLocalView(SessionExecutionBody body, UserModel model)
Description copied from interface:SessionServiceExecutes the givenSessionExecutionBodyin a localSessionContextand sets session user to given UserModel.- Specified by:
executeInLocalViewin interfaceSessionService- Overrides:
executeInLocalViewin classDefaultSessionService
-
getOrLoadAttribute
public <T> T getOrLoadAttribute(java.lang.String name, SessionService.SessionAttributeLoader<T> loader)Description copied from interface:SessionServiceReturns for the given name the content which is stored in the currentSessionor loads a new value atomically by calling the loader instance.- Specified by:
getOrLoadAttributein interfaceSessionService- Overrides:
getOrLoadAttributein classDefaultSessionService
-
-