Package com.googlecode.objectify.cache
Interface MemcacheService
-
- All Known Implementing Classes:
SpyMemcacheService
public interface MemcacheService
The interface that all memory cache services must implement. In theory you could write a redis (or whatnot) based implementation, but this was designed around memcached. The implementation must handle 'null' as a value. Note that memcached doesn't handle this natively; the impl takes care of translating it to something that can be stored.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MemcacheService.CasPut
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteAll(Collection<String> keys)
Object
get(String key)
Map<String,Object>
getAll(Collection<String> keys)
Map<String,IdentifiableValue>
getIdentifiables(Collection<String> keys)
For cache implementations that don't handle a cold cache for a key (eg memcached), the implementation of this method needs to hide that behavior (ie, bootstrap an initial value so we can get a CAS value).void
put(String key, Object thing)
Values can be nullvoid
putAll(Map<String,Object> values)
Values can be nullSet<String>
putIfUntouched(Map<String,MemcacheService.CasPut> values)
Values can be null
-
-
-
Method Detail
-
get
Object get(String key)
- Returns:
- the value in memcache for this, or null if there was nothing there
-
getIdentifiables
Map<String,IdentifiableValue> getIdentifiables(Collection<String> keys)
For cache implementations that don't handle a cold cache for a key (eg memcached), the implementation of this method needs to hide that behavior (ie, bootstrap an initial value so we can get a CAS value). That doesn't mean the result will always be a value; the bootstrap may fail (for whatever reason) and the resulting map value for a key will be null.
-
getAll
Map<String,Object> getAll(Collection<String> keys)
-
putIfUntouched
Set<String> putIfUntouched(Map<String,MemcacheService.CasPut> values)
Values can be null- Returns:
- a set of all the keys that succeeded
-
deleteAll
void deleteAll(Collection<String> keys)
-
-