IS API defines class called ISCriteria to make advanced selection of information objects in the IS repository. This chapter summarizes different types of subscriptions, which can be done using the ISCriteria class.
Subscribes to all information objects of type Person, whose names start with capital P.
Subscribes to all information objects of type Person or all the objects, whose names start with capital P.
One can also used the ~ and ! operators, which are defined for the ISType class in order to compose advanced criteria like it is shown in the following examples.
"Listing 5.2" shows how an application can subscribe for a subset of information in the particular server of the IS repository.
This program is very similar to the one which is shown in "Listing 5.1". The only difference is in the subscribe call (line 28). The first argument of the subscribe method specifies the IS server name, the second one the subscription criteria and the last one the callback function. The subscription criteria must be a valid POSIX-style regular expression. The callback function has the same format as the function for an individual information subscription.
When any information in this particular IS server is changed the callback function is called. The isc argument (line 4) is a pointer to the object that describes the information which has been changed. One can get name, type and value of the changed information from this object. In addition it can also be used to get the reason why the callback has been called. The valid reasons are: information has been inserted, updated or removed from the IS repository.
2 July 1998 - WebMaster | Copyright © CERN 1998 |