40 lines
1017 B
Java
40 lines
1017 B
Java
|
package org.gcube.portlets.user.newsfeed.server;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
|
||
|
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||
|
import org.gcube.common.core.utils.logging.GCUBEClientLog;
|
||
|
import org.gcube.portal.databook.shared.Like;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author Massimiliano Assante ISTI-CNR
|
||
|
*
|
||
|
*/
|
||
|
public class NotificationsThread implements Runnable {
|
||
|
private static GCUBEClientLog _log = new GCUBEClientLog(NotificationsThread.class);
|
||
|
private String commentText;
|
||
|
|
||
|
private NotificationsManager nm;
|
||
|
private ArrayList<Like> likes;
|
||
|
|
||
|
|
||
|
public NotificationsThread(String commentText, NotificationsManager nm, ArrayList<Like> likes) {
|
||
|
super();
|
||
|
this.commentText = commentText;
|
||
|
this.nm = nm;
|
||
|
this.likes = likes;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void run() {
|
||
|
for (Like fav : likes) {
|
||
|
boolean result = nm.notifyCommentReply(fav.getUserid(), fav.getFeedid(), commentText);
|
||
|
_log.trace("Sending Notification for favorited post comment added to: " + fav.getFullName() + " result?"+ result);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|