Interface SessionController<S extends Session>
- Type Parameters:
S
- The type of the Session for this to handle.
- All Known Implementing Classes:
DefaultSessionController
public interface SessionController<S extends Session>
An abstract controller for
Sessions
,
Implementations should be able to create their respectively controlled implementations
using an instance of SessionData
and maintain the created instances for the entire lifetime of the session.- Author:
- John Grosh ([email protected]), Kaidan Gustave
-
Method Summary
Modifier and TypeMethodDescriptioncreateSession
(SessionData data) Creates a newSession
using the specifiedSessionData
.getSession
(String identifier) Gets aSession
that was previously created using the provided identifier.
-
Method Details
-
getSession
Gets aSession
that was previously created using the provided identifier.It is very important for implementations of SessionController to hold a contract that Sessions created using
createSession(SessionData)
will be maintained and retrievable by external sources at any time.Note that Sessions that have elapsed their effective
expiration
are not necessary to maintain, unless they have been refreshed in which case they should be updated to reflect this.- Parameters:
identifier
- The identifier to get a Session by.- Returns:
- The Session mapped to the identifier provided.
-
createSession
Creates a newSession
using the specifiedSessionData
.Sessions should be kept mapped outside of just creation so that they can be retrieved using
getSession(String)
later for further manipulation, as well as to keep updated if they are refreshed.- Parameters:
data
- The data to create a Session using.- Returns:
- A new Session.
-