Class SessionServiceImpl
java.lang.Object
org.bonitasoft.engine.session.impl.SessionServiceImpl
- All Implemented Interfaces:
SessionService
- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte
-
Field Summary
Fields inherited from interface org.bonitasoft.engine.session.SessionService
SYSTEM, SYSTEM_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete all invalid sessionscreateSession(long userId, String userName, boolean isTechnicalUser) createSession(long userId, String userName, boolean isTechnicalUser, List<String> profiles, Set<String> permissions) createSession(String userName) Create a new session for the given user;voidDelete all sessionsvoiddeleteSession(long sessionId) Delete a session having the given idvoidDeletes all the sessions.voidDelete all sessions of a tenant except the one of the technical userlongRetrieve the default sessions's duration, in milliseconds.longgetLoggedUserFromSession(ReadSessionAccessor sessionAccessor) getSession(long sessionId) Retrieve a session by its idlongRetrieve the duration, in milliseconds, of new created session.booleanisValid(long sessionId) Verify if a session is validvoidrenewSession(long sessionId) Update the expiration and the last update dates of the session.voidsetSessionDuration(long duration) Define how long, in milliseconds, the created sessions will be valid.
-
Constructor Details
-
SessionServiceImpl
-
-
Method Details
-
createSession
Description copied from interface:SessionServiceCreate a new session for the given user;- Specified by:
createSessionin interfaceSessionService- Parameters:
userName- userName- Returns:
- a new session
- Throws:
SSessionException- if some error arrives while creating the session
-
createSession
public SSession createSession(long userId, String userName, boolean isTechnicalUser) throws SSessionException - Specified by:
createSessionin interfaceSessionService- Throws:
SSessionException
-
createSession
public SSession createSession(long userId, String userName, boolean isTechnicalUser, List<String> profiles, Set<String> permissions) throws SSessionException - Specified by:
createSessionin interfaceSessionService- Throws:
SSessionException
-
deleteSession
Description copied from interface:SessionServiceDelete a session having the given id- Specified by:
deleteSessionin interfaceSessionService- Parameters:
sessionId- the session's id- Throws:
SSessionNotFoundException- if no session exists for the given id
-
isValid
Description copied from interface:SessionServiceVerify if a session is valid- Specified by:
isValidin interfaceSessionService- Parameters:
sessionId- the session's id- Returns:
- true if the session is valid, false otherwise
- Throws:
SSessionNotFoundException- if no session exists for the given id
-
getSession
Description copied from interface:SessionServiceRetrieve a session by its id- Specified by:
getSessionin interfaceSessionService- Parameters:
sessionId- the session's id- Returns:
- the session associated to the given id
- Throws:
SSessionNotFoundException- if no session exists for the given id
-
getLoggedUserFromSession
- Specified by:
getLoggedUserFromSessionin interfaceSessionService- Parameters:
sessionAccessor- the sessionAccessor that contains the current session- Returns:
- the logged user or -1 if there is no session
-
setSessionDuration
public void setSessionDuration(long duration) Description copied from interface:SessionServiceDefine how long, in milliseconds, the created sessions will be valid. This does not affect already created session- Specified by:
setSessionDurationin interfaceSessionService
-
getDefaultSessionDuration
public long getDefaultSessionDuration()Description copied from interface:SessionServiceRetrieve the default sessions's duration, in milliseconds.- Specified by:
getDefaultSessionDurationin interfaceSessionService- Returns:
- the default sessions's duration
-
getSessionDuration
public long getSessionDuration()Description copied from interface:SessionServiceRetrieve the duration, in milliseconds, of new created session. If no duration was specified, the default duration will be used- Specified by:
getSessionDurationin interfaceSessionService- Returns:
- the duration of new created session.
-
renewSession
Description copied from interface:SessionServiceUpdate the expiration and the last update dates of the session.- Specified by:
renewSessionin interfaceSessionService- Parameters:
sessionId- the session id- Throws:
SSessionException- if some error arrives while creating the session
-
cleanInvalidSessions
public void cleanInvalidSessions()Description copied from interface:SessionServiceDelete all invalid sessions- Specified by:
cleanInvalidSessionsin interfaceSessionService
-
deleteAllSessions
public void deleteAllSessions()Description copied from interface:SessionServiceDelete all sessions- Specified by:
deleteAllSessionsin interfaceSessionService
-
deleteSessionsExceptTechnicalUser
public void deleteSessionsExceptTechnicalUser()Description copied from interface:SessionServiceDelete all sessions of a tenant except the one of the technical user- Specified by:
deleteSessionsExceptTechnicalUserin interfaceSessionService
-
deleteSessions
public void deleteSessions()Description copied from interface:SessionServiceDeletes all the sessions.- Specified by:
deleteSessionsin interfaceSessionService
-