org.clapper.curn
Class FeedCacheEntry

java.lang.Object
  extended by org.clapper.curn.FeedCacheEntry

public class FeedCacheEntry
extends java.lang.Object

Defines the contents of a cache entry. There is one cache entry per feed item.

Version:
$Revision: 6491 $
See Also:
CurnConfig, FeedInfo

Constructor Summary
FeedCacheEntry(java.lang.String entryID, java.net.URL channelURL, java.net.URL entryURL, java.util.Date pubDate, long timestamp)
          Construct a new FeedCacheEntry.
 
Method Summary
 java.net.URL getEntryURL()
          Get the URL for this entry.
 java.util.Date getPublicationDate()
          Get the publication date associated with the cached item.
 long getTimestamp()
          Get the timestamp associated with this entry.
 boolean isChannelEntry()
          Determine whether this entry is a channel entry or not.
 void setTimestamp(long timestamp)
          Set the timestamp associated with this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedCacheEntry

public FeedCacheEntry(java.lang.String entryID,
                      java.net.URL channelURL,
                      java.net.URL entryURL,
                      java.util.Date pubDate,
                      long timestamp)
Construct a new FeedCacheEntry.

Parameters:
entryID - the entry's unique ID.
channelURL - the main URL for the site's RSS feed
entryURL - the URL to be cached. May be an individual item URL, or the channel URL (again).
pubDate - the publication date of the item, or null if unknown
timestamp - the timestamp (milliseconds) to be cached
Method Detail

isChannelEntry

public boolean isChannelEntry()
Determine whether this entry is a channel entry or not. A channel entry has the same entry URL and channel URL. This method is really just convenient shorthand for:
entry.getChannelURL().sameFile(entry.getEntryURL())

Returns:
true if this entry is a channel (a.k.a., feed) entry, false if it is an item entry

getEntryURL

public java.net.URL getEntryURL()
Get the URL for this entry.

Returns:
the entry URL

getPublicationDate

public java.util.Date getPublicationDate()
Get the publication date associated with the cached item. This value is typically from within the parsed RSS item.

Returns:
the publication date, or null if not known

getTimestamp

public long getTimestamp()
Get the timestamp associated with this entry. The timestamp represents the last time (in milliseconds) that the URL was read.

Returns:
the timestamp

setTimestamp

public void setTimestamp(long timestamp)
Set the timestamp associated with this entry. The timestamp represents the last time (in milliseconds) that the URL was read.

Parameters:
timestamp - the timestamp


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.