Sun Java Communications Suite 5 Event Notification Service Guide

Calendar Server Example

A typical ENS publish and subscribe cycle for Calendar Server resembles the following:

  1. The event subscriber, csnotifyd, expresses interest in an event (subscribes).

  2. The event publisher, csadmind, detects events and sends notification (publishes).

  3. ENS publishes the event to the subscriber.

  4. The event subscriber cancels interest in the event (unsubscribes). This step happens implicitly when the connection to ENS is shut down.

Figure 1–2 illustrates this cycle and Table 1–1 provides the narrative for the figure.

Figure 1–2 Example Event Notification Service Publish and Subscribe Cycle for Calendar Server

Example event notification service publish and subscribe
cycle for Calendar Server.

Table 1–1 Sample ENS Publish and Subscribe Cycle


ENS Response  

1. The csnotifyd daemon sends a subscription request to ENS.

ENS stores the subscription in the subscriptions database. 

2. The csadmind daemon sends a notification request to ENS.

ENS queries the subscriptions database for subscriptions matching the notification. 

3. The csnotifyd daemon receives a notification from ENS.

When ENS receives a notification from a publisher, it looks up its internal subscription table to find subscriptions matching the event reference of the notification. Then for each subscription, it relays a copy of the notification to the subscriber who owns this subscription. 

4. Currently, csnotifyd does not bother sending cancellation requests to ENS.

Because the subscriptions store is in memory only (not in a database), all subscriptions are implicitly unsubscribed when the connection to ENS is shutdown.