Application Packaging Standard

Last updated 18-Mar-2019

Event Processing

The platform allows APS applications to track and process various events in the system and other applications as explained in APS Events. The embedded demo project logically continues the User Management demo project.

../../../_images/tracks-event.png

Due to this integration, applications can be as intelligent as:

  • Notify customers about some events in the platform.
  • Run a process on an event, for example, run virus detection in a new file of a web site.
  • Provision a resource if another resources appeared, for example, create a DNS record for a new server.
../../../_images/event-step-model-b.png ../../../_images/event-step-meta.png ../../../_images/event-step-provision.png ../../../_images/event-step-presentation.png ../../../_images/event-step-deploy.png ../../../_images/event-step-provisioning.png

Scenario

In this project, the application will monitor VPSes, hosted domains, and service users on the following event types as described in the APS Events concepts:

  • Creating VPS, hosted domain (domain zone), or service user
  • Deleting VPS, hosted domain (domain zone), or service user
  • Adding or removing VPS link with an offer or service user
  • Changing VPS properties

This comprises all event types defined in the List of Types concept. Following this project, you will create an APS package similar to the sample package.

Resource Model

Compared with the previous project in the track, the new package contains one more APS type - event. The new type will have a relation with the management context type. You can use the new events service to subscribe to event types before the management context appears.

../../../_images/event-model.png

Possible event types and event subscriptions are explained in the List of Types section. With the new service, the application will be able to handle the following events:

  • Creating (making available) a VPS, domain, or user - one event type (available), three types of sources
  • Removing a VPS, domain, or user - one event type (removed), three different types of sources
  • Linking and unlinking a VPS with an offer or a user - two event types (linked and unlinked), two links from the same source type
  • Changing any VPS properties - one event type (changed) from VPSes

The corresponding event resource type in the platform must be declared as Autoprovide=true. Since it has a required relation with the management context, the system will auto-provision the latter as well.

Warning

In this model, only one resource can be marked as auto-provided. Otherwise, if both, the context and the event types, are marked as auto-provided, it might happen that during the provisioning process, the system will require provisioning of two management contexts.

Start Your Demo Project

Clone the package you have created in the User Management demo project to the new one by following these steps.

  1. Create a new project based on the input package and using one of the ways:

    • In the Eclipse or IntelliJ IDEA IDE, import the package and then rename it, for example, assign it the event-mgmt name.
    • Extract the package to a folder, for example, to event-mgmt/.
  2. Replace every occurrence of the custom application ID and type ID prefix with http://aps-standard.org/samples/event-mgmt/ in all project files. This will replace the old application and types with the new ones.

  3. To verify if there are no typo in the new project, try to build the new package using either Eclipse IDE, IDEA IDE, or command line APS tools. For example, run:

    $ aps build event-mgmt
    

If no errors detected and you have successfully built an APS package, then proceed to the next step.

Conclusion

In this first step, we identified the purpose of the application, a relevant scenario, and a resource model.

To reach the goal, you have started the demo project to create and test an APS package similar to the sample package.