Package me.zhyd.oauth.cache
Class AuthDefaultCache
java.lang.Object
me.zhyd.oauth.cache.AuthDefaultCache
- All Implemented Interfaces:
AuthCache
默认的缓存实现
- Since:
- 1.9.3
- Author:
- yadong.zhang (yadong.zhang0415(a)gmail.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) 是否存在key,如果对应key的value值已过期,也返回false获取缓存void清理过期的缓存voidschedulePrune(long delay) 定时清理void设置缓存void设置缓存
-
Constructor Details
-
AuthDefaultCache
public AuthDefaultCache()
-
-
Method Details
-
set
设置缓存 -
set
设置缓存 -
get
获取缓存 -
containsKey
是否存在key,如果对应key的value值已过期,也返回false- Specified by:
containsKeyin interfaceAuthCache- Parameters:
key- 缓存KEY- Returns:
- true:存在key,并且value没过期;false:key不存在或者已过期
-
pruneCache
public void pruneCache()清理过期的缓存- Specified by:
pruneCachein interfaceAuthCache
-
schedulePrune
public void schedulePrune(long delay) 定时清理- Parameters:
delay- 间隔时长,单位毫秒
-