use of com.cmput301w18t05.taskzilla.request.command.RemoveNotificationRequest in project Taskzilla by CMPUT301W18T05.
the class NotificationsController method removeAllNotificationRequest.
/**
* Removes all notifications from the elasticsearch server and clears arraylist containing all
* notifications
*/
public void removeAllNotificationRequest() {
GetNotificationsByUserIdRequest request = new GetNotificationsByUserIdRequest(cUser.getId());
RequestManager.getInstance().invokeRequest(request);
for (Notification n : request.getResult()) {
RemoveNotificationRequest removeNotificationRequest = new RemoveNotificationRequest(n.getId());
RequestManager.getInstance().invokeRequest(removeNotificationRequest);
}
notificationList.clear();
view.notifyChange();
}
use of com.cmput301w18t05.taskzilla.request.command.RemoveNotificationRequest in project Taskzilla by CMPUT301W18T05.
the class NotificationsController method removeNotificationRequest.
/**
* Removes notification user clicked on.
*
* @param id Notification to be removed from elasticsearch server
* @param pos Position in arraylist containing the notification
*/
public void removeNotificationRequest(String id, Integer pos) {
RemoveNotificationRequest request = new RemoveNotificationRequest(id);
RequestManager.getInstance().invokeRequest(ctx, request);
notificationList.remove(pos);
view.notifyChange();
}
Aggregations