public class HttpSessionDataStore extends Object implements IDataStore
IDataStore which stores the pages in the HttpSession. Uses
IDataStoreEvictionStrategy to keep the memory footprint reasonable.
Usage:
MyApp#init()
{
setPageManagerProvider(new DefaultPageManagerProvider(this)
{
protected IDataStore newDataStore()
{
return new HttpSessionDataStore(pageManagerContext, new PageNumberEvictionStrategy(20));
}
}
}
| Constructor and Description |
|---|
HttpSessionDataStore(IPageManagerContext pageManagerContext,
IDataStoreEvictionStrategy evictionStrategy)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeAsynchronous() |
void |
destroy()
Properly close the data store and possibly open resource handles
|
byte[] |
getData(String sessionId,
int pageId)
Get data associated with the session id and page id.
|
boolean |
isReplicated() |
void |
removeData(String sessionId)
Remove all page data for the session id
|
void |
removeData(String sessionId,
int pageId)
Remove all persisted data related to the session id and page id
|
void |
storeData(String sessionId,
int pageId,
byte[] pageAsBytes)
Store the page data
|
public HttpSessionDataStore(IPageManagerContext pageManagerContext, IDataStoreEvictionStrategy evictionStrategy)
pageManagerContext - evictionStrategy - public byte[] getData(String sessionId, int pageId)
IDataStoregetData in interface IDataStoresessionId - Ignored. Only pages from the current http session can be readpageId - Page IDIDataStore.getData(java.lang.String, int)public void removeData(String sessionId, int pageId)
IDataStoreremoveData in interface IDataStoresessionId - Session IDpageId - Page IDpublic void removeData(String sessionId)
IDataStoreremoveData in interface IDataStoresessionId - Session IDpublic void storeData(String sessionId, int pageId, byte[] pageAsBytes)
IDataStorestoreData in interface IDataStoresessionId - Session IDpageId - Page IDpageAsBytes - Page datapublic void destroy()
IDataStoredestroy in interface IDataStorepublic boolean isReplicated()
isReplicated in interface IDataStorepublic final boolean canBeAsynchronous()
canBeAsynchronous in interface IDataStoreAsynchronousDataStoreCopyright © 2006–2021 Apache Software Foundation. All rights reserved.