org.apache.wicket.session
Interface ISessionStore

All Known Implementing Classes:
AbstractHttpSessionStore, HttpSessionStore, SecondLevelCacheSessionStore

public interface ISessionStore

The actual store that is used by Session to store its attributes.

Author:
Eelco Hillenius, Johan Compagner

Method Summary
 void bind(Request request, Session newSession)
          Adds the provided new session to this facade using the provided request.
 IPageMap createPageMap(java.lang.String name)
           
 void destroy()
          Called when the WebApplication is destroyed.
 java.lang.Object getAttribute(Request request, java.lang.String name)
          Gets the attribute value with the given name
 java.util.List getAttributeNames(Request request)
           
 java.lang.String getSessionId(Request request, boolean create)
          Get the session id for the provided request.
 void invalidate(Request request)
          Invalidates the session.
 Session lookup(Request request)
          Retrieves the session for the provided request from this facade.
 IPageVersionManager newVersionManager(Page page)
           
 void onBeginRequest(Request request)
          Called at the start of a request.
 void onEndRequest(Request request)
          Called at the end of a request.
 void removeAttribute(Request request, java.lang.String name)
          Removes the attribute with the given name.
 void setAttribute(Request request, java.lang.String name, java.lang.Object value)
          Adds or replaces the attribute with the given name and value.
 void unbind(java.lang.String sessionId)
          Removes a session from this facade
 

Method Detail

getAttribute

java.lang.Object getAttribute(Request request,
                              java.lang.String name)
Gets the attribute value with the given name

Parameters:
request - the current request
name - The name of the attribute to store
Returns:
The value of the attribute

getAttributeNames

java.util.List getAttributeNames(Request request)
Parameters:
request - the current request
Returns:
List of attributes for this session

invalidate

void invalidate(Request request)
Invalidates the session.

Parameters:
request - the current request

removeAttribute

void removeAttribute(Request request,
                     java.lang.String name)
Removes the attribute with the given name.

Parameters:
request - the current request
name - the name of the attribute to remove

setAttribute

void setAttribute(Request request,
                  java.lang.String name,
                  java.lang.Object value)
Adds or replaces the attribute with the given name and value.

Parameters:
request - the current request
name - the name of the attribute
value - the value of the attribute

getSessionId

java.lang.String getSessionId(Request request,
                              boolean create)
Get the session id for the provided request. If create is false and the creation of the actual session is deferred, this method should return null to reflect it doesn't have one.

Parameters:
request - The request
create - Whether to create an actual session (typically an instance of HttpSession) when not already done so
Returns:
The session id for the provided request, possibly null if create is false and the creation of the actual session was deferred

lookup

Session lookup(Request request)
Retrieves the session for the provided request from this facade.

This method should return null if it is not bound yet, so that Wicket can recognize that it should create a session and call bind(Request, Session) right after that.

Parameters:
request - The current request
Returns:
The session for the provided request or null if the session was not bound

bind

void bind(Request request,
          Session newSession)
Adds the provided new session to this facade using the provided request.

Parameters:
request - The request that triggered making a new session
newSession - The new session

unbind

void unbind(java.lang.String sessionId)
Removes a session from this facade

Parameters:
sessionId - The id of the session that must be unbound.

onBeginRequest

void onBeginRequest(Request request)
Called at the start of a request. It can be used for example to rebuild server state from the client request.

Parameters:
request - The request object

onEndRequest

void onEndRequest(Request request)
Called at the end of a request. It can be used for instance to release temporary server state when using client state saving.

Parameters:
request - The request

createPageMap

IPageMap createPageMap(java.lang.String name)
Parameters:
name -
Returns:
The pagemap instance

newVersionManager

IPageVersionManager newVersionManager(Page page)
Parameters:
page - The page for which this version manager must be created
Returns:
A instance of a IPageVersionManager that the page will use.

destroy

void destroy()
Called when the WebApplication is destroyed.



Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.