Class NotificationClient
- Author:
- Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it), Ahmed Ibrahim at ISTI-CNR (ahmed.ibrahim@isti.cnr.it)
-
Field Summary
Fields inherited from class org.gcube.social_networking.social_networking_client_library.BaseClient
SG3_BRIDGE_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCheck whether the token's owner has unread notifications or unread message notifications.List<org.gcube.portal.databook.shared.Notification>getNotifications(int from, int quantity) Get range notificationsorg.gcube.portal.databook.shared.NotificationPreferencesRetrieve the notification preferences of the token's owner.List<org.gcube.portal.databook.shared.Notification>Retrieve unread notifications of the token's owner (excluding messages).notifyUsers(org.gcube.portal.databook.shared.NotificationInputBean input) Send a notification to one or more users belonging to the caller token's context.voidsendCatalogueEvent(org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent event) Notify a catalogue event, types availeble seeCatalogueEventTypevoidsendJobNotification(org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean notification) Notify job statusvoidsendWorkspaceEvent(org.gcube.social_networking.socialnetworking.model.beans.workspace.WorkspaceEvent event) Notify a catalogue event, types available seeWorkspaceEventTypeMark all unread notifications of the token's owner as read.Mark a single notification as read if and only if it belongs to the token's owner.org.gcube.portal.databook.shared.NotificationPreferencessetPreferences(org.gcube.portal.databook.shared.NotificationPreferences preferences) Update the notification preferences of the token's owner.Methods inherited from class org.gcube.social_networking.social_networking_client_library.BaseClient
getServiceEndpoint
-
Constructor Details
-
NotificationClient
- Throws:
Exception
-
-
Method Details
-
getNotifications
Get range notifications- Parameters:
from- greater or equal to onequantity-- Returns:
-
sendJobNotification
public void sendJobNotification(org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean notification) Notify job status- Parameters:
notification-
-
sendWorkspaceEvent
public void sendWorkspaceEvent(org.gcube.social_networking.socialnetworking.model.beans.workspace.WorkspaceEvent event) Notify a catalogue event, types available seeWorkspaceEventType- Parameters:
event- an instance ofWorkspaceEvent
-
sendCatalogueEvent
public void sendCatalogueEvent(org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent event) Notify a catalogue event, types availeble seeCatalogueEventType- Parameters:
event- an instance ofCatalogueEvent
-
getUnreadNotifications
Retrieve unread notifications of the token's owner (excluding messages).Endpoint:
GET 2/notifications/get-unread-notificationsIdentity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; application tokens are rejected by the service with 403 Forbidden.
- Returns:
- the list of unread notifications for the calling user
-
checkUnread
Check whether the token's owner has unread notifications or unread message notifications.Endpoint:
GET 2/notifications/check-unreadIdentity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; application tokens are rejected by the service with 403 Forbidden.
- Returns:
- a map with boolean flags
notificationsandmessages
-
setNotificationRead
Mark a single notification as read if and only if it belongs to the token's owner.Endpoint:
POST 2/notifications/set-notification-read?id={id}Identity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; caller can only mark their own notifications as read. The service returns 403 Forbidden if the notification belongs to another user or if the token does not belong to a user.
- Parameters:
id- the identifier of the notification to mark as read- Returns:
- true when the notification is marked read
-
setAllNotificationsRead
Mark all unread notifications of the token's owner as read.Endpoint:
POST 2/notifications/set-all-notifications-readIdentity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; application tokens are rejected by the service with 403 Forbidden. Marks all unread notifications of the caller as read.
- Returns:
- true when all notifications of the caller are marked read
-
getPreferences
public org.gcube.portal.databook.shared.NotificationPreferences getPreferences()Retrieve the notification preferences of the token's owner.Endpoint:
GET 2/notifications/preferencesIdentity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; application tokens are rejected by the service with 403 Forbidden.
- Returns:
- the
NotificationPreferencesof the calling user
-