Package org.corrib.s3b.sscf.synchronization.resources

Examples of org.corrib.s3b.sscf.synchronization.resources.ResourceDifference


          // then check if they are different (tags,description)
          // if they are different then we have a change in
          // bookmarking
          if (!storedPost.equals(remotePost))
            diffResult.add(new ResourceDifference(storedPost, remotePost, BookmarkingSource.FLICKR));
          // else there was no change in this bookmark
          break;
        }
      }
      //export is not allowed for FLICKR, so any stored resources that have no match
      //are omitted
    }

    // then run again to check for new imported posts
    // that don't have a matching in stored posts
    // SECOND RUN
    for (SynchronizationPost remotePost : remotePosts) {
      boolean matchingFound = false;
      for (SynchronizationPost storedPost : storedPosts) {
        if (remotePost.getHref().equals(storedPost.getHref())) {
          // just break as we created the diff result in the first run
          matchingFound = true;
          break;
        }
      }
      if (!matchingFound) {
        diffResult.add(new ResourceDifference(null, remotePost, BookmarkingSource.FLICKR));
      }
    }
    return diffResult;
  }
View Full Code Here


          matchingFound = true;
         
          //then check if they are different (tags,description)
          //if they are different then we have a change in bookmarking
          if(!storedPost.equals(remotePost))
            diffResult.add(new ResourceDifference(storedPost,remotePost, BookmarkingSource.DEL_ICIO_US));
          //else there was no change in this bookmark
          break;
        }
      }
     
      //if not matching was found, then this is a new resource
      //that comes from the stored bookmarks
      if(!matchingFound){
        diffResult.add(new ResourceDifference(storedPost,null,BookmarkingSource.DEL_ICIO_US));
      }
    }
   
    //then run again to check for new imported posts
    //that don't have a matching in stored posts
    //SECOND RUN
    for(SynchronizationPost remotePost : remotePosts){
      boolean matchingFound = false;
      for(SynchronizationPost storedPost : storedPosts){
        if(remotePost.getHref().equals(storedPost.getHref())){
          //just break as we created the diff result in the first run
          matchingFound = true;
          break;
        }
      }
      if(!matchingFound){
        diffResult.add(new ResourceDifference(null,remotePost,BookmarkingSource.DEL_ICIO_US));
      }
    }
    return diffResult;
  }
View Full Code Here

    int i = 0;
    for(String uri : uris){
      i++;
      String[] tags = new String[]{"test1","test2","dipa"};
      SynchronizationPost ip = new SynchronizationPost(uri,"test"+i,"",new Date(),true,SynchronizationState.NEW_IMPORTED,tags);
      ResourceDifference rd = new ResourceDifference(null,ip,BookmarkingSource.DEL_ICIO_US);
      result.add(rd);
    }
   
    return result;
  }
View Full Code Here

TOP

Related Classes of org.corrib.s3b.sscf.synchronization.resources.ResourceDifference

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.