public class NotificationsPlugin extends de.deepamehta.core.osgi.PluginActivator implements NotificationsService, de.deepamehta.websockets.event.WebsocketTextMessageListener, de.deepamehta.core.service.event.PostUpdateTopicListener, de.deepamehta.core.service.event.PostCreateTopicListener, de.deepamehta.core.service.event.PostDeleteTopicListener, de.deepamehta.core.service.event.PostCreateAssociationListener
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() |
String |
getSubscription(long itemId) |
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.
|
void |
postCreateAssociation(de.deepamehta.core.Association association) |
void |
postCreateTopic(de.deepamehta.core.Topic topic) |
void |
postDeleteTopic(de.deepamehta.core.model.TopicModel tm) |
void |
postUpdateTopic(de.deepamehta.core.Topic topic,
de.deepamehta.core.model.TopicModel tm,
de.deepamehta.core.model.TopicModel tm1) |
javax.ws.rs.core.Response |
setNotificationSeen(long newsId) |
void |
subscribeInApp(long itemId)
Create a subscription edge to an item.
|
javax.ws.rs.core.Response |
subscribeUser(long itemId) |
void |
unsubscribe(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 String getSubscription(long itemId)
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 itemId)
NotificationsService
subscribeInApp
in interface NotificationsService
itemId
- topic-id of user accountpublic void unsubscribe(long itemId)
NotificationsService
unsubscribe
in interface NotificationsService
itemId
- 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
public void postCreateTopic(de.deepamehta.core.Topic topic)
postCreateTopic
in interface de.deepamehta.core.service.event.PostCreateTopicListener
public void postUpdateTopic(de.deepamehta.core.Topic topic, de.deepamehta.core.model.TopicModel tm, de.deepamehta.core.model.TopicModel tm1)
postUpdateTopic
in interface de.deepamehta.core.service.event.PostUpdateTopicListener
public void postDeleteTopic(de.deepamehta.core.model.TopicModel tm)
postDeleteTopic
in interface de.deepamehta.core.service.event.PostDeleteTopicListener
public void postCreateAssociation(de.deepamehta.core.Association association)
postCreateAssociation
in interface de.deepamehta.core.service.event.PostCreateAssociationListener
Copyright © 2018. All rights reserved.