API notification - RapturePlatform/Rapture GitHub Wiki

Notification API

The notification API is used as a means for transferring notifications between interested parties. In most cases a notification provider maintains a list of messages, and each message is associated with an ever increasing 'epoch number.' A client can retrieve the latest epoch number from a provider and then poll for changes since that epoch - all updates since that point can be returned.

getNotificationManagerConfigs

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
List<RaptureNotificationConfig> retVal = notificationApi.getNotificationManagerConfigs();
retVal = baseAPI.doNotification_GetNotificationManagerConfigs();

Entitlement: /admin/notification

This method retrieves the notification providers in use at this Rapture system.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

listNotificationsByUriPrefix

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
List<RaptureFolderInfo> retVal = notificationApi.listNotificationsByUriPrefix(uriPrefix);
retVal = baseAPI.doNotification_ListNotificationsByUriPrefix(uriPrefix);

Entitlement: /user/get

Returns a list of full display names of the paths below this one. Ideally optimized depending on the repo.

Function Parameters

Parameter Type Description
uriPrefix String

Return value

Type Description
List

findNotificationManagerConfigsByPurpose

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
List<RaptureNotificationConfig> retVal = notificationApi.findNotificationManagerConfigsByPurpose(purpose);
retVal = baseAPI.doNotification_FindNotificationManagerConfigsByPurpose(purpose);

Entitlement: /admin/notification

Notification providers have an associated purpose - this method returns only those providers that match the given purpose.

Function Parameters

Parameter Type Description
purpose String

Return value

Type Description
List

createNotificationManager

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
RaptureNotificationConfig retVal = notificationApi.createNotificationManager(notificationManagerUri, config, purpose);
retVal = baseAPI.doNotification_CreateNotificationManager(notificationManagerUri, config, purpose);

Entitlement: /admin/notification

This method creates a definition of a notification provider.

Function Parameters

Parameter Type Description
notificationManagerUri String
config String
purpose String

Return value

Type Description
RaptureNotificationConfig
Types used in this function

RaptureNotificationConfig

Config info for the main object in the Notification API.

Field Type
name String
config String
purpose String

notificationManagerExists

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
boolean retVal = notificationApi.notificationManagerExists(notificationManagerUri);
retVal = baseAPI.doNotification_NotificationManagerExists(notificationManagerUri);

Entitlement: /admin/notification

Indicates whether a notification provider with notificationName was found.

Function Parameters

Parameter Type Description
notificationManagerUri String

Return value

Type Description
boolean

getNotificationManagerConfig

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
RaptureNotificationConfig retVal = notificationApi.getNotificationManagerConfig(notificationManagerUri);
retVal = baseAPI.doNotification_GetNotificationManagerConfig(notificationManagerUri);

Entitlement: /admin/notification

This method returns the low level config for a given notification provider.

Function Parameters

Parameter Type Description
notificationManagerUri String

Return value

Type Description
RaptureNotificationConfig
Types used in this function

RaptureNotificationConfig

Config info for the main object in the Notification API.

Field Type
name String
config String
purpose String

deleteNotificationManager

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
void retVal = notificationApi.deleteNotificationManager(notificationManagerUri);
retVal = baseAPI.doNotification_DeleteNotificationManager(notificationManagerUri);

Entitlement: /admin/notification

This method removes a notification provider and all its content.

Function Parameters

Parameter Type Description
notificationManagerUri String

Return value

Type Description
void

getLatestNotificationEpoch

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
Long retVal = notificationApi.getLatestNotificationEpoch(notificationManagerUri);
retVal = baseAPI.doNotification_GetLatestNotificationEpoch(notificationManagerUri);

Entitlement: /user/notification

This method retrieves the current epoch number for a given notification point.

Function Parameters

Parameter Type Description
notificationManagerUri String

Return value

Type Description
Long

publishNotification

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
String retVal = notificationApi.publishNotification(notificationManagerUri, referenceId, content, contentType);
retVal = baseAPI.doNotification_PublishNotification(notificationManagerUri, referenceId, content, contentType);

Entitlement: /user/notification

This method pushes a notification to a provider.

Function Parameters

Parameter Type Description
notificationManagerUri String
referenceId String
content String
contentType String

Return value

Type Description
String

findNotificationsAfterEpoch

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
NotificationResult retVal = notificationApi.findNotificationsAfterEpoch(notificationManagerUri, epoch);
retVal = baseAPI.doNotification_FindNotificationsAfterEpoch(notificationManagerUri, epoch);

Entitlement: /admin/notification

This method returns the changes seen on a notification since an epoch. A client would then update its latest epoch by using the value in the notification result.

Function Parameters

Parameter Type Description
notificationManagerUri String
epoch Long

Return value

Type Description
NotificationResult
Types used in this function

NotificationResult

The object returned by a notification

Field Type
currentEpoch Long
references List(String)

getNotification

HttpNotificationApi notificationApi = new HttpNotificationApi(loginApi);
NotificationInfo retVal = notificationApi.getNotification(notificationUri, id);
retVal = baseAPI.doNotification_GetNotification(notificationUri, id);

Entitlement: /admin/notification

This method returns a notification message given its id.

Function Parameters

Parameter Type Description
notificationUri String
id String

Return value

Type Description
NotificationInfo
Types used in this function

NotificationInfo

Contains all relevant data for a notification.

Field Type
id String
content String
reference String
epoch Long
when Date
contentType String
who String
⚠️ **GitHub.com Fallback** ⚠️