Package com.appspot.piment.model

Examples of com.appspot.piment.model.CommentMap


  public int syncUserComment(UserMap user) {

  int count = 0;

  // 前回同期化された最後のコメント履歴レコードを取り出す
  CommentMap lastestCreateCommentMap = commentMapDao.getNewestItem(user.getId());

  // sinaから前回の同期化以降の新コメントを取得する
  List<Comment> newComments = sinaWeiboApi.getCommentTimeline(lastestCreateCommentMap != null ? lastestCreateCommentMap.getSinaCommentId() : null, null);

  log.info("Sina comment --> 同期化件数:" + newComments.size());

  // メッセージ単位で同期化処理を行う
  Comment comment = null;
  try {
    for (int i = newComments.size() - 1; i >= 0; i--) { // FOR-101
    comment = newComments.get(i);
    if (this.commentMapDao.getBySinaCommentId(comment.getId(), user.getId()) == null) {
      boolean result = syncSinaUserComment(user, comment, new CommentMap());
      if (result)
      count++;
    } else {
      log.info("Sina comment --> [" + comment.getId() + "] 同期化済みでスキップする。");
    }
View Full Code Here

TOP

Related Classes of com.appspot.piment.model.CommentMap

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.