P
- session providers that adjust according to read-only statuspublic class SessionProviderWrapper<P extends SessionProvider & ReadOnlyStatus.IsAware> extends java.lang.Object implements SessionProvider
Constructor and Description |
---|
SessionProviderWrapper(ReadOnlyStatus readOnly,
java.util.List<P> providers)
Construct a new Session provider.
|
Modifier and Type | Method and Description |
---|---|
void |
executeCloseSession(java.lang.String uuid)
Loads a session directly, sets its "closed" value and immediately
saves it.
|
Session |
executeInternalSession(java.lang.String uuid,
Session session) |
long |
executeNextSessionId()
Added as an attempt to cure ticket:1176
|
Session |
executeUpdate(ServiceFactory sf,
Session session,
java.lang.String uuid,
long userId,
java.lang.Long sudoerId) |
Session |
findSessionById(long id,
ServiceFactory sf)
Retrieves a session by ID.
|
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,
ServiceFactory sf) |
public SessionProviderWrapper(ReadOnlyStatus readOnly, java.util.List<P> providers)
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 to ReadOnlyStatus.IsAware.isReadOnly(ReadOnlyStatus)
public Session executeUpdate(ServiceFactory sf, Session session, java.lang.String uuid, long userId, java.lang.Long sudoerId)
executeUpdate
in interface SessionProvider
public void executeCloseSession(java.lang.String uuid)
SessionProvider
SessionManager.close(String)
and SessionManager.closeAll()
methods
since there are other non-explicit ways for a session to be destroyed, such
as a timeout within SessionCache
and so this is called from
SessionManagerImpl.onApplicationEvent(org.springframework.context.ApplicationEvent)
when a
DestroySessionMessage
is received.executeCloseSession
in interface SessionProvider
public Session executeInternalSession(java.lang.String uuid, Session session)
executeInternalSession
in interface SessionProvider
public long executeNextSessionId()
SessionProvider
executeNextSessionId
in interface SessionProvider
public Session findSessionById(long id, org.hibernate.Session hibernateSession)
SessionProvider
findSessionById
in interface SessionProvider
id
- session ID to lookuphibernateSession
- active Hibernate sessionpublic Session findSessionById(long id, ServiceFactory sf)
SessionProvider
findSessionById
in interface SessionProvider
id
- session ID to lookupsf
- active service factorypublic java.lang.Long findSessionIdByUuid(java.lang.String uuid, ServiceFactory sf)
findSessionIdByUuid
in interface SessionProvider
public java.lang.Long findSessionIdByUuid(java.lang.String uuid)
findSessionIdByUuid
in interface SessionProvider
Version: 5.4.6-ice35-b87
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.