Application Packaging Standard

Last updated 18-Mar-2019

APS Events

In many cases, applications need to run certain operations on events related with certain resources or with any resources of certain types. For example, in a customer context, an anti-spam application may need to add each new domain to the list of protected domains and remove a domain from the list when it is removed from the customer context. Therefore, the corresponding application service must be notified about events of adding and removing domains, that is events related with all resources of a certain type.

Introduction

APS controller implements the publisher-subscriber relationship between resources. In this model, a resource, event subscriber, is interested in receiving notifications of events related with publishers, which can be another resource or a set of resources of a certain type. Publishers are known as event sources in the event management system. Application services subscribe their resources to events by sending a REST request to the APS controller with explicit specification of the following parameters:

  • Event subscriber ID - the ID of the resource, for which the event subscription must be created.
  • Event type as defined in the List of Types and other sections.
  • Event source - either ID of a resource (single event source) or ID of a resource type (collection of event sources).
  • Handler - a service operation (function) that will process event notifications. APS controller must send notifications in the format of REST requests addressed to the URI of the event handler.

Visibility Scope

To receive event notifications from an event publisher, the event subscriber must satisfy one of the following conditions:

  • It shares the same owner with the event publisher.
  • It is linked directly with the event publisher.

Event Types

There are general and specialized event types as explained in this document:

  • General events
    • Any APS resource or type can be an event source
    • Events are triggered by one of activities: linked, unlinked, changed, removed, and available
  • Bind-to-domain events
    • Only parent subscriptions can be event sources
    • An event is triggered when the parent subscription (event source) binds with a child domain registration subscription
  • Resource limit change events
    • Only subscriptions can be event sources
    • Events are triggered when resource limits in subscriptions are changed