chris@1: /* chris@1: * SONEWS News Server chris@1: * see AUTHORS for the list of contributors chris@1: * chris@1: * This program is free software: you can redistribute it and/or modify chris@1: * it under the terms of the GNU General Public License as published by chris@1: * the Free Software Foundation, either version 3 of the License, or chris@1: * (at your option) any later version. chris@1: * chris@1: * This program is distributed in the hope that it will be useful, chris@1: * but WITHOUT ANY WARRANTY; without even the implied warranty of chris@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the chris@1: * GNU General Public License for more details. chris@1: * chris@1: * You should have received a copy of the GNU General Public License chris@1: * along with this program. If not, see . chris@1: */ chris@1: chris@1: package org.sonews.feed; chris@1: chris@3: import org.sonews.storage.Article; chris@1: chris@1: /** chris@1: * Controlls push and pull feeder. chris@1: * @author Christian Lins chris@1: * @since sonews/0.5.0 chris@1: */ cli@37: public final class FeedManager chris@1: { chris@1: cli@37: public static final int TYPE_PULL = 0; cli@37: public static final int TYPE_PUSH = 1; cli@37: private static PullFeeder pullFeeder = new PullFeeder(); cli@37: private static PushFeeder pushFeeder = new PushFeeder(); cli@37: cli@37: /** cli@37: * Reads the peer subscriptions from database and starts the appropriate cli@37: * PullFeeder or PushFeeder. cli@37: */ cli@37: public static synchronized void startFeeding() cli@37: { cli@37: pullFeeder.start(); cli@37: pushFeeder.start(); cli@37: } cli@37: cli@37: public static void queueForPush(Article article) cli@37: { cli@37: pushFeeder.queueForPush(article); cli@37: } cli@37: cli@37: private FeedManager() cli@37: { cli@37: } chris@1: }