Package org.pac4j.core.store
Class GuavaStore<K,O>
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.store.AbstractStore<K,O>
-
- org.pac4j.core.store.GuavaStore<K,O>
-
- All Implemented Interfaces:
Store<K,O>
public class GuavaStore<K,O> extends AbstractStore<K,O>
Store data in a Guava cache. Add theguava
dependency to use this store.- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Constructor Description GuavaStore()
GuavaStore(int size, int timeout, TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.cache.Cache<K,O>
getCache()
int
getSize()
int
getTimeout()
TimeUnit
getTimeUnit()
protected Optional<O>
internalGet(K key)
protected void
internalInit()
Internal initialization of the object.protected void
internalRemove(K key)
protected void
internalSet(K key, O value)
void
setSize(int size)
void
setTimeout(int timeout)
void
setTimeUnit(TimeUnit timeUnit)
String
toString()
-
Methods inherited from class org.pac4j.core.store.AbstractStore
get, remove, set
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Constructor Detail
-
GuavaStore
public GuavaStore()
-
GuavaStore
public GuavaStore(int size, int timeout, TimeUnit timeUnit)
-
-
Method Detail
-
internalInit
protected void internalInit()
Description copied from class:InitializableObject
Internal initialization of the object.- Overrides:
internalInit
in classAbstractStore<K,O>
-
internalGet
protected Optional<O> internalGet(K key)
- Specified by:
internalGet
in classAbstractStore<K,O>
-
internalSet
protected void internalSet(K key, O value)
- Specified by:
internalSet
in classAbstractStore<K,O>
-
internalRemove
protected void internalRemove(K key)
- Specified by:
internalRemove
in classAbstractStore<K,O>
-
getSize
public int getSize()
-
setSize
public void setSize(int size)
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout)
-
getTimeUnit
public TimeUnit getTimeUnit()
-
setTimeUnit
public void setTimeUnit(TimeUnit timeUnit)
-
-