diff -r 4b2c8bedb094 -r 2541bdb54cb2 org/sonews/feed/PullFeeder.java --- a/org/sonews/feed/PullFeeder.java Mon Aug 24 14:40:37 2009 +0200 +++ b/org/sonews/feed/PullFeeder.java Wed Aug 26 10:47:51 2009 +0200 @@ -27,9 +27,13 @@ import java.net.UnknownHostException; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.logging.Level; import org.sonews.config.Config; +import org.sonews.daemon.AbstractDaemon; import org.sonews.util.Log; import org.sonews.storage.StorageBackendException; import org.sonews.storage.StorageManager; @@ -43,20 +47,23 @@ * @author Christian Lins * @since sonews/0.5.0 */ -class PullFeeder extends AbstractFeeder +class PullFeeder extends AbstractDaemon { private Map highMarks = new HashMap(); private BufferedReader in; private PrintWriter out; + private Set subscriptions = new HashSet(); - @Override - public void addSubscription(final Subscription sub) + private void addSubscription(final Subscription sub) { - super.addSubscription(sub); - - // Set a initial highMark - this.highMarks.put(sub, 0); + subscriptions.add(sub); + + if(!highMarks.containsKey(sub)) + { + // Set a initial highMark + this.highMarks.put(sub, 0); + } } /** @@ -167,6 +174,21 @@ try { + this.subscriptions.clear(); + List subsPull = StorageManager.current() + .getSubscriptions(FeedManager.TYPE_PULL); + for(Subscription sub : subsPull) + { + addSubscription(sub); + } + } + catch(StorageBackendException ex) + { + Log.get().log(Level.SEVERE, host, ex); + } + + try + { for(Subscription sub : this.subscriptions) { host = sub.getHost();