Package org.apache.wiki.spi
Class SessionSPIDefaultImpl
java.lang.Object
org.apache.wiki.spi.SessionSPIDefaultImpl
- All Implemented Interfaces:
SessionSPI
public class SessionSPIDefaultImpl extends java.lang.Object implements SessionSPI
Default implementation for
SessionSPI
- See Also:
SessionSPI
-
Constructor Summary
Constructors Constructor Description SessionSPIDefaultImpl()
-
Method Summary
Modifier and Type Method Description Session
find(Engine engine, javax.servlet.http.HttpServletRequest request)
Returns the Session object associated with the current HTTP request.Session
guest(Engine engine)
Creates a new "guest" session containing a single user Principalorg.apache.wiki.auth.WikiPrincipal#GUEST
, plus the role principalsRole#ALL
andRole#ANONYMOUS
.void
remove(Engine engine, javax.servlet.http.HttpServletRequest request)
Removes the wiki session associated with the user's HTTP request from the cache of wiki sessions, typically as part of a logout process.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SessionSPIDefaultImpl
public SessionSPIDefaultImpl()
-
-
Method Details
-
remove
Removes the wiki session associated with the user's HTTP request from the cache of wiki sessions, typically as part of a logout process.- Specified by:
remove
in interfaceSessionSPI
- Parameters:
engine
- the wiki enginerequest
- the users's HTTP request
-
find
Returns the Session object associated with the current HTTP request. If not found, one is created. This method is guaranteed to always return a Session, although the authentication status is unpredictable until the user attempts to log in. If the servlet request parameter is
null
, a syntheticSessionSPI.guest(Engine)
is returned.When a session is created, this method attaches a WikiEventListener to the GroupManager, UserManager and AuthenticationManager, so that changes to users, groups, logins, etc. are detected automatically.
- Specified by:
find
in interfaceSessionSPI
- Parameters:
engine
- the enginerequest
- the servlet request object- Returns:
- the existing (or newly created) session
-
guest
Creates a new "guest" session containing a single user Principalorg.apache.wiki.auth.WikiPrincipal#GUEST
, plus the role principalsRole#ALL
andRole#ANONYMOUS
. This method also adds the session as a listener for GroupManager, AuthenticationManager and UserManager events.- Specified by:
guest
in interfaceSessionSPI
- Parameters:
engine
- the wiki engine- Returns:
- the guest wiki session
-