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() + "] 同期化済みでスキップする。");
}