Package ome.services.sessions
Class SessionProviderInDb
- java.lang.Object
- 
- ome.services.sessions.SessionProviderInDb
 
- 
- All Implemented Interfaces:
- SessionProvider,- ReadOnlyStatus.IsAware
 
 public class SessionProviderInDb extends java.lang.Object implements SessionProvider, ReadOnlyStatus.IsAware Is for ISession a cache and will be kept there in sync? OR Factors out the logic from ISession and SessionManagerI Therefore either called directly, or via synchronous messages. Uses the name of a Principal as the key to the session. We may need to limit user names to prevent this. (Strictly alphanumeric) Receives notifications as anApplicationListener, which should be used to keep theSessioninstances up-to-date.- Since:
- 3.0-Beta3
 
- 
- 
Constructor SummaryConstructors Constructor Description SessionProviderInDb(ome.system.Roles roles, NodeProvider nodeProvider, Executor executor, ome.util.SqlAction sqlAction)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteCloseSession(java.lang.String uuid)Loads a session directly, sets its "closed" value and immediately saves it.ome.model.meta.SessionexecuteInternalSession(java.lang.String uuid, ome.model.meta.Session session)longexecuteNextSessionId()Added as an attempt to cure ticket:1176ome.model.meta.SessionexecuteUpdate(ome.system.ServiceFactory sf, ome.model.meta.Session session, java.lang.String uuid, long userId, java.lang.Long sudoerId)ome.model.meta.SessionfindSessionById(long id, ome.system.ServiceFactory sf)Retrieves a session by ID.ome.model.meta.SessionfindSessionById(long id, org.hibernate.Session session)Retrieves a session by ID.java.lang.LongfindSessionIdByUuid(java.lang.String uuid)java.lang.LongfindSessionIdByUuid(java.lang.String uuid, ome.system.ServiceFactory sf)booleanisReadOnly(ReadOnlyStatus readOnly)
 
- 
- 
- 
Constructor Detail- 
SessionProviderInDbpublic SessionProviderInDb(ome.system.Roles roles, NodeProvider nodeProvider, Executor executor, ome.util.SqlAction sqlAction)
 
- 
 - 
Method Detail- 
executeUpdatepublic 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:
- executeUpdatein interface- SessionProvider
 
 - 
executeCloseSessionpublic void executeCloseSession(java.lang.String uuid) Description copied from interface:SessionProviderLoads 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 withinSessionCacheand so this is called fromSessionManagerImpl.onApplicationEvent(org.springframework.context.ApplicationEvent)when aDestroySessionMessageis received.- Specified by:
- executeCloseSessionin interface- SessionProvider
 
 - 
executeInternalSessionpublic ome.model.meta.Session executeInternalSession(java.lang.String uuid, ome.model.meta.Session session)- Specified by:
- executeInternalSessionin interface- SessionProvider
 
 - 
executeNextSessionIdpublic long executeNextSessionId() Description copied from interface:SessionProviderAdded as an attempt to cure ticket:1176- Specified by:
- executeNextSessionIdin interface- SessionProvider
 
 - 
findSessionByIdpublic ome.model.meta.Session findSessionById(long id, org.hibernate.Session session)Description copied from interface:SessionProviderRetrieves a session by ID.- Specified by:
- findSessionByIdin interface- SessionProvider
- Parameters:
- id- session ID to lookup
- session- active Hibernate session
- Returns:
- See above.
 
 - 
findSessionByIdpublic ome.model.meta.Session findSessionById(long id, ome.system.ServiceFactory sf)Description copied from interface:SessionProviderRetrieves a session by ID.- Specified by:
- findSessionByIdin interface- SessionProvider
- Parameters:
- id- session ID to lookup
- sf- active service factory
- Returns:
- See above.
 
 - 
findSessionIdByUuidpublic java.lang.Long findSessionIdByUuid(java.lang.String uuid, ome.system.ServiceFactory sf)- Specified by:
- findSessionIdByUuidin interface- SessionProvider
 
 - 
findSessionIdByUuidpublic java.lang.Long findSessionIdByUuid(java.lang.String uuid) - Specified by:
- findSessionIdByUuidin interface- SessionProvider
 
 - 
isReadOnlypublic boolean isReadOnly(ReadOnlyStatus readOnly) - Specified by:
- isReadOnlyin interface- ReadOnlyStatus.IsAware
- Parameters:
- readOnly- a read-only status, typically the current one
- Returns:
- if that status puts this class into read-only mode
 
 
- 
 
-