org.apache.http.impl.client.cache.memcached
Class MemcachedCacheEntryFactoryImpl

java.lang.Object
  extended by org.apache.http.impl.client.cache.memcached.MemcachedCacheEntryFactoryImpl
All Implemented Interfaces:
MemcachedCacheEntryFactory

public class MemcachedCacheEntryFactoryImpl
extends Object
implements MemcachedCacheEntryFactory

Default implementation of MemcachedCacheEntryFactory.


Constructor Summary
MemcachedCacheEntryFactoryImpl()
           
 
Method Summary
 MemcachedCacheEntry getMemcachedCacheEntry(String key, HttpCacheEntry entry)
          Creates a new MemcachedCacheEntry for storing the given HttpCacheEntry under the given storage key.
 MemcachedCacheEntry getUnsetCacheEntry()
          Creates an "unset" MemcachedCacheEntry ready to accept a serialized representation via MemcachedCacheEntry.set(byte[]) and deserialize it into a storage key and a HttpCacheEntry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemcachedCacheEntryFactoryImpl

public MemcachedCacheEntryFactoryImpl()
Method Detail

getMemcachedCacheEntry

public MemcachedCacheEntry getMemcachedCacheEntry(String key,
                                                  HttpCacheEntry entry)
Description copied from interface: MemcachedCacheEntryFactory
Creates a new MemcachedCacheEntry for storing the given HttpCacheEntry under the given storage key. Since we are hashing storage keys into cache keys to accommodate limitations in memcached's key space, it is possible to have cache collisions. Therefore, we store the storage key along with the HttpCacheEntry so it can be compared on retrieval and thus detect collisions.

Specified by:
getMemcachedCacheEntry in interface MemcachedCacheEntryFactory
Parameters:
key - storage key under which the entry will be logically stored
entry - the cache entry to store
Returns:
a MemcachedCacheEntry ready to provide a serialized representation

getUnsetCacheEntry

public MemcachedCacheEntry getUnsetCacheEntry()
Description copied from interface: MemcachedCacheEntryFactory
Creates an "unset" MemcachedCacheEntry ready to accept a serialized representation via MemcachedCacheEntry.set(byte[]) and deserialize it into a storage key and a HttpCacheEntry.

Specified by:
getUnsetCacheEntry in interface MemcachedCacheEntryFactory
Returns:
MemcachedCacheEntry


Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.