public class MapDbCache extends Object implements IOssIndexCache
| Constructor and Description |
|---|
MapDbCache(File root)
Create a cache at the specified location
|
| Modifier and Type | Method and Description |
|---|---|
void |
cache(String requestString,
String json)
Cache the specified query
|
void |
close()
Ensure that the cache persists if required
|
void |
commit()
Commit any recent changes into the cache
|
String |
get(String requestString)
Get cached results, if they are available
|
String |
get(String requestString,
long delay)
Return the cached value if the elapsed time is not passed.
|
public MapDbCache(File root)
root - Root directory for cache storagepublic void cache(String requestString, String json)
IOssIndexCachecache in interface IOssIndexCacherequestString - Request that is being cachedjson - Response to requestpublic String get(String requestString)
IOssIndexCacheget in interface IOssIndexCacherequestString - Request that was cachedpublic String get(String requestString, long delay)
IOssIndexCacheget in interface IOssIndexCacherequestString - Request that is being cacheddelay - Elapsed time before we ignore the cached valuepublic void commit()
IOssIndexCachecommit in interface IOssIndexCachepublic void close()
IOssIndexCacheclose in interface IOssIndexCacheCopyright © 2015. All rights reserved.