public class RedisRequestCache extends Object implements RequestCache
Constructor and Description |
---|
RedisRequestCache(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate) |
Modifier and Type | Method and Description |
---|---|
boolean |
exist(Task task,
Request request)
先查找请求任务是否在集合中存在
|
long |
getCount(Task task)
获取指定缓存集合的请求任务数量
|
org.springframework.data.redis.core.RedisTemplate<String,Object> |
getRedisTemplate() |
boolean |
lookAndCache(Task task,
Request request)
先查找请求任务是否在集合中存在,然后将该请求任务存储到此集合中
|
void |
remove(Task task)
移除指定的缓存集合
|
void |
save(Task task,
Request request)
将请求任务存储到指定的集合名中
|
RedisRequestCache |
setRedisTemplate(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate) |
public boolean lookAndCache(Task task, Request request)
RequestCache
lookAndCache
in interface RequestCache
task
- 风铃虫任务request
- 请求任务public boolean exist(Task task, Request request)
RequestCache
exist
in interface RequestCache
task
- 风铃虫任务request
- 请求任务public void remove(Task task)
RequestCache
remove
in interface RequestCache
task
- 风铃虫任务public long getCount(Task task)
RequestCache
getCount
in interface RequestCache
task
- 风铃虫任务public void save(Task task, Request request)
RequestCache
save
in interface RequestCache
task
- 风铃虫任务request
- 请求任务public org.springframework.data.redis.core.RedisTemplate<String,Object> getRedisTemplate()
public RedisRequestCache setRedisTemplate(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate)
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.