public class MemcachedCacheEntryImpl extends Object implements MemcachedCacheEntry
MemcachedCacheEntry
. This implementation
simply uses Java serialization to serialize the storage key followed by
the HttpCacheEntry
into a byte array.Constructor and Description |
---|
MemcachedCacheEntryImpl() |
MemcachedCacheEntryImpl(String key,
HttpCacheEntry httpCacheEntry) |
Modifier and Type | Method and Description |
---|---|
HttpCacheEntry |
getHttpCacheEntry()
Returns the
HttpCacheEntry associated with this entry. |
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.
|
public MemcachedCacheEntryImpl(String key, HttpCacheEntry httpCacheEntry)
public MemcachedCacheEntryImpl()
public byte[] toByteArray()
MemcachedCacheEntry
toByteArray
in interface MemcachedCacheEntry
public 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 representationCopyright © 2010–2022 The Apache Software Foundation. All rights reserved.