Package com.salas.bb.core

Examples of com.salas.bb.core.DeletedObjectsRepository


        Changes changes = new Changes();

        StandardGuide[] localGuides = aLocalSet.getStandardGuides(null);
        StandardGuide[] remoteGuides = aRemoteSet.getStandardGuides(null);

        DeletedObjectsRepository dfr = GlobalController.SINGLETON.getDeletedFeedsRepository();

        // Scan through remote guides and verify each guide user has.
        // If user has no some guide then put the guide in the list
        // of guides to add. If user has the guide, verify its contents.
        // Later we could scan the lists of guides for addition and
        // guides for removal in order to detect the renaming.
        for (StandardGuide remoteGuide : remoteGuides)
        {
            String remoteGuideTitle = remoteGuide.getTitle();

            StandardGuide localGuide = findGuideByName(localGuides, remoteGuideTitle);

            if (localGuide == null)
            {
                // There's no guide with such name locally -- add feeds that weren't removed
                for (int j = 0; j < remoteGuide.getFeedsCount(); j++)
                {
                    IFeed feed = remoteGuide.getFeedAt(j);
                    if (remoteGuide.hasDirectLinkWith(feed) &&
                        (copyServiceLayout || !dfr.wasDeleted(remoteGuideTitle, feed.getMatchKey())))
                            changes.addFeed(feed);
                }

                // Reading lists
                ReadingList[] readingLists = remoteGuide.getReadingLists();
                for (ReadingList rl : readingLists)
                {
                    if (copyServiceLayout || !dfr.wasDeleted(remoteGuideTitle, rl.getURL().toString()))
                        changes.addReadingList(rl);
                }
            } else
            {
                if (localGuide.getLastUpdateTime() < remoteGuide.getLastUpdateTime())
View Full Code Here


     * @param aClearNew     <code>TRUE</code> to remove any local feeds which aren't on the service.
     */
    static void evaluateChangesInFeeds(StandardGuide aLocalGuide,
                                       StandardGuide aRemoteGuide, Changes aChanges, boolean aClearNew)
    {
        DeletedObjectsRepository dfr = GlobalController.SINGLETON.getDeletedFeedsRepository();

        // Add new feeds from remote source
        for (int i = 0; i < aRemoteGuide.getFeedsCount(); i++)
        {
            IFeed remoteFeed = aRemoteGuide.getFeedAt(i);
            if (!aRemoteGuide.hasDirectLinkWith(remoteFeed)) continue;

            IFeed localFeed = findFeed(aLocalGuide, remoteFeed);
            if (!aLocalGuide.hasDirectLinkWith(localFeed)) localFeed = null;

            // A feed has been added remotely
            if (localFeed == null)
            {
                if (aClearNew || !dfr.wasDeleted(aLocalGuide.getTitle(), remoteFeed.getMatchKey()))
                {
                    aChanges.addFeed(remoteFeed);
                }
            } else
            {
View Full Code Here

TOP

Related Classes of com.salas.bb.core.DeletedObjectsRepository

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.