public class SessionServiceImpl extends java.lang.Object implements SessionService
SYSTEM, SYSTEM_ID| Constructor and Description |
|---|
SessionServiceImpl(SessionProvider sessionProvider,
java.lang.String applicationName,
TechnicalLoggerService logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanInvalidSessions()
Delete all invalid sessions
|
SSession |
createSession(long tenantId,
long userId,
java.lang.String userName,
boolean isTechnicalUser) |
SSession |
createSession(long tenantId,
long userId,
java.lang.String userName,
boolean isTechnicalUser,
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.
|
public SessionServiceImpl(SessionProvider sessionProvider, java.lang.String applicationName, TechnicalLoggerService logger)
public SSession createSession(long tenantId, java.lang.String userName) throws SSessionException
SessionServicecreateSession in interface SessionServiceuserName - userNameSSessionException - if some error arrives while creating the sessionpublic SSession createSession(long tenantId, long userId, java.lang.String userName, boolean isTechnicalUser) throws SSessionException
createSession in interface SessionServiceSSessionExceptionpublic SSession createSession(long tenantId, long userId, java.lang.String userName, boolean isTechnicalUser, java.util.List<java.lang.String> profiles) throws SSessionException
createSession in interface SessionServiceSSessionExceptionpublic void deleteSession(long sessionId)
throws SSessionNotFoundException
SessionServicedeleteSession in interface SessionServicesessionId - the session's idSSessionNotFoundException - if no session exists for the given idpublic boolean isValid(long sessionId)
throws SSessionNotFoundException
SessionServiceisValid in interface SessionServicesessionId - the session's idSSessionNotFoundException - if no session exists for the given idpublic SSession getSession(long sessionId) throws SSessionNotFoundException
SessionServicegetSession in interface SessionServicesessionId - the session's idSSessionNotFoundException - if no session exists for the given idpublic long getLoggedUserFromSession(ReadSessionAccessor sessionAccessor)
getLoggedUserFromSession in interface SessionServicesessionAccessor - the sessionAccessor that contains the current sessionpublic void setSessionDuration(long duration)
SessionServicesetSessionDuration in interface SessionServicepublic long getDefaultSessionDuration()
SessionServicegetDefaultSessionDuration in interface SessionServicepublic long getSessionDuration()
SessionServicegetSessionDuration in interface SessionServicepublic void renewSession(long sessionId)
throws SSessionException
SessionServicerenewSession in interface SessionServicesessionId - the session idSSessionException - if some error arrives while creating the sessionpublic void cleanInvalidSessions()
SessionServicecleanInvalidSessions in interface SessionServicepublic void deleteSessionsOfTenant(long tenantId)
SessionServicedeleteSessionsOfTenant in interface SessionServicepublic void deleteSessionsOfTenantExceptTechnicalUser(long tenantId)
SessionServicedeleteSessionsOfTenantExceptTechnicalUser in interface SessionServicepublic void deleteSessions()
SessionServicedeleteSessions in interface SessionService