public class MockSessionService extends DefaultSessionService
AbstractService.SerializableDTOSessionService.SessionAttributeLoader<T>tenant| Constructor and Description |
|---|
MockSessionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeSession(Session session)
Closed the given
Session |
Session |
createNewSession()
Creates a new
Session. |
Session |
createSession()
Must be overwritten! Use <lookup-method> in spring.
|
java.lang.Object |
executeInLocalView(SessionExecutionBody body)
Executes the given
SessionExecutionBody in a local SessionContext |
java.lang.Object |
executeInLocalView(SessionExecutionBody body,
UserModel model)
Executes the given
SessionExecutionBody in a local SessionContext 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 current
Session or loads a new value
atomically by calling the loader instance. |
Session |
getSession(java.lang.String id)
get session by Session id
|
closeCurrentSession, executeInLocalViewWithParams, getAllAttributes, getAttribute, getBoundSession, getRawSession, hasCurrentSession, removeAttribute, setAttribute, setModelServiceafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplacepublic Session getCurrentSession()
getCurrentSession in interface SessionServicegetCurrentSession in class DefaultSessionServiceSessionpublic Session getSession(java.lang.String id)
getSession in interface SessionServicegetSession in class DefaultSessionServicepublic Session createNewSession()
SessionServiceSession.createNewSession in interface SessionServicecreateNewSession in class DefaultSessionServicepublic java.lang.Object executeInLocalView(SessionExecutionBody body)
SessionServiceSessionExecutionBody in a local SessionContextexecuteInLocalView in interface SessionServiceexecuteInLocalView in class DefaultSessionServicepublic void closeSession(Session session)
SessionServiceSessioncloseSession in interface SessionServicecloseSession in class DefaultSessionServicesession - the session which will be closedpublic Session createSession()
DefaultSessionServicecreateSession in class DefaultSessionServicepublic java.lang.Object executeInLocalView(SessionExecutionBody body, UserModel model)
SessionServiceSessionExecutionBody in a local SessionContext and sets session user to given
UserModel.executeInLocalView in interface SessionServiceexecuteInLocalView in class DefaultSessionServicepublic <T> T getOrLoadAttribute(java.lang.String name,
SessionService.SessionAttributeLoader<T> loader)
SessionServiceSession or loads a new value
atomically by calling the loader instance.getOrLoadAttribute in interface SessionServicegetOrLoadAttribute in class DefaultSessionServiceCopyright © 2018 SAP SE. All Rights Reserved.