Interface PlatformSessionService
-
- All Known Implementing Classes:
PlatformSessionServiceImpl
public interface PlatformSessionService- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
createSession
SPlatformSession createSession(java.lang.String username) throws SSessionException
Create a new session for the given user;- Parameters:
username- user name- Returns:
- a new session
- Throws:
SSessionException- if some error arrives while creating the session- Since:
- 6.0
-
deleteSession
void deleteSession(long sessionId) throws SSessionNotFoundExceptionDelete a session having the given id- Parameters:
sessionId- the session's id- Throws:
SSessionNotFoundException- if no session exists for the given id- Since:
- 6.0
-
isValid
boolean isValid(long sessionId) throws SSessionNotFoundExceptionVerify if a session is valid- Parameters:
sessionId- the session's id- Returns:
- true if the session is valid, false otherwise
- Throws:
SSessionNotFoundException- Since:
- 6.0
-
getSession
SPlatformSession getSession(long sessionId) throws SSessionNotFoundException
Retrieve a session by its id- Parameters:
sessionId- the session's id- Returns:
- the session associated to the given id
- Throws:
SSessionNotFoundException- if no session exists for the given id- Since:
- 6.0
-
setSessionDuration
void setSessionDuration(long duration)
Define how long new created sessions will be valid. This does not affect already created session- Parameters:
duration- session's duration- Since:
- 6.0
-
getDefaultSessionDuration
long getDefaultSessionDuration()
Retrieve the default sessions's duration- Returns:
- the default sessions's duration
- Since:
- 6.0
-
getSessionsDuration
long getSessionsDuration()
Retrieve the duration of new created sessions. If no duration was specified, the default duration will be used- Returns:
- the duration of new created sessions
- Since:
- 6.0
-
renewSession
void renewSession(long sessionId) throws SSessionExceptionUpdate the expiration and the last update dates of the session.- Parameters:
sessionId- the session's id- Throws:
SSessionException- Since:
- 6.0
-
-