use of com.cmput301w18t05.taskzilla.request.command.GetNotificationsByUserIdRequest 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.GetNotificationsByUserIdRequest in project Taskzilla by CMPUT301W18T05.
the class NotificationsController method getNotificationsRequest.
/**
* Sends a notification request to the manager which gets all notifications by userid
*/
public void getNotificationsRequest() {
GetNotificationsByUserIdRequest request = new GetNotificationsByUserIdRequest(cUser.getId());
RequestManager.getInstance().invokeRequest(ctx, request);
notificationList.clear();
notificationList.addAll(request.getResult());
view.notifyChange();
}
Aggregations