public class MemcachedCacheEntryImpl extends java.lang.Object implements MemcachedCacheEntry
MemcachedCacheEntry
. This implementation
simply uses Java serialization to serialize the storage key followed by
the HttpCacheEntry
into a byte array.Modifier and Type | Field and Description |
---|---|
private HttpCacheEntry |
httpCacheEntry |
private java.lang.String |
key |
Constructor and Description |
---|
MemcachedCacheEntryImpl() |
MemcachedCacheEntryImpl(java.lang.String key,
HttpCacheEntry httpCacheEntry) |
Modifier and Type | Method and Description |
---|---|
HttpCacheEntry |
getHttpCacheEntry()
Returns the
HttpCacheEntry associated with this entry. |
java.lang.String |
getStorageKey()
Returns the storage key associated with this entry.
|
void |
set(byte[] bytes)
Given a serialized representation of a
MemcachedCacheEntry ,
attempt to reconstitute the storage key and HttpCacheEntry
represented therein. |
byte[] |
toByteArray()
Returns a serialized representation of the current cache entry.
|
private java.lang.String key
private HttpCacheEntry httpCacheEntry
public MemcachedCacheEntryImpl(java.lang.String key, HttpCacheEntry httpCacheEntry)
public MemcachedCacheEntryImpl()
public byte[] toByteArray()
MemcachedCacheEntry
toByteArray
in interface MemcachedCacheEntry
public java.lang.String getStorageKey()
MemcachedCacheEntry
null
if this is an "unset" instance waiting to be
MemcachedCacheEntry.set(byte[])
with a serialized representation.getStorageKey
in interface MemcachedCacheEntry
public HttpCacheEntry getHttpCacheEntry()
MemcachedCacheEntry
HttpCacheEntry
associated with this entry.
May return null
if this is an "unset" instance
waiting to be MemcachedCacheEntry.set(byte[])
with a serialized
representation.getHttpCacheEntry
in interface MemcachedCacheEntry
public void set(byte[] bytes)
MemcachedCacheEntry
MemcachedCacheEntry
,
attempt to reconstitute the storage key and HttpCacheEntry
represented therein. After a successful call to this method, this
object should return updated (as appropriate) values for
MemcachedCacheEntry.getStorageKey()
and MemcachedCacheEntry.getHttpCacheEntry()
. This
should be viewed as an atomic operation on the
MemcachedCacheEntry
.set
in interface MemcachedCacheEntry
bytes
- serialized representation