org.apache.wicket.examples.library
Class LibrarySession

java.lang.Object
  extended by org.apache.wicket.Session
      extended by org.apache.wicket.protocol.http.WebSession
          extended by org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession
              extended by org.apache.wicket.authroles.authentication.AuthenticatedWebSession
                  extended by org.apache.wicket.examples.library.LibrarySession
All Implemented Interfaces:
java.io.Serializable, IEventSink, 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
protected LibrarySession(Request request)
          Constructor
 
Method Summary
 boolean authenticate(java.lang.String username, java.lang.String password)
          Checks the given username and password, returning a User object if if the username and password identify a valid user.
 Roles getRoles()
           
 User getUser()
           
 void setUser(User user)
           
 void signOut()
          Sign the user out.
 
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
cleanupComponentFeedbackMessages, cleanupFeedbackMessages, getClientInfo, newBrowserInfoPage
 
Methods inherited from class org.apache.wicket.Session
bind, clear, debug, detach, dirty, error, exists, fatal, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getClassResolver, getFeedbackMessages, getId, getLocale, getMetaData, getPageFactory, getPageManager, getSessionStore, getSizeInBytes, getStyle, info, internalDetach, invalidateNow, isCurrentRequestValid, isSessionInvalidated, isTemporary, nextPageId, nextSequenceValue, onEvent, removeAttribute, replaceSession, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, success, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibrarySession

protected LibrarySession(Request request)
Constructor

Parameters:
request - The current request object
Method Detail

authenticate

public final boolean authenticate(java.lang.String username,
                                  java.lang.String password)
Checks the given username and password, returning a User object if if the username and password identify a valid user.

Overrides:
authenticate in class WebSession
Parameters:
username - The username
password - 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()
Description copied from class: AuthenticatedWebSession
Sign the user out.

Overrides:
signOut in class AuthenticatedWebSession
See Also:
org.apache.wicket.authentication.AuthenticatedWebSession#signOut()

getRoles

public Roles getRoles()
Specified by:
getRoles in class AbstractAuthenticatedWebSession
Returns:
Get the roles that this session can play
See Also:
org.apache.wicket.authentication.AuthenticatedWebSession#getRoles()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.