public class MemoryCache extends Object implements IOssIndexCache
| Constructor and Description |
|---|
MemoryCache()
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)
It is anticipated that this implementation will never be up long
enough for the delay to matter.
|
public 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 void commit()
IOssIndexCachecommit in interface IOssIndexCachepublic void close()
IOssIndexCacheclose in interface IOssIndexCachepublic String get(String requestString, long delay)
get in interface IOssIndexCacherequestString - Request that is being cacheddelay - Elapsed time before we ignore the cached valueIOssIndexCache.get(java.lang.String, long)Copyright © 2015. All rights reserved.