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 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.- See Also:
getSessionIdentifier(IPageContext, boolean)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractPersistentPageStore.PersistedPage
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPersistentPageStore(String applicationName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addPage(IPageContext context, IManageablePage page)
Stores the page-protected abstract void
addPersistedPage(String sessionIdentifier, IManageablePage page)
Add a page.boolean
canBeAsynchronous(IPageContext context)
This method is called byAsynchronousPageStore
before any attempt to callIPageStore.addPage(IPageContext, IManageablePage)
asynchronously.protected String
createSessionIdentifier(IPageContext context)
Create an identifier for the given context.void
destroy()
Destroy the store.IManageablePage
getPage(IPageContext context, int id)
Restores a page from storage.protected abstract IManageablePage
getPersistedPage(String sessionIdentifier, int id)
String
getSessionIdentifier(IPageContext context)
void
removeAllPages(IPageContext context)
All pages should be removed from storage for the given context.protected abstract void
removeAllPersistedPages(String sessionIdentifier)
void
removePage(IPageContext context, IManageablePage page)
Removes a page from storage.protected abstract void
removePersistedPage(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, end, revertPage, supportsVersioning
-
-
-
-
Constructor Detail
-
AbstractPersistentPageStore
protected AbstractPersistentPageStore(String applicationName)
-
-
Method Detail
-
destroy
public void destroy()
Description copied from interface:IPageStore
Destroy the store.- Specified by:
destroy
in interfaceIPageStore
-
canBeAsynchronous
public boolean canBeAsynchronous(IPageContext context)
Description copied from interface:IPageStore
This method is called byAsynchronousPageStore
before any attempt to callIPageStore.addPage(IPageContext, IManageablePage)
asynchronously.A page store returning
true
must 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:
canBeAsynchronous
in 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:IPageStore
Restores a page from storage.- Specified by:
getPage
in interfaceIPageStore
- Parameters:
context
- the context of the pageid
- the id of the page.- Returns:
- the page
-
getPersistedPage
protected abstract IManageablePage getPersistedPage(String sessionIdentifier, int id)
-
removePage
public void removePage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStore
Removes a page from storage.- Specified by:
removePage
in interfaceIPageStore
- Parameters:
context
- the context of the pagepage
- the page.
-
removePersistedPage
protected abstract void removePersistedPage(String sessionIdentifier, IManageablePage page)
-
removeAllPages
public void removeAllPages(IPageContext context)
Description copied from interface:IPageStore
All pages should be removed from storage for the given context.- Specified by:
removeAllPages
in interfaceIPageStore
- Parameters:
context
- the context of the pages
-
removeAllPersistedPages
protected abstract void removeAllPersistedPages(String sessionIdentifier)
-
addPage
public void addPage(IPageContext context, IManageablePage page)
Description copied from interface:IPageStore
Stores the page-- Specified by:
addPage
in interfaceIPageStore
- Parameters:
context
- the context of the pagepage
- the page.
-
addPersistedPage
protected abstract void addPersistedPage(String sessionIdentifier, IManageablePage page)
Add a page.- Parameters:
sessionIdentifier
- identifier of sessionpage
- page to add
-
createSessionIdentifier
protected String createSessionIdentifier(IPageContext context)
Create an identifier for the given context.Default implementation uses
IPageContext.getSessionId(boolean)
}.- Parameters:
context
- context- Returns:
- identifier for the session
-
getSessionIdentifier
public String getSessionIdentifier(IPageContext context)
-
-