Admin/evenNotification

From Omar Wiki

Jump to: navigation, search

Event Notification

Overview

See Subscription and EventNotification Information Model.

  • A user may define a Subscription to receive Notification of specified types of events that transpire in registry
    • The Subscription is submitted by publishing a Subscription object (as defined by ebRIM spec) to registry. This publish may be done like any other publish to the registry (Web UI, Java UI, admintol, JAXR client)
  • The Subscription uses an AdhocQuery object as a Selector Query, that is used by registry to select or determine whether an events matches the Subsription.
    • The AdhocQuery object is submitted by publishing a AdhocQuery object (as defined by ebRIM spec) to registry. This publish may be done like any other publish to the registry (Web UI, Java UI, admintol, JAXR client)
  • The Subscription also contains an Action which specifies the delivery action teh server takes when an event matches the Subscription.


SQL Selector Query

The Event Notification service uses an AdhocQuery as the selector for subscribed objects to monitor for events. Here are a few hints on how to define those queries:

  • A '$currentEventId' variable is supported. It will be replaced by AuditableEvent ID before performing the query. This can be used to limit the result set to objects actually affected by the given event.
  • Not all selector queries are executed once an event happens. Matching queries will be selected based on the following criteria:
    • query is a selector query for a subscription
      • query has 'eventId%=%<eventTypeID>%':
      • query has no 'eventId%=%'
  • Single quotes around text parameters should be escaped, using 2 sigle quotes:
''text''

An example query is:

SELECT DISTINCT ro.* FROM RegistryObject ro, AuditableEvent e, AffectedObject ao
 WHERE e.id = ''$currentEventId''
 AND e.eventType = ''urn:oasis:names:tc:ebxml-regrep:EventType:Updated''
 AND ao.id = ro.id AND ao.eventId = e.id