Class DefaultSessionController
java.lang.Object
com.jagrosh.jdautilities.oauth2.session.DefaultSessionController
- All Implemented Interfaces:
SessionController<DefaultSessionController.DefaultSession>
public class DefaultSessionController
extends Object
implements SessionController<DefaultSessionController.DefaultSession>
The default
SessionController
implementation.- Author:
- John Grosh ([email protected])
-
Nested Class Summary
-
Constructor Summary
-
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.
-
Constructor Details
-
DefaultSessionController
public DefaultSessionController()
-
-
Method Details
-
getSession
Description copied from interface:SessionController
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
SessionController.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.- Specified by:
getSession
in interfaceSessionController<DefaultSessionController.DefaultSession>
- Parameters:
identifier
- The identifier to get a Session by.- Returns:
- The Session mapped to the identifier provided.
-
createSession
Description copied from interface:SessionController
Creates a newSession
using the specifiedSessionData
.Sessions should be kept mapped outside of just creation so that they can be retrieved using
SessionController.getSession(String)
later for further manipulation, as well as to keep updated if they are refreshed.- Specified by:
createSession
in interfaceSessionController<DefaultSessionController.DefaultSession>
- Parameters:
data
- The data to create a Session using.- Returns:
- A new Session.
-