| java.lang.Object org.clapper.curn.FeedCache
FeedCache | public class FeedCache (Code) | | Defines the in-memory format of the curn cache, and provides
methods for saving and restoring the cache.
See Also: Curn See Also: org.clapper.curn.parser.RSSChannel version: $Revision: 7041 $ |
FeedCache | FeedCache(CurnConfig config)(Code) | | Construct a new, empty cache object.
Parameters: config - the curn configuration |
addToCache | public void addToCache(String uniqueID, URL url, Date pubDate, FeedInfo parentFeed)(Code) | | Add (or replace) a cached URL.
Parameters: uniqueID - the unique ID string for the cache entry, or null.If null, the URL is used as the unique ID. Parameters: url - the URL to cache. May be an individual item URL, orthe URL for an entire feed. Parameters: pubDate - the publication date, if known; or null Parameters: parentFeed - the associated feed See Also: CurnUtil.normalizeURL |
containsID | public boolean containsID(String id)(Code) | | Determine whether the cache contains an entry with the specified
unique ID.
Parameters: id - the ID to check. true if the ID is present in the cache,false if not |
containsURL | public boolean containsURL(URL url)(Code) | | Determine whether the cache contains the specified URL.
Parameters: url - the URL to check. This method normalizes it. true if the ID is present in the cache,false if not |
getEntry | public FeedCacheEntry getEntry(String id)(Code) | | Get an entry from the cache by its unique ID.
Parameters: id - the unique ID to check the corresponding FeedCacheEntry object, or null ifnot found |
getEntryByURL | public FeedCacheEntry getEntryByURL(URL url)(Code) | | Get an entry from the cache by its URL.
Parameters: url - the URL the corresponding FeedCacheEntry object, or null ifnot found |
getEntryForItem | public FeedCacheEntry getEntryForItem(RSSItem item)(Code) | | Get an entry for an
RSSItem from the cache. This method
attempts to find the item by its unique ID. If the item has no ID,
then this method attempts to find the item by its URL.
Parameters: item - the RSSItem to find in the cache the corresponding FeedCacheEntry object, or null ifnot found |
loadFeedCacheEntry | void loadFeedCacheEntry(FeedCacheEntry entry)(Code) | | Add a
FeedCacheEntry to the cache. This method exists primarily
for use during deserialization of the cache.
Parameters: entry - the entry |
optimizeAfterLoad | void optimizeAfterLoad()(Code) | | Signify that the cache is finished loading (i.e., that all calls to
loadFeedCacheEntry are done).
|
setCurrentTime | public void setCurrentTime(Date datetime)(Code) | | Set the cache's notion of the current time, which affects how elements
are pruned when loaded from the cache. Only meaningful if set before
the load() method is called. If this method is never
called, then the cache uses the current time.
Parameters: datetime - the time to use |
|
|