Class LibrarySession
- java.lang.Object
-
- org.apache.wicket.Session
-
- org.apache.wicket.protocol.http.WebSession
-
- org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession
-
- org.apache.wicket.authroles.authentication.AuthenticatedWebSession
-
- org.apache.wicket.examples.library.LibrarySession
-
- All Implemented Interfaces:
Serializable,IEventSink,IFeedbackContributor,IMetadataContext<Serializable,Session>,IClusterable
public final class LibrarySession extends AuthenticatedWebSession
Session class for library example. Holds User object and authenticates users.- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.Session
clientInfo, SESSION_ATTRIBUTE_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLibrarySession(Request request)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(String username, String password)Checks the given username and password, returning a User object if if the username and password identify a valid user.RolesgetRoles()UsergetUser()voidsetUser(User user)voidsignOut()-
Methods inherited from class org.apache.wicket.authroles.authentication.AuthenticatedWebSession
get, invalidate, isSignedIn, signIn, signIn
-
Methods inherited from class org.apache.wicket.protocol.http.WebSession
generateNewSessionId, getClientInfo, newBrowserInfoPage
-
Methods inherited from class org.apache.wicket.Session
bind, changeSessionId, clear, debug, detach, dirty, dirty, endRequest, error, exists, fatal, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getClassResolver, getFeedbackMessages, getId, getLocale, getMetaData, getPageFactory, getPageManager, getSessionStore, getSizeInBytes, getStyle, info, internalDetach, invalidateNow, isRtlLanguage, isRtlLocale, isSessionInvalidated, isTemporary, newPageAccessSynchronizer, nextPageId, nextSequenceValue, onEvent, onInvalidate, removeAttribute, replaceSession, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, success, warn
-
-
-
-
Constructor Detail
-
LibrarySession
protected LibrarySession(Request request)
Constructor- Parameters:
request- The current request object
-
-
Method Detail
-
authenticate
public final boolean authenticate(String username, String password)
Checks the given username and password, returning a User object if if the username and password identify a valid user.- Specified by:
authenticatein classAuthenticatedWebSession- Parameters:
username- The usernamepassword- The password- Returns:
- The signed in user
-
getUser
public User getUser()
- Returns:
- User
-
setUser
public void setUser(User user)
- Parameters:
user- New user
-
signOut
public void signOut()
- Overrides:
signOutin classAuthenticatedWebSession- See Also:
AuthenticatedWebSession.signOut()
-
getRoles
public Roles getRoles()
- Specified by:
getRolesin classAbstractAuthenticatedWebSession- See Also:
AbstractAuthenticatedWebSession.getRoles()
-
-