Interface PlatformSessionService
- All Known Implementing Classes:
PlatformSessionServiceImpl
public interface PlatformSessionService
- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte
-
Method Summary
Modifier and TypeMethodDescriptioncreateSession(String username) Create a new session for the given user;voiddeleteSession(long sessionId) Delete a session having the given idlongRetrieve the default sessions's durationgetSession(long sessionId) Retrieve a session by its idlongRetrieve 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 Details
-
createSession
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
Delete 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
Verify 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
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
Update the expiration and the last update dates of the session.- Parameters:
sessionId- the session's id- Throws:
SSessionException- Since:
- 6.0
-