Package org.apache.roller.planet.pojos

Examples of org.apache.roller.planet.pojos.PlanetSubscriptionData


               
                // add feed url to the "live" list
                liveUserFeeds.add(feedUrl);
               
                // if sub already exists then update it, otherwise add it
                PlanetSubscriptionData sub = planet.getSubscription(feedUrl);
                if (sub == null) {
                    log.info("ADDING feed: "+feedUrl);
                   
                    sub = new PlanetSubscriptionData();
                    sub.setTitle(weblog.getName());
                    sub.setFeedURL(feedUrl);
                    sub.setSiteURL(siteUrl);
                    sub.setAuthor(weblog.getHandle());
                   
                    planet.saveSubscription(sub);
                    group.getSubscriptions().add(sub);
                } else {
                    sub.setTitle(weblog.getName());
                    sub.setAuthor(weblog.getHandle());
                   
                    planet.saveSubscription(sub);
                }
            }
           
            // new subs added, existing subs updated, now delete old subs
            Iterator subs = group.getSubscriptions().iterator();
            while(subs.hasNext()) {
                PlanetSubscriptionData sub =
                        (PlanetSubscriptionData) subs.next();
                if (!liveUserFeeds.contains(sub.getFeedURL())) {
                    log.info("DELETING feed: "+sub.getFeedURL());
                    planet.deleteSubscription(sub);
                    group.getSubscriptions().remove(sub);
                }
            }
           
View Full Code Here


        strategy.store(entry);
    }
       
    public void saveSubscription(PlanetSubscriptionData sub)
        throws RollerException {
        PlanetSubscriptionData existing = getSubscription(sub.getFeedURL());
        if (existing == null || (existing.getId().equals(sub.getId()))) {
            this.strategy.store(sub);
        } else {
            throw new RollerException("ERROR: duplicate feed URLs not allowed");
        }
    }
View Full Code Here

        Iterator subs = getAllSubscriptions();
        while (subs.hasNext()) {
           
            long subStartTime = System.currentTimeMillis();
           
            PlanetSubscriptionData sub = (PlanetSubscriptionData)subs.next();
           
            // reattach sub.  sub gets detached as we iterate
            sub = this.getSubscriptionById(sub.getId());
           
            Set newEntries = this.getNewEntries(sub, feedFetcher, feedInfoCache);
            int count = newEntries.size();
           
            log.debug("   Entry count: " + count);
            if (count > 0) {
                sub.purgeEntries();
                sub.addEntries(newEntries);
                this.saveSubscription(sub);
                this.strategy.flush();
            }
            long subEndTime = System.currentTimeMillis();
            log.debug("   " + count + " - "
                    + ((subEndTime-subStartTime)/1000.0)
                    + " seconds to process (" + count + ") entries of "
                    + sub.getFeedURL());
        }
        // Clear the aggregation cache
        clearCachedAggregations();
       
        long endTime = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of org.apache.roller.planet.pojos.PlanetSubscriptionData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.