initial pubsubhubbub support (#44)

This commit is contained in:
Athou
2013-05-20 14:06:09 +02:00
parent badc830535
commit c88d3021b8
14 changed files with 389 additions and 7 deletions

View File

@@ -3,10 +3,13 @@ package com.commafeed.backend.model;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@@ -64,6 +67,10 @@ public class Feed extends AbstractModel {
@Column(length = 255)
private String etagHeader;
@OneToOne(fetch = FetchType.LAZY, mappedBy = "feed", cascade = {
CascadeType.PERSIST, CascadeType.MERGE })
private FeedPushInfo pushInfo;
@ManyToMany(mappedBy = "feeds")
private Set<FeedEntry> entries = Sets.newHashSet();
@@ -174,4 +181,12 @@ public class Feed extends AbstractModel {
this.lastUpdateSuccess = lastUpdateSuccess;
}
public FeedPushInfo getPushInfo() {
return pushInfo;
}
public void setPushInfo(FeedPushInfo pushInfo) {
this.pushInfo = pushInfo;
}
}

View File

@@ -0,0 +1,60 @@
package com.commafeed.backend.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
@Entity
@Table(name = "FEEDPUSHINFOS")
@SuppressWarnings("serial")
public class FeedPushInfo extends AbstractModel {
@OneToOne(fetch = FetchType.LAZY)
private Feed feed;
@Column(length = 2048, nullable = false)
@Index(name = "topic_index")
private String topic;
@Column(length = 2048, nullable = false)
private String hub;
private boolean active;
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public Feed getFeed() {
return feed;
}
public void setFeed(Feed feed) {
this.feed = feed;
}
public String getHub() {
return hub;
}
public void setHub(String hub) {
this.hub = hub;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
}