Package ome.services.sessions
Class SessionProviderWrapper<P extends SessionProvider & ReadOnlyStatus.IsAware>
- java.lang.Object
-
- ome.services.sessions.SessionProviderWrapper<P>
-
- Type Parameters:
P
- session providers that adjust according to read-only status
- All Implemented Interfaces:
SessionProvider
public class SessionProviderWrapper<P extends SessionProvider & ReadOnlyStatus.IsAware> extends java.lang.Object implements SessionProvider
A session provider that offers a unified view of multiple underlying session providers.- Since:
- 5.4.6
-
-
Constructor Summary
Constructors Constructor Description SessionProviderWrapper(ReadOnlyStatus readOnly, java.util.List<P> providers)
Construct a new Session provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeCloseSession(java.lang.String uuid)
Loads a session directly, sets its "closed" value and immediately saves it.ome.model.meta.Session
executeInternalSession(java.lang.String uuid, ome.model.meta.Session session)
long
executeNextSessionId()
Added as an attempt to cure ticket:1176ome.model.meta.Session
executeUpdate(ome.system.ServiceFactory sf, ome.model.meta.Session session, java.lang.String uuid, long userId, java.lang.Long sudoerId)
ome.model.meta.Session
findSessionById(long id, ome.system.ServiceFactory sf)
Retrieves a session by ID.ome.model.meta.Session
findSessionById(long id, org.hibernate.Session hibernateSession)
Retrieves a session by ID.java.lang.Long
findSessionIdByUuid(java.lang.String uuid)
java.lang.Long
findSessionIdByUuid(java.lang.String uuid, ome.system.ServiceFactory sf)
-
-
-
Constructor Detail
-
SessionProviderWrapper
public SessionProviderWrapper(ReadOnlyStatus readOnly, java.util.List<P> providers)
Construct a new Session provider.- Parameters:
readOnly
- the read-only statusproviders
- the Session providers to wrap: the earlier providers are tried first and at least one provider must support write operations according toReadOnlyStatus.IsAware.isReadOnly(ReadOnlyStatus)
-
-
Method Detail
-
executeUpdate
public ome.model.meta.Session executeUpdate(ome.system.ServiceFactory sf, ome.model.meta.Session session, java.lang.String uuid, long userId, java.lang.Long sudoerId)
- Specified by:
executeUpdate
in interfaceSessionProvider
-
executeCloseSession
public void executeCloseSession(java.lang.String uuid)
Description copied from interface:SessionProvider
Loads a session directly, sets its "closed" value and immediately saves it. This method is not called directly from theSessionManager.close(String)
andSessionManager.closeAll()
methods since there are other non-explicit ways for a session to be destroyed, such as a timeout withinSessionCache
and so this is called fromSessionManagerImpl.onApplicationEvent(org.springframework.context.ApplicationEvent)
when aDestroySessionMessage
is received.- Specified by:
executeCloseSession
in interfaceSessionProvider
-
executeInternalSession
public ome.model.meta.Session executeInternalSession(java.lang.String uuid, ome.model.meta.Session session)
- Specified by:
executeInternalSession
in interfaceSessionProvider
-
executeNextSessionId
public long executeNextSessionId()
Description copied from interface:SessionProvider
Added as an attempt to cure ticket:1176- Specified by:
executeNextSessionId
in interfaceSessionProvider
-
findSessionById
public ome.model.meta.Session findSessionById(long id, org.hibernate.Session hibernateSession)
Description copied from interface:SessionProvider
Retrieves a session by ID.- Specified by:
findSessionById
in interfaceSessionProvider
- Parameters:
id
- session ID to lookuphibernateSession
- active Hibernate session- Returns:
- See above.
-
findSessionById
public ome.model.meta.Session findSessionById(long id, ome.system.ServiceFactory sf)
Description copied from interface:SessionProvider
Retrieves a session by ID.- Specified by:
findSessionById
in interfaceSessionProvider
- Parameters:
id
- session ID to lookupsf
- active service factory- Returns:
- See above.
-
findSessionIdByUuid
public java.lang.Long findSessionIdByUuid(java.lang.String uuid, ome.system.ServiceFactory sf)
- Specified by:
findSessionIdByUuid
in interfaceSessionProvider
-
findSessionIdByUuid
public java.lang.Long findSessionIdByUuid(java.lang.String uuid)
- Specified by:
findSessionIdByUuid
in interfaceSessionProvider
-
-