Installing the Alerts Service

Transformer's Alerts Service hosts and manages containers of application 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 FX Suite applications use the Alerts Service to manage order notifications.

Contents:

Requirements

Transformer version required:

  • Alerts Service 7 requires Transformer 7
  • Alerts Service 6.2 requires Transformer 6.2

Upgrading to the Alerts Service 7

The Alerts Service 7 persists notifications in a different format to how they were persisted by the Alerts Service 6.2. Migrating persisted notifications from Transformer 6.2 to Transformer 7.0 requires an extra step to convert the persisted data to the new format.

For detailed upgrade instructions, see Upgrading to the Caplin Platform 7.

Installing the Alerts Service

To install Transformer's Alerts Service:

  1. Activate and configure Transformer's Persistence Service
  2. Deploy the Alerts Service blade

Activate and configure Transformer's Persistence Service

The Alerts Service is dependent on the Persistence Service, which is included in Transformer 6.2.3 and later.

For Transformer 6.2.3+:

  1. Activate the Persistence Service. See Activating the Persistence Service 6.2.

For Transformer 7.0+:

  1. Activate the Persistence Service. See Activating the Persistence Service 7.
  2. Create the persistence table and trigger required by the Alerts Service 7.

    To create the table and trigger, adapt the Alerts Service's file-backed persistence bootstrap script to the SQL syntax of your database server. The bootstrap script can be found within the Alerts Service's deployment kit: <blade-root>/Transformer/etc/bootstrap.sql

Deploy the Alerts Service blade

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.

Configuring 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: