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
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
Modifier and TypeClassDescriptionprotected static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getPage
(IPageContext context, int id) Restores a page from storage.protected abstract IManageablePage
getPersistedPage
(String sessionIdentifier, int id) 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 Details
-
AbstractPersistentPageStore
-
-
Method Details
-
destroy
Description copied from interface:IPageStore
Destroy the store.- Specified by:
destroy
in interfaceIPageStore
-
canBeAsynchronous
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
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
-
removePage
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
-
removeAllPages
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
-
addPage
Description copied from interface:IPageStore
Stores the page-- Specified by:
addPage
in interfaceIPageStore
- Parameters:
context
- the context of the pagepage
- the page.
-
addPersistedPage
Add a page.- Parameters:
sessionIdentifier
- identifier of sessionpage
- page to add
-
createSessionIdentifier
Create an identifier for the given context.Default implementation uses
IPageContext.getSessionId(boolean)
}.- Parameters:
context
- context- Returns:
- identifier for the session
-
getSessionIdentifier
-