diff -r f2293e8566f5 -r d879bab39600 org/sonews/feed/PullFeeder.java --- a/org/sonews/feed/PullFeeder.java Thu Aug 20 18:41:21 2009 +0200 +++ b/org/sonews/feed/PullFeeder.java Tue Apr 27 22:11:30 2010 +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();