Files
Athou_commafeed/src/main/java/com/commafeed/backend/model/Feed.java

141 lines
2.8 KiB
Java
Raw Normal View History

2013-03-23 16:17:19 +01:00
package com.commafeed.backend.model;
2013-03-20 20:33:42 +01:00
import java.util.Date;
import java.util.Set;
import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
2013-03-20 20:33:42 +01:00
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
2013-08-11 14:01:16 +02:00
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
2013-03-20 20:33:42 +01:00
@Entity
@Table(name = "FEEDS")
2013-03-21 08:55:53 +01:00
@SuppressWarnings("serial")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
2013-08-11 14:01:16 +02:00
@Getter
@Setter
2013-03-23 01:49:39 +01:00
public class Feed extends AbstractModel {
2013-03-20 20:33:42 +01:00
2013-04-14 18:28:48 +02:00
/**
* The url of the feed
*/
2013-03-31 08:45:55 +02:00
@Column(length = 2048, nullable = false)
2013-03-20 20:33:42 +01:00
private String url;
2013-07-02 14:33:53 +02:00
@Column(length = 2048, nullable = false)
private String normalizedUrl;
2013-07-04 21:32:34 +02:00
2013-07-02 14:33:53 +02:00
@Column(length = 40, nullable = false)
private String normalizedUrlHash;
2013-04-14 18:28:48 +02:00
/**
* The url of the website, extracted from the feed
*/
2013-04-03 15:53:57 +02:00
@Column(length = 2048)
private String link;
/**
* Last time we tried to fetch the feed
*/
2013-03-20 20:33:42 +01:00
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdated;
/**
* Last publishedDate value in the feed
*/
@Temporal(TemporalType.TIMESTAMP)
private Date lastPublishedDate;
/**
* date of the last entry of the feed
*/
@Temporal(TemporalType.TIMESTAMP)
private Date lastEntryDate;
/**
* error message while retrieving the feed
*/
2013-03-25 12:24:00 +01:00
@Column(length = 1024)
private String message;
/**
* times we failed to retrieve the feed
*/
2013-04-09 09:03:52 +02:00
private int errorCount;
/**
* feed refresh is disabled until this date
*/
@Temporal(TemporalType.TIMESTAMP)
private Date disabledUntil;
/**
* http header returned by the feed
*/
@Column(length = 64)
private String lastModifiedHeader;
/**
* http header returned by the feed
*/
2013-04-19 15:22:39 +02:00
@Column(length = 255)
private String etagHeader;
/**
* average time between entries in the feed
*/
private Long averageEntryInterval;
/**
* last hash of the content of the feed xml
*/
2013-06-09 16:22:38 +02:00
@Column(length = 40)
private String lastContentHash;
@OneToMany(mappedBy = "feed", cascade = CascadeType.REMOVE)
private Set<FeedEntry> entries;
2013-03-20 20:33:42 +01:00
2013-03-27 11:32:22 +01:00
@OneToMany(mappedBy = "feed")
private Set<FeedSubscription> subscriptions;
/**
* detected hub for pubsubhubbub
*/
2013-06-05 21:50:26 +02:00
@Column(length = 2048)
private String pushHub;
/**
* detected topic for pubsubhubbub
*/
2013-06-05 21:50:26 +02:00
@Column(length = 2048)
private String pushTopic;
@Column(name = "push_topic_hash", length = 2048)
private String pushTopicHash;
/**
* last time we subscribed for that topic on that hub
*/
2013-06-05 21:50:26 +02:00
@Temporal(TemporalType.TIMESTAMP)
private Date pushLastPing;
2013-03-20 20:33:42 +01:00
public Feed() {
}
public Feed(String url) {
this.url = url;
}
}