com.day.cq.portlet.cache
Interface Cache


public interface Cache

The Cache is an optional service for caching content. A content is identified by a unique key and is associated with a CacheValue storing meta information about the cached content. The cache has no knowledge about the content type it stores, therefore it is up to the client of the cache to generate unique cache keys. The CacheKeyGenerator service is used for this. Cached content can either be removed or the cache itself can have an internal mechanism to invalidate cached content (e.g. by using an epxires information).


Method Summary
 void clearCache()
          Clear the cache.
 CacheValue getCacheEntry(String key)
          Get a cached value for the unique key.
 Collection<String> getKeys()
          Return all currently available keys.
 void putCacheEntry(String key, CacheValue cachedResponse)
          Put a cached content into the cache.
 boolean removeCacheEntry(String key)
          Remove the content with the unique key from the cache.
 

Method Detail

getCacheEntry

CacheValue getCacheEntry(String key)
Get a cached value for the unique key.

Parameters:
key - The cache key
Returns:
The CacheValue or null if there is no valid content for the key.

putCacheEntry

void putCacheEntry(String key,
                   CacheValue cachedResponse)
Put a cached content into the cache.

Parameters:
key - The cache key
cachedResponse -

removeCacheEntry

boolean removeCacheEntry(String key)
Remove the content with the unique key from the cache.

Parameters:
key - The cache key
Returns:
true if the content was removed.

getKeys

Collection<String> getKeys()
Return all currently available keys. This collection might contain keys which might already have been expired.

Returns:
A collection of keys

clearCache

void clearCache()
Clear the cache.



Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.