Package org.wicketstuff.datastores.redis
Class RedisDataStore
- java.lang.Object
-
- org.apache.wicket.pageStore.AbstractPersistentPageStore
-
- org.wicketstuff.datastores.redis.RedisDataStore
-
- All Implemented Interfaces:
IPageStore
,IPersistentPageStore
public class RedisDataStore extends AbstractPersistentPageStore implements IPersistentPageStore
An IPageStore that saves serialized pages in Redis.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
AbstractPersistentPageStore.PersistedPage
-
-
Constructor Summary
Constructors Constructor Description RedisDataStore(String applicationname, IRedisSettings settings)
Constructor.RedisDataStore(String applicationname, redis.clients.jedis.JedisPool pool, IRedisSettings settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPersistedPage(String sessionIdentifier, IManageablePage page)
void
destroy()
protected IManageablePage
getPersistedPage(String sessionIdentifier, int id)
List<IPersistedPage>
getPersistedPages(String sessionIdentifier)
Set<String>
getSessionIdentifiers()
Bytes
getTotalSize()
protected void
removeAllPersistedPages(String sessionIdentifier)
protected void
removePersistedPage(String sessionIdentifier, IManageablePage page)
boolean
supportsVersioning()
-
Methods inherited from class org.apache.wicket.pageStore.AbstractPersistentPageStore
addPage, canBeAsynchronous, createSessionIdentifier, 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, detach, getPage, removeAllPages, removePage, revertPage
-
Methods inherited from interface org.apache.wicket.pageStore.IPersistentPageStore
getSessionIdentifier
-
-
-
-
Constructor Detail
-
RedisDataStore
public RedisDataStore(String applicationname, IRedisSettings settings)
Constructor. Creates a connection pool by using the hostname and port from the provided settings- Parameters:
settings
- The various settings
-
RedisDataStore
public RedisDataStore(String applicationname, redis.clients.jedis.JedisPool pool, IRedisSettings settings)
Constructor.- Parameters:
pool
- The pool with Jedis connectionssettings
- The various settings
-
-
Method Detail
-
supportsVersioning
public boolean supportsVersioning()
- 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)
- Specified by:
addPersistedPage
in classAbstractPersistentPageStore
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceIPageStore
- Overrides:
destroy
in classAbstractPersistentPageStore
-
getSessionIdentifiers
public Set<String> getSessionIdentifiers()
- Specified by:
getSessionIdentifiers
in interfaceIPersistentPageStore
-
getPersistedPages
public List<IPersistedPage> getPersistedPages(String sessionIdentifier)
- Specified by:
getPersistedPages
in interfaceIPersistentPageStore
-
getTotalSize
public Bytes getTotalSize()
- Specified by:
getTotalSize
in interfaceIPersistentPageStore
-
-