public interface SessionService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SYSTEM
name of the system user in the session
|
static long |
SYSTEM_ID
ID of the system
when something is done by the system, if a user id is required, this id is given
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanInvalidSessions()
Delete all invalid sessions
|
SSession |
createSession(long tenantId,
long userId,
java.lang.String userName,
boolean technicalUser) |
SSession |
createSession(long tenantId,
long userId,
java.lang.String userName,
boolean technicalUser,
java.util.List<java.lang.String> profiles) |
SSession |
createSession(long tenantId,
java.lang.String userName)
Create a new session for the given user;
|
void |
deleteSession(long sessionId)
Delete a session having the given id
|
void |
deleteSessions()
Deletes all the sessions.
|
void |
deleteSessionsOfTenant(long tenantId)
Delete all sessions of a tenant
|
void |
deleteSessionsOfTenantExceptTechnicalUser(long tenantId)
Delete all sessions of a tenant except the one of the technical user
|
long |
getDefaultSessionDuration()
Retrieve the default sessions's duration, in milliseconds.
|
long |
getLoggedUserFromSession(ReadSessionAccessor sessionAccessor) |
SSession |
getSession(long sessionId)
Retrieve a session by its id
|
long |
getSessionDuration()
Retrieve the duration, in milliseconds, of new created session.
|
boolean |
isValid(long sessionId)
Verify if a session is valid
|
void |
renewSession(long sessionId)
Update the expiration and the last update dates of the session.
|
void |
setSessionDuration(long duration)
Define how long, in milliseconds, the created sessions will be valid.
|
static final java.lang.String SYSTEM
static final long SYSTEM_ID
SSession createSession(long tenantId, java.lang.String userName) throws SSessionException
tenantId - userName - userNameSSessionException - if some error arrives while creating the sessionSSession createSession(long tenantId, long userId, java.lang.String userName, boolean technicalUser) throws SSessionException
SSessionExceptionSSession createSession(long tenantId, long userId, java.lang.String userName, boolean technicalUser, java.util.List<java.lang.String> profiles) throws SSessionException
SSessionExceptionvoid deleteSession(long sessionId)
throws SSessionNotFoundException
sessionId - the session's idSSessionNotFoundException - if no session exists for the given idvoid cleanInvalidSessions()
boolean isValid(long sessionId)
throws SSessionNotFoundException
sessionId - the session's idSSessionNotFoundException - if no session exists for the given idSSession getSession(long sessionId) throws SSessionNotFoundException
sessionId - the session's idSSessionNotFoundException - if no session exists for the given idlong getLoggedUserFromSession(ReadSessionAccessor sessionAccessor)
sessionAccessor - the sessionAccessor that contains the current sessionvoid setSessionDuration(long duration)
duration - long getDefaultSessionDuration()
long getSessionDuration()
void renewSession(long sessionId)
throws SSessionException
sessionId - the session idSSessionException - if some error arrives while creating the sessionvoid deleteSessions()
void deleteSessionsOfTenant(long tenantId)
tenantId - void deleteSessionsOfTenantExceptTechnicalUser(long tenantId)
tenantId -