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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSession(SessionData data) Creates a newSessionusing the specifiedSessionData.getSession(String identifier) Gets aSessionthat was previously created using the provided identifier.
-
Constructor Details
-
DefaultSessionController
public DefaultSessionController()
-
-
Method Details
-
getSession
Description copied from interface:SessionControllerGets aSessionthat 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
expirationare not necessary to maintain, unless they have been refreshed in which case they should be updated to reflect this.- Specified by:
getSessionin 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:SessionControllerCreates a newSessionusing 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:
createSessionin interfaceSessionController<DefaultSessionController.DefaultSession>- Parameters:
data- The data to create a Session using.- Returns:
- A new Session.
-