public class SimpleRedisRobotsCache extends Object implements LiveWebCache
Modifier and Type | Field and Description |
---|---|
protected boolean |
gzipRobots |
protected LiveWebCache |
liveweb |
protected RedisRobotsLogic |
redisCmds |
Constructor and Description |
---|
SimpleRedisRobotsCache() |
Modifier and Type | Method and Description |
---|---|
org.archive.wayback.accesscontrol.robotstxt.redis.SimpleRedisRobotsCache.RobotsResult |
forceUpdate(String url,
int minUpdateTime,
boolean cacheFails) |
Resource |
getCachedResource(URL urlURL,
long maxCacheMS,
boolean bUseOlder)
Fetch a Resource from the live web, or from a cache of the live web.
|
LiveWebCache |
getLiveweb() |
boolean |
isExpired(org.archive.wayback.accesscontrol.robotstxt.redis.RedisRobotsLogic.RedisValue value,
String url,
int customRefreshTime) |
boolean |
isGzipRobots() |
protected boolean |
isValidRobots(String value) |
protected org.archive.wayback.accesscontrol.robotstxt.redis.SimpleRedisRobotsCache.RobotsResult |
loadExternal(URL urlURL,
long maxCacheMS,
boolean bUseOlder) |
void |
setGzipRobots(boolean gzipRobots) |
void |
setLiveweb(LiveWebCache liveweb) |
void |
setRedisConnMan(RedisConnectionManager redisConn) |
void |
shutdown()
closes all resources
|
protected void |
updateCache(String contents,
String url,
String current,
int status,
boolean cacheFails) |
protected RedisRobotsLogic redisCmds
protected LiveWebCache liveweb
protected boolean gzipRobots
public Resource getCachedResource(URL urlURL, long maxCacheMS, boolean bUseOlder) throws LiveDocumentNotAvailableException, LiveWebCacheUnavailableException, LiveWebTimeoutException, IOException
LiveWebCache
getCachedResource
in interface LiveWebCache
urlURL
- to fetch from the live web.maxCacheMS
- maximum age of resource to return - optionally honoredbUseOlder
- if true, return documents older than maxCacheMS if
a more recent copy is not available.LiveDocumentNotAvailableException
- if the resource cannot be
retrieved from the live web, but all proxying and caching
mechanisms functioned properlyLiveWebCacheUnavailableException
- if there was a problem either
accessing the live web, in proxying to the live web, or in
maintaining the cache for the live webLiveWebTimeoutException
- if there is no response from the live
web cache before a timeout occurred.IOException
- for the usual reasonspublic void shutdown()
LiveWebCache
shutdown
in interface LiveWebCache
public boolean isExpired(org.archive.wayback.accesscontrol.robotstxt.redis.RedisRobotsLogic.RedisValue value, String url, int customRefreshTime)
protected org.archive.wayback.accesscontrol.robotstxt.redis.SimpleRedisRobotsCache.RobotsResult loadExternal(URL urlURL, long maxCacheMS, boolean bUseOlder)
protected void updateCache(String contents, String url, String current, int status, boolean cacheFails)
protected boolean isValidRobots(String value)
public org.archive.wayback.accesscontrol.robotstxt.redis.SimpleRedisRobotsCache.RobotsResult forceUpdate(String url, int minUpdateTime, boolean cacheFails)
public void setRedisConnMan(RedisConnectionManager redisConn)
public LiveWebCache getLiveweb()
public void setLiveweb(LiveWebCache liveweb)
public boolean isGzipRobots()
public void setGzipRobots(boolean gzipRobots)
Copyright © 2005–2015 IIPC. All rights reserved.