Package org.apache.wicket.pageStore
Class InMemoryPageStore
- java.lang.Object
-
- org.apache.wicket.pageStore.AbstractPersistentPageStore
-
- org.apache.wicket.pageStore.InMemoryPageStore
-
- All Implemented Interfaces:
IPageStore
,IPersistentPageStore
public class InMemoryPageStore extends AbstractPersistentPageStore implements IPersistentPageStore
A storage of pages in memory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
InMemoryPageStore.CountLimitedData
Limit pages by count.static interface
InMemoryPageStore.IMemoryData
Pages kept in memory for a session.protected static class
InMemoryPageStore.MemoryData
List based implementation.protected static class
InMemoryPageStore.SizeLimitedData
Limit pages by size.-
Nested classes/interfaces inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
AbstractPersistentPageStore.PersistedPage
-
-
Constructor Summary
Constructors Modifier Constructor Description InMemoryPageStore(String applicationName, int maxPages)
KeepmaxPages
for each session.protected
InMemoryPageStore(String applicationName, Supplier<InMemoryPageStore.IMemoryData> dataCreator, Map<String,InMemoryPageStore.IMemoryData> datas)
InMemoryPageStore(String applicationName, Bytes maxBytes)
Keep page up tomaxBytes
for each session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPersistedPage(String sessionIdentifier, IManageablePage page)
Add a page.protected IManageablePage
getPersistedPage(String sessionIdentifier, int id)
List<IPersistedPage>
getPersistedPages(String sessionIdentifier)
Get information about all persisted pages with the given session identifier.Set<String>
getSessionIdentifiers()
Get the identifiers for all stored sessions.protected long
getSize(IManageablePage page)
Get the size of the given page.Bytes
getTotalSize()
Get total size of all pages stored in all contexts.protected void
removeAllPersistedPages(String sessionIdentifier)
protected void
removePersistedPage(String sessionIdentifier, IManageablePage page)
boolean
supportsVersioning()
Versioning is not supported.-
Methods inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
addPage, canBeAsynchronous, createSessionIdentifier, destroy, getPage, getSessionIdentifier, removeAllPages, removePage
-
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
addPage, canBeAsynchronous, destroy, detach, end, getPage, removeAllPages, removePage, revertPage
-
Methods inherited from interface org.apache.wicket.pageStore.IPersistentPageStore
getSessionIdentifier
-
-
-
-
Constructor Detail
-
InMemoryPageStore
public InMemoryPageStore(String applicationName, int maxPages)
KeepmaxPages
for each session.- Parameters:
applicationName
-Application.getName()
maxPages
- max pages per session
-
InMemoryPageStore
public InMemoryPageStore(String applicationName, Bytes maxBytes)
Keep page up tomaxBytes
for each session.All pages added to this store must be
SerializedPage
s. You can achieve this by letting aSerializingPageStore
delegate to this store.- Parameters:
applicationName
-Application.getName()
maxBytes
- maximum bytes to keep in session
-
InMemoryPageStore
protected InMemoryPageStore(String applicationName, Supplier<InMemoryPageStore.IMemoryData> dataCreator, Map<String,InMemoryPageStore.IMemoryData> datas)
- Parameters:
applicationName
-Application.getName()
dataCreator
- creator of new datadatas
- storage for datas
-
-
Method Detail
-
supportsVersioning
public boolean supportsVersioning()
Versioning is not supported.- Specified by:
supportsVersioning
in interfaceIPageStore
-
getPersistedPage
protected IManageablePage getPersistedPage(String sessionIdentifier, int id)
- Specified by:
getPersistedPage
in classAbstractPersistentPageStore
-
removePersistedPage
protected void removePersistedPage(String sessionIdentifier, IManageablePage page)
- Specified by:
removePersistedPage
in classAbstractPersistentPageStore
-
removeAllPersistedPages
protected void removeAllPersistedPages(String sessionIdentifier)
- Specified by:
removeAllPersistedPages
in classAbstractPersistentPageStore
-
addPersistedPage
protected void addPersistedPage(String sessionIdentifier, IManageablePage page)
Description copied from class:AbstractPersistentPageStore
Add a page.- Specified by:
addPersistedPage
in classAbstractPersistentPageStore
- Parameters:
sessionIdentifier
- identifier of sessionpage
- page to add
-
getSessionIdentifiers
public Set<String> getSessionIdentifiers()
Description copied from interface:IPersistentPageStore
Get the identifiers for all stored sessions.- Specified by:
getSessionIdentifiers
in interfaceIPersistentPageStore
- Returns:
- the identifiers of all session.
-
getPersistedPages
public List<IPersistedPage> getPersistedPages(String sessionIdentifier)
Description copied from interface:IPersistentPageStore
Get information about all persisted pages with the given session identifier.- Specified by:
getPersistedPages
in interfaceIPersistentPageStore
- Parameters:
sessionIdentifier
- identifier of the session.- Returns:
- all persisted pages
-
getTotalSize
public Bytes getTotalSize()
Description copied from interface:IPersistentPageStore
Get total size of all pages stored in all contexts.Optional operation, may return
null
.- Specified by:
getTotalSize
in interfaceIPersistentPageStore
- Returns:
- total size or
null
-
getSize
protected long getSize(IManageablePage page)
Get the size of the given page.
-
-