Package org.apache.wicket.mock
Class MockPageStore
- java.lang.Object
-
- org.apache.wicket.mock.MockPageStore
-
- All Implemented Interfaces:
IPageStore
public class MockPageStore extends java.lang.Object implements IPageStore
-
-
Constructor Summary
Constructors Constructor Description MockPageStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPage(IPageContext context, IManageablePage page)Stores the page-booleancanBeAsynchronous(IPageContext context)This method is called byAsynchronousPageStorebefore any attempt to callIPageStore.addPage(IPageContext, IManageablePage)asynchronously.voiddestroy()Destroy the store.IManageablePagegetPage(IPageContext context, int id)Restores a page from storage.java.util.List<IManageablePage>getPages()voidremoveAllPages(IPageContext context)All pages should be removed from storage for the given context.voidremovePage(IPageContext context, IManageablePage page)Removes a page from storage.booleansupportsVersioning()Is versioning of pages supported, i.e.-
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
-
-
-
-
Method Detail
-
supportsVersioning
public boolean supportsVersioning()
Description copied from interface:IPageStoreIs versioning of pages supported, i.e. when an altered page instance has been stored in this store, can the previous state of that page still be retrieved under its former page id. Most implementations achieve this by keeping a copy of the page instance, e.g. by means of serialization.- Specified by:
supportsVersioningin interfaceIPageStore
-
destroy
public void destroy()
Description copied from interface:IPageStoreDestroy the store.- Specified by:
destroyin interfaceIPageStore
-
getPages
public java.util.List<IManageablePage> getPages()
-
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
-
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
-
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
-
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
-
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
-
-