check if the feed has changed by using publishDate of the feed or the first entry

This commit is contained in:
Athou
2013-04-19 11:51:40 +02:00
parent f8a7241bc1
commit 7502707930
5 changed files with 73 additions and 6 deletions

View File

@@ -31,19 +31,44 @@ public class Feed extends AbstractModel {
@Index(name = "urlHash_index")
private String urlHash;
/**
* title of the feed, used only when fetching, not stored
*/
@Transient
private String title;
/**
* time it took to fetch the feed, used only when fetching, not stored
*/
@Transient
private long fetchDuration;
/**
* extracted published date from the feed, used only when fetching, not
* stored
*/
@Transient
private Date publishedDate;
/**
* The url of the website, extracted from the feed
*/
@Column(length = 2048)
private String link;
/**
* Last time we tried to fetch the feed
*/
@Temporal(TemporalType.TIMESTAMP)
@Index(name = "lastupdated_index")
private Date lastUpdated;
/**
* Last time we successfully refreshed the feed
*/
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdateSuccess;
@Column(length = 1024)
private String message;
@@ -169,4 +194,28 @@ public class Feed extends AbstractModel {
this.etagHeader = etagHeader;
}
public long getFetchDuration() {
return fetchDuration;
}
public void setFetchDuration(long fetchDuration) {
this.fetchDuration = fetchDuration;
}
public Date getPublishedDate() {
return publishedDate;
}
public void setPublishedDate(Date publishedDate) {
this.publishedDate = publishedDate;
}
public Date getLastUpdateSuccess() {
return lastUpdateSuccess;
}
public void setLastUpdateSuccess(Date lastUpdateSuccess) {
this.lastUpdateSuccess = lastUpdateSuccess;
}
}