com.arsdigita.search
Class TimedResultCache

java.lang.Object
  extended bycom.arsdigita.search.TimedResultCache
All Implemented Interfaces:
ResultCache

public class TimedResultCache
extends Object
implements ResultCache

Implements a timed-expiry result set cache.


Constructor Summary
TimedResultCache(int count, long size, long maxAge)
          Create a new result cache with room for 'size' entries, valid for a specified maximum age.
 
Method Summary
 ResultSet get(QuerySpecification query)
          Retrieves a result set from the cache
 void put(QuerySpecification query, ResultSet results)
          Stores a result set in the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedResultCache

public TimedResultCache(int count,
                        long size,
                        long maxAge)
Create a new result cache with room for 'size' entries, valid for a specified maximum age.

Parameters:
count - number of documents per result set to cache
size - max entries to cache
maxAge - maximum age in milliseconds
Method Detail

put

public void put(QuerySpecification query,
                ResultSet results)
Stores a result set in the cache

Specified by:
put in interface ResultCache
Parameters:
query - the query to store results for
results - the results to cache

get

public ResultSet get(QuerySpecification query)
Retrieves a result set from the cache

Specified by:
get in interface ResultCache
Parameters:
query - the query to get results for
Returns:
the cached result set, or null


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC