Interface MemcachedCacheEntry
- 
- All Known Implementing Classes:
 MemcachedCacheEntryImpl
public interface MemcachedCacheEntryProvides for serialization and deserialization of higher-levelHttpCacheEntryobjects into byte arrays suitable for storage in memcached. Clients wishing to change the serialization mechanism from the provided defaults should implement this interface as well asMemcachedCacheEntryFactory. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpCacheEntrygetHttpCacheEntry()Returns theHttpCacheEntryassociated with this entry.java.lang.StringgetStorageKey()Returns the storage key associated with this entry.voidset(byte[] bytes)Given a serialized representation of aMemcachedCacheEntry, attempt to reconstitute the storage key andHttpCacheEntryrepresented therein.byte[]toByteArray()Returns a serialized representation of the current cache entry. 
 - 
 
- 
- 
Method Detail
- 
toByteArray
byte[] toByteArray()
Returns a serialized representation of the current cache entry. 
- 
getStorageKey
java.lang.String getStorageKey()
Returns the storage key associated with this entry. May returnnullif this is an "unset" instance waiting to beset(byte[])with a serialized representation. 
- 
getHttpCacheEntry
HttpCacheEntry getHttpCacheEntry()
Returns theHttpCacheEntryassociated with this entry. May returnnullif this is an "unset" instance waiting to beset(byte[])with a serialized representation. 
- 
set
void set(byte[] bytes)
Given a serialized representation of aMemcachedCacheEntry, attempt to reconstitute the storage key andHttpCacheEntryrepresented therein. After a successful call to this method, this object should return updated (as appropriate) values forgetStorageKey()andgetHttpCacheEntry(). This should be viewed as an atomic operation on theMemcachedCacheEntry.- Parameters:
 bytes- serialized representation- Throws:
 MemcachedSerializationException- if deserialization fails. In this case, the prior values for {getStorageKey()andgetHttpCacheEntry()should remain unchanged.
 
 - 
 
 -