Once the client has registered itself as an observer, the next step is to inform the Domain Manager about which events the observer wants to receive notifications. Smarts allows clients to subscribe to a number of different types of events. These are listed in Subscription methods summary.

Table 1. Subscription methods summary

Method type

Description

Method API call

property

Notifications about changes to specified object properties in the ICIM database. For example, when the “Vendor” field of Router::gw1 changes

propertySubscribe

propertyUnsubscribe

topology

Notifications about changes to the topology, such as the creation and deletion of objects. This does not refer to object property changes.

topologySubscribe

topologyUnsubscribe

event

Notifications about the posting and clearing of events and changes to their state.

subscribe

unsubscribe

subscribeAll

unsubscribeAll

getSubscriptionState

IsSubscribed

This table gives the names of the methods used to subscribe to and unsubscribe from different types of notifications.

The following code segment is an example script that subscribes to changes of the Vendor field of every device in the topology:

 $session = InCharge::session->init( );
 $obs = $session->observer();
 foreach $name ( $session->getClassInstances(
    "ICIM_UnitaryComputerSystem" ) ) {
  $session->propertySubscribe("::$name", "Vendor", 30);
 }