Package org.apache.wicket.pageStore
Class AbstractPersistentPageStore
- java.lang.Object
-
- org.apache.wicket.pageStore.AbstractPersistentPageStore
-
- All Implemented Interfaces:
IPageStore
- Direct Known Subclasses:
DiskPageStore,FilePageStore,InMemoryPageStore
public abstract class AbstractPersistentPageStore extends java.lang.Object implements IPageStore
Abstract base class for stores that keep an identifier in the session only, while holding the actual pages in a secondary persistent storage.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractPersistentPageStore.PersistedPage
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPersistentPageStore(java.lang.String applicationName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPage(IPageContext context, IManageablePage page)Stores the page-protected abstract voidaddPersistedPage(java.lang.String sessionIdentifier, IManageablePage page)Add a page.booleancanBeAsynchronous(IPageContext context)This method is called byAsynchronousPageStorebefore any attempt to callIPageStore.addPage(IPageContext, IManageablePage)asynchronously.protected java.lang.StringcreateSessionIdentifier(IPageContext context)Create an identifier for the given context.voiddestroy()Destroy the store.IManageablePagegetPage(IPageContext context, int id)Restores a page from storage.protected abstract IManageablePagegetPersistedPage(java.lang.String sessionIdentifier, int id)java.lang.StringgetSessionIdentifier(IPageContext context)voidremoveAllPages(IPageContext context)All pages should be removed from storage for the given context.protected abstract voidremoveAllPersistedPages(java.lang.String sessionIdentifier)voidremovePage(IPageContext context, IManageablePage page)Removes a page from storage.protected abstract voidremovePersistedPage(java.lang.String sessionIdentifier, IManageablePage page)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.pageStore.IPageStore
detach, supportsVersioning
-
-
-
-
Method Detail
-
destroy
public void destroy()
Description copied from interface:IPageStoreDestroy the store.- Specified by:
destroyin interfaceIPageStore
-
canBeAsynchronous
public boolean canBeAsynchronous(IPageContext context)
Description copied from interface:IPageStoreThis method is called byAsynchronousPageStorebefore any attempt to callIPageStore.addPage(IPageContext, IManageablePage)asynchronously.A page store returning
truemust immediately access all required values from the context, since no additional values can be accessed whenIPageStore.addPage(IPageContext, IManageablePage)is called asynchronously afterwards.- Specified by:
canBeAsynchronousin interfaceIPageStore- Returns:
- whether
IPageStore.addPage(IPageContext, IManageablePage)may be called asynchronously, default isfalse
-
getPage
public IManageablePage getPage(IPageContext context, int id)
Description copied from interface:IPageStoreRestores a page from storage.- Specified by:
getPagein interfaceIPageStore- Parameters:
context- the context of the pageid- the id of the page.- Returns:
- the page
-
getPersistedPage
protected abstract IManageablePage getPersistedPage(java.lang.String sessionIdentifier, int id)
-
removePage
public void removePage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStoreRemoves a page from storage.- Specified by:
removePagein interfaceIPageStore- Parameters:
context- the context of the page
-
removePersistedPage
protected abstract void removePersistedPage(java.lang.String sessionIdentifier, IManageablePage page)
-
removeAllPages
public void removeAllPages(IPageContext context)
Description copied from interface:IPageStoreAll pages should be removed from storage for the given context.- Specified by:
removeAllPagesin interfaceIPageStore- Parameters:
context- the context of the pages
-
removeAllPersistedPages
protected abstract void removeAllPersistedPages(java.lang.String sessionIdentifier)
-
addPage
public void addPage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStoreStores the page-- Specified by:
addPagein interfaceIPageStore- Parameters:
context- the context of the page
-
addPersistedPage
protected abstract void addPersistedPage(java.lang.String sessionIdentifier, IManageablePage page)Add a page.- Parameters:
sessionIdentifier- identifier of sessionpage- page to add
-
createSessionIdentifier
protected java.lang.String createSessionIdentifier(IPageContext context)
Create an identifier for the given context.Default implementation uses
IPageContext#getSessionId().- Parameters:
context- context- Returns:
- identifier for the session
-
getSessionIdentifier
public java.lang.String getSessionIdentifier(IPageContext context)
-
-