Class PlatformSessionServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.platform.session.impl.PlatformSessionServiceImpl
-
- All Implemented Interfaces:
PlatformSessionService
@Component public class PlatformSessionServiceImpl extends java.lang.Object implements PlatformSessionService
- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte
-
-
Constructor Summary
Constructors Constructor Description PlatformSessionServiceImpl(PlatformSessionProvider platformSessionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SPlatformSessioncreateSession(java.lang.String username)Create a new session for the given user;voiddeleteSession(long sessionId)Delete a session having the given idlonggetDefaultSessionDuration()Retrieve the default sessions's durationSPlatformSessiongetSession(long sessionId)Retrieve a session by its idlonggetSessionsDuration()Retrieve the duration of new created sessions.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 new created sessions will be valid.
-
-
-
Constructor Detail
-
PlatformSessionServiceImpl
public PlatformSessionServiceImpl(PlatformSessionProvider platformSessionProvider)
-
-
Method Detail
-
createSession
public SPlatformSession createSession(java.lang.String username) throws SSessionException
Description copied from interface:PlatformSessionServiceCreate a new session for the given user;- Specified by:
createSessionin interfacePlatformSessionService- Parameters:
username- user name- Returns:
- a new session
- Throws:
SSessionException- if some error arrives while creating the session
-
deleteSession
public void deleteSession(long sessionId) throws SSessionNotFoundExceptionDescription copied from interface:PlatformSessionServiceDelete a session having the given id- Specified by:
deleteSessionin interfacePlatformSessionService- Parameters:
sessionId- the session's id- Throws:
SSessionNotFoundException- if no session exists for the given id
-
isValid
public boolean isValid(long sessionId) throws SSessionNotFoundExceptionDescription copied from interface:PlatformSessionServiceVerify if a session is valid- Specified by:
isValidin interfacePlatformSessionService- Parameters:
sessionId- the session's id- Returns:
- true if the session is valid, false otherwise
- Throws:
SSessionNotFoundException
-
getSession
public SPlatformSession getSession(long sessionId) throws SSessionNotFoundException
Description copied from interface:PlatformSessionServiceRetrieve a session by its id- Specified by:
getSessionin interfacePlatformSessionService- Parameters:
sessionId- the session's id- Returns:
- the session associated to the given id
- Throws:
SSessionNotFoundException- if no session exists for the given id
-
setSessionDuration
public void setSessionDuration(long duration)
Description copied from interface:PlatformSessionServiceDefine how long new created sessions will be valid. This does not affect already created session- Specified by:
setSessionDurationin interfacePlatformSessionService- Parameters:
duration- session's duration
-
getDefaultSessionDuration
public long getDefaultSessionDuration()
Description copied from interface:PlatformSessionServiceRetrieve the default sessions's duration- Specified by:
getDefaultSessionDurationin interfacePlatformSessionService- Returns:
- the default sessions's duration
-
getSessionsDuration
public long getSessionsDuration()
Description copied from interface:PlatformSessionServiceRetrieve the duration of new created sessions. If no duration was specified, the default duration will be used- Specified by:
getSessionsDurationin interfacePlatformSessionService- Returns:
- the duration of new created sessions
-
renewSession
public void renewSession(long sessionId) throws SSessionExceptionDescription copied from interface:PlatformSessionServiceUpdate the expiration and the last update dates of the session.- Specified by:
renewSessionin interfacePlatformSessionService- Parameters:
sessionId- the session's id- Throws:
SSessionException
-
-