This topic describes how to extend IBM Director to include user-defined dynamic filters.
A dynamic filter defines the criteria used to query the IBM Director database tables and determine the managed objects that meet the criteria. The criteria can be combined using Boolean operations such as AND (all true) and OR (any true). A group is the set of managed objects determined by these constraints and operations, for example, the set of managed objects that have Pentium III processors and have a particular device using a Motorola chipset.
An IBM Director extension can define default dynamic filters that appear in the Groups pane of the IBM Director management console. (More information about the Groups pane and the console window can be found in the Primary Console Window topic). These filters are defined in the InitClassInstances() method of the extension's TWGExtension subclass.
To create a dynamic filter, you must first define TWGFilterConstraint objects that specify the criteria used to query the database tables and the operations used to combine the criteria. There are two types of constraints:
Both child and parent constraints contain a level identifier that defines where in a logical tree the constraint belongs. The topmost element in the tree is always a parent constraint, even if it has only one child constraint below it. Assign this first parent constraint a level identifier with only one qualifier in it, for example, 0, 1, 42, or 999. All other constraints begin with that same qualifier. For example, if the top level constraint is 42, all of its descendant qualifiers begin with 42: 42.1, 42.2, 42.12, 42.1.8, and 42.12.3.
For example, to define a filter that includes all managed objects that have Pentium III processors and have a Motorola chipset device, you would need to create three constraint objects:
Once created, these constraints can be added to a TWGFilterParms object that defines all the parameters for a dynamic database filter.