org.apache.wicket.protocol.http
Interface SecondLevelCacheSessionStore.IPageStore

All Known Subinterfaces:
SecondLevelCacheSessionStore.IClusteredPageStore, SecondLevelCacheSessionStore.ISerializationAwarePageStore
All Known Implementing Classes:
AbstractPageStore, DiskPageStore, SimpleSynchronousFilePageStore, TestFilePageStore
Enclosing class:
SecondLevelCacheSessionStore

public static interface SecondLevelCacheSessionStore.IPageStore

This interface is used by the SecondLevelCacheSessionStore so that pages can be stored to a persistent layer. Implementation should store the page that it gets under the id and version number. So that every page version can be reconstructed when asked for.

See Also:
as default implementation.

Method Summary
 boolean containsPage(String sessionId, String pageMapName, int pageId, int pageVersion)
          Returns whether the PageStore contains given page.
 void destroy()
          Destroy the store.
<T> Page
getPage(String sessionId, String pagemap, int id, int versionNumber, int ajaxVersionNumber)
          Restores a page version from the persistent layer.
 void pageAccessed(String sessionId, Page page)
          This method is called when the page is accessed.
 void removePage(String sessionId, String pagemap, int id)
          Removes a page from the persistent layer.
 void storePage(String sessionId, Page page)
          Stores the page to a persistent layer.
 void unbind(String sessionId)
          The pagestore should cleanup all the pages for that sessionid.
 

Method Detail

destroy

void destroy()
Destroy the store.


getPage

<T> Page getPage(String sessionId,
                 String pagemap,
                 int id,
                 int versionNumber,
                 int ajaxVersionNumber)
Restores a page version from the persistent layer.

Note that the versionNumber and ajaxVersionNumber parameters may be -1.

Type Parameters:
T - type of page
Parameters:
sessionId -
pagemap -
id -
versionNumber -
ajaxVersionNumber -
Returns:
The page

pageAccessed

void pageAccessed(String sessionId,
                  Page page)
This method is called when the page is accessed. A IPageStore implementation can block until a save of that page version is done. So that a specific page version is always restore able.

Parameters:
sessionId -
page -

removePage

void removePage(String sessionId,
                String pagemap,
                int id)
Removes a page from the persistent layer.

Parameters:
sessionId - The session of the page that must be removed
pagemap - The pagemap of the page that must be removed
id - The id of the page.

storePage

void storePage(String sessionId,
               Page page)
Stores the page to a persistent layer. The page should be stored under the id and the version number.

Parameters:
sessionId -
page -

unbind

void unbind(String sessionId)
The pagestore should cleanup all the pages for that sessionid.

Parameters:
sessionId -

containsPage

boolean containsPage(String sessionId,
                     String pageMapName,
                     int pageId,
                     int pageVersion)
Returns whether the PageStore contains given page.

Parameters:
sessionId -
pageMapName -
pageId -
pageVersion -
Returns:
boolean If the page was found


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