Installing the Alerts Service
Transformer’s Alerts Service hosts and manages containers of app notifications. Notifications are queued until their recipients read and dismiss them. You can use the com.caplin.datasource.notification API to post notifications to the service, or you can use StreamLink to set an Alerts Service Trigger, which generates a notification when a condition is met.
Caplin’s FX solutions use the Alerts Service to manage order notifications.
Prerequisites
You must activate Transformer’s Persistence Service before installing the Alerts Service.
Installing the Alerts Service
The Alerts Service is packaged as a service blade, CPB_AlertsService-<version>.zip
.
For instructions on how to deploy a service blade, see Deploy a Caplin supplied blade.
Setting user permissions
To allow users to interact with the Alerts Service, configure Liberator’s Permissioning Service according to the specification below. For more information on permissioning, see User Authentication and Permissioning.
Rules
Define rules that trigger when users contribute to the Alerts Service’s control subjects. The strings used for the 'permission namespace' and the 'action' are arbitrary; you are free to customise them to your own naming scheme.
Message Subject | Rule Type | Permission Namespace | Action | Action Ref | Product Ref |
---|---|---|---|---|---|
^/PRIVATE/NOTIFICATIONS/%u/CONTROL |
WRITE |
TRANSFORMER_ALERTS_SERVICE |
NOTIFICATION_OPERATION |
- |
ALL_PRODUCTS |
^/PRIVATE/ALERTS/%u/TRIGGERCONTROL/.* |
WRITE |
TRANSFORMER_ALERTS_SERVICE |
ALERT_OPERATION |
- |
ALL_PRODUCTS |
Permissions
Assign users the following permissions.
Product Set | Permission Namespace | Action | Authorisation |
---|---|---|---|
.* |
TRANSFORMER_ALERTS_SERVICE |
NOTIFICATION_OPERATION |
ALLOW |
.* |
TRANSFORMER_ALERTS_SERVICE |
ALERT_OPERATION |
ALLOW |
^/PRIVATE/NOTIFICATIONS/%u/.* |
- |
VIEW |
ALLOW |
^/FILTER/PRIVATE/NOTIFICATIONS/%u/.* |
- |
VIEW |
ALLOW |
^/PRIVATE/ALERTS/%u/.* |
- |
VIEW |
ALLOW |
Java Permissioning Integration API example
See the code below for an example of how to set rules and permissions using the Java Permissioning Integration API.
// Rules
permissioningDataSource.createActionRule("^/PRIVATE/NOTIFICATIONS/%u/CONTROL",
"TRANSFORMER_ALERTS_SERVICE", "NOTIFICATION_OPERATION", Constants.ALL_PRODUCTS);
permissioningDataSource.createActionRule("^/PRIVATE/ALERTS/%u/TRIGGERCONTROL/.*",
"TRANSFORMER_ALERTS_SERVICE", "ALERT_OPERATION", Constants.ALL_PRODUCTS);
// WRITE permissions
java.util.HashSet<String> allProducts = new java.util.HashSet<String>();
allProducts.add(".*");
user.permit(allProducts, "TRANSFORMER_ALERTS_SERVICE", "NOTIFICATION_OPERATION");
user.permit(allProducts, "TRANSFORMER_ALERTS_SERVICE", "ALERT_OPERATION");
// VIEW permissions
java.util.HashSet<String> viewProductSets = new java.util.HashSet<String>();
viewProductSets.add("^/PRIVATE/NOTIFICATIONS/%u/.*");
viewProductSets.add("^/FILTER/PRIVATE/NOTIFICATIONS/%u/.*");
viewProductSets.add("^/PRIVATE/ALERTS/%u/.*");
user.permit(viewProductSets, Constants.DEFAULT_PERMISSION_NAMESPACE, "VIEW");
See also: