U
- S
- public interface IBasicSession<U extends User,S extends Shell>
Modifier and Type | Method and Description |
---|---|
AuthenticationToken |
getAuthToken() |
S |
getShell()
Some sessions may want to discourage access to the shell itself
As a best practice avoid working with the shell directly, and create methods that internally call the shell from your session. |
U |
getUser() |
String |
getUserId()
Get the userId for the Session.
|
void |
setAuthToken(AuthenticationToken authToken) |
void |
setUser(U user) |
AuthenticationToken getAuthToken()
void setAuthToken(AuthenticationToken authToken)
U getUser()
void setUser(U user)
String getUserId()
BasicSession
type can use any user object or attribute to represent that as the id
for the session. This could be the same as HttpSession.getId()
or something custom like email, name etc.
getUser()
exists and this maybe derived from it, getUser()
does not guarantee any convention on which
attribute identifies the id we want for a session.#deriveUserId()
#getUser()#getId()
and if not user defined then gets the sessionId
TODO: Add unit test case for user null, user not null but id null etc.S getShell() throws AuthorizationException
AuthorizationException
Copyright © 2018. All rights reserved.