public class PersistentTokenCache<T> extends Object
LinkedHashMap
to keep the tokens in order of expiration. During access any entries which
have expired are automatically purged.| Constructor and Description |
|---|
PersistentTokenCache(long expireMillis)
Construct a new TokenCache.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get(String key)
Get a token from the cache.
|
void |
purge()
Remove expired entries from the map.
|
void |
put(String key,
T token)
Put a token in the cache.
|
int |
size()
Get the number of tokens in the cache.
|
public PersistentTokenCache(long expireMillis)
expireMillis - Delay until tokens expire, in millis.IllegalArgumentException - if expireMillis is non-positive.public T get(String key)
key - The key to look for.public void put(String key, T token)
key - The key to insert for.token - The token to insert.public int size()
purge() is invoked first.public void purge()
Copyright © 2019 JHipster. All rights reserved.