edu.wisc.my.webproxy.beans.cache
Interface PageCache

All Known Implementing Classes:
EhPageCache

public interface PageCache

Represents a generic cache of WebProxy CacheEntry objects.

Version:
$Revision: 20993 $
Author:
Eric Dalquist edalquist@unicon.net

Method Summary
 void cachePage(String key, CacheEntry entry, boolean persistent)
          Caches a page with the specified key and persistence flag.
 CacheEntry getCachedPage(String key)
          Retrieves the cache entry for the specified key.
 CacheEntry getCachedPage(String key, boolean useExpired)
          Retrieves the cache entry for the specified key.
 CacheEntry getCachedPage(String key, int maxCacheAge)
          Retrieves the cache entry for the specified key.
 

Method Detail

cachePage

void cachePage(String key,
               CacheEntry entry,
               boolean persistent)
Caches a page with the specified key and persistence flag.

Parameters:
key - The key to cache the data for.
entry - The cache entry to store.
persistent - If true the entry will be stored in the persistent cache and be avaialble between restarts.

getCachedPage

CacheEntry getCachedPage(String key)
Retrieves the cache entry for the specified key. If the entry is expired null is returned. The expirationDate field of the CacheEntry object is used for determining expiration.

Parameters:
key - The key to retrieve the entry for.
Returns:
Then entry for the key, null if no entry exists or it has expired.

getCachedPage

CacheEntry getCachedPage(String key,
                         boolean useExpired)
Retrieves the cache entry for the specified key. If the entry is expired but still exists in the cache it is stil returned.

Parameters:
key - The key to retrieve the entry for.
useExpired - Flag to use the entry if it expired or not.
Returns:
The entry for the key, null if no entry exists for the key.

getCachedPage

CacheEntry getCachedPage(String key,
                         int maxCacheAge)
Retrieves the cache entry for the specified key. If the entry is older than the number of seconds specified by maxCacheAge null is returned.

Parameters:
key - The key to retrieve the entry for.
maxCacheAge - The maximum age of the entry in seconds.
Returns:
The entry for the key, null if no entry exists or if the entry is older than the specified max age.


Copyright © 2010 Jasig. All Rights Reserved.