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()
NotificationsServicegetSubscriptions in interface NotificationsServicepublic 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)
NotificationsServicesubscribeInApp in interface NotificationsServiceitemId - topic-id of user accountpublic void unsubscribe(long itemId)
NotificationsServiceunsubscribe in interface NotificationsServiceitemId - topic-id of subscribed itempublic void notifySubscribers(String title, String message, long actingUsername, de.deepamehta.core.DeepaMehtaObject involvedItem)
NotificationsServicenotifySubscribers in interface NotificationsServicetitle - 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()
NotificationsServicegetNotifications in interface NotificationsServicepublic ArrayList<de.deepamehta.core.RelatedTopic> getUnseenNotifications()
NotificationsServicegetUnseenNotifications in interface NotificationsServicepublic void websocketTextMessage(String string, de.deepamehta.websockets.WebSocketConnection wsc)
websocketTextMessage in interface de.deepamehta.websockets.event.WebsocketTextMessageListenerpublic void postCreateTopic(de.deepamehta.core.Topic topic)
postCreateTopic in interface de.deepamehta.core.service.event.PostCreateTopicListenerpublic 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.PostUpdateTopicListenerpublic void postDeleteTopic(de.deepamehta.core.model.TopicModel tm)
postDeleteTopic in interface de.deepamehta.core.service.event.PostDeleteTopicListenerpublic void postCreateAssociation(de.deepamehta.core.Association association)
postCreateAssociation in interface de.deepamehta.core.service.event.PostCreateAssociationListenerCopyright © 2017. All rights reserved.