public class NotificationsPlugin extends de.deepamehta.core.osgi.PluginActivator implements NotificationsService, de.deepamehta.websockets.event.WebsocketTextMessageListener
EMAIL_SUBSCRIPTION, IN_APP_SUBSCRIPTION, INVOLVED_ITEM_ID, NOTIFICATION, NOTIFICATION_BODY, NOTIFICATION_RECIPIENT_EDGE, NOTIFICATION_SEEN, NOTIFICATION_TITLE, SUBSCRIBED_ITEM_ID, SUBSCRIPTION_EDGE, SUBSCRIPTION_TYPE
Constructor and Description |
---|
NotificationsPlugin() |
Modifier and Type | Method and Description |
---|---|
List<de.deepamehta.core.RelatedTopic> |
getNotifications()
Gets all notifications for the logged-in user.
|
List<de.deepamehta.core.RelatedTopic> |
getNotificationsForUser() |
List<de.deepamehta.core.RelatedTopic> |
getSubscriptions()
Gets all subscribed topics for the logged-in user.
|
ArrayList<de.deepamehta.core.RelatedTopic> |
getUnseenNotifications()
Gets all unread notifications for the logged-in user.
|
ArrayList<de.deepamehta.core.RelatedTopic> |
getUnseenNotificationsForUser() |
void |
notifySubscribers(String title,
String message,
long actingUsername,
de.deepamehta.core.DeepaMehtaObject involvedItem)
Creates new notifications for all users with a direct or indirect (tags) subscription to the given item.
|
javax.ws.rs.core.Response |
setNotificationSeen(long newsId) |
void |
subscribeInApp(long accountId,
long itemId)
Create a subscription edge for useraccount to item.
|
javax.ws.rs.core.Response |
subscribeUser(long itemId) |
void |
unsubscribe(long accountId,
long itemId)
Remove subscription (edge) for given user account and item.
|
javax.ws.rs.core.Response |
unsubscribeUser(long itemId) |
void |
websocketTextMessage(String string,
de.deepamehta.websockets.WebSocketConnection wsc) |
public javax.ws.rs.core.Response subscribeUser(long itemId)
public javax.ws.rs.core.Response unsubscribeUser(long itemId)
public List<de.deepamehta.core.RelatedTopic> getSubscriptions()
NotificationsService
getSubscriptions
in interface NotificationsService
public List<de.deepamehta.core.RelatedTopic> getNotificationsForUser()
public ArrayList<de.deepamehta.core.RelatedTopic> getUnseenNotificationsForUser()
public javax.ws.rs.core.Response setNotificationSeen(long newsId)
public void subscribeInApp(long accountId, long itemId)
NotificationsService
subscribeInApp
in interface NotificationsService
accountId
- topic-id of user accountitemId
- topic-id of user accountpublic void unsubscribe(long accountId, long itemId)
NotificationsService
unsubscribe
in interface NotificationsService
accountId
- topic-id of user accountitemId
- topic-id of subscribed itempublic void notifySubscribers(String title, String message, long actingUsername, de.deepamehta.core.DeepaMehtaObject involvedItem)
NotificationsService
notifySubscribers
in interface NotificationsService
title
- title of the notificationmessage
- text part of the notificationactingUsername
- topic-id of user account performing the action which leads to the notification of all othersinvolvedItem
- item users can have subscribed (either "User Account" or any TopicType with "Tags" as child)public List<de.deepamehta.core.RelatedTopic> getNotifications()
NotificationsService
getNotifications
in interface NotificationsService
public ArrayList<de.deepamehta.core.RelatedTopic> getUnseenNotifications()
NotificationsService
getUnseenNotifications
in interface NotificationsService
public void websocketTextMessage(String string, de.deepamehta.websockets.WebSocketConnection wsc)
websocketTextMessage
in interface de.deepamehta.websockets.event.WebsocketTextMessageListener
Copyright © 2016. All rights reserved.