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, java.util.concurrent.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()
java.util.concurrent.TimeUnit
getTimeUnit()
protected java.util.Optional<O>
internalGet(K key)
protected void
internalInit(boolean forceReinit)
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(java.util.concurrent.TimeUnit timeUnit)
java.lang.String
toString()
-
Methods inherited from class org.pac4j.core.store.AbstractStore
get, remove, set
-
Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
-
-
-
-
Method Detail
-
internalInit
protected void internalInit(boolean forceReinit)
Description copied from class:InitializableObject
Internal initialization of the object.- Overrides:
internalInit
in classAbstractStore<K,O>
-
internalGet
protected java.util.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 java.util.concurrent.TimeUnit getTimeUnit()
-
setTimeUnit
public void setTimeUnit(java.util.concurrent.TimeUnit timeUnit)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-