IBM Director uses the concept of groups to allow users to organize the systems they manage into workable sets. Groups are essentially collections of managed objects that have been placed into the group either manually (using the Static Group Editor) or automatically (using the Dynamic Group Editor). Tasks applied to a group are performed on all of the members of the group.
The concept of associations is used to allow the presentation of a group of systems in a logical manner, one that displays the relationship between a system and the others in the group. The Group Contents window will display a group of systems in a hierarchical order defined by any association selected.
This topic describes how to extend IBM Director to include and display new predefined groups and new association categories. If you are extending IBM Director to include any of the following items, read this topic before you begin:
In the IBM Director Management Console, the contents and presentation of systems and system attributes are controlled by the selection and activation of instances of two server object types: TWGFilter and TWGAssociation. For a given console, the selection of these instances is controlled using the groups window and the associations menu selection. Each group in the groups window corresponds to a TWGFilter instance and each item in the pull-down list of associations corresponds to a TWGAssociation instance.
The TWGFilter instance selected allows a subset of all TWGManagedObject instances in the server to be selected.
Note: TWGManagedObject is an abstract base class: all instances are actually instances of subclasses.
TWGFilters do not create TWGManagedObjects, they simply determine, for each TWGManagedObject, whether the TWGManagedObject matches the specific criteria of the TWGFilter.
The IBM Director Server supports 3 types of TWGFilter instances:
Class filters select on the basis of the class of each TWGManagedObject. Class filter instances are automatically created for each specific TWGManagedObject subclass that has one or more instances defined in the server. That is, when the first instance of a given TWGManagedObject subclass is created, such as the first TWGSNMPDevice instance, a class filter instance that matches on instances of TWGSNMPDevice (including subclasses) is created, if one does not already exist. Class filters cannot be edited or deleted by users.
Static filters base their selection on a list of TWGManagedObject object IDs. Only a fixed set of TWGManagedObjects are selected, based on the specific TWGManagedObject object IDs selected when the TWGFilter instance is created or last updated by the user.
Dynamic (functional) filters base their selection on the successful matching of a logical combination of one or more database queries. Only TWGManagedObjects that have attributes in the IBM Director database and satisfy the logical combination of queries defined for the filter are selected. Most attributes are provided by the IBM Director inventory task. Refer to Defining Default Dynamic Filters for more information on the creation and function of dynamic filters.
The following steps describe how TWGFilter functions for all types of filters:
All objects that match are passed as added objects to the active TWGAssociation instance for evaluation.
The TWGManagedObjectSet created and maintained by the active TWGFilter for each console is used:
The active TWGAssociation instance is responsible for creating and maintaining a set of relationships between the TWGManagedObject instances provided by the active TWGFilter. Each TWGAssociation instance, provided by a subclass of TWGAssociation, includes a function that receives notification of all added and changed TWGManagedObjects that were matched by the TWGFilter instance. If notified of an addition or change, the function generates or updates the TWGRelationship instances appropriate to the characteristics of the new or changed TWGManagedObjects. For example, one of the standard TWGAssociation instances provides relationships based on membership in network domains or workgroups. In this case, the TWGAssociation subclass generates and maintains a relationship instance ( TWGRelationship ) for each different network domain and Workgroup of which its TWGManagedObjects are members, and adds each matching TWGManagedObject to the appropriate relationship, if the object is a domain or workgroup member. Refer to the sample code for detailed information.
TWGRelationship instances can be thought of as folders or nodes in a tree hierarchy. Each TWGRelationship has zero or more objects below it (that is, contained within it) from a folder perspective. These objects, which can be TWGManagedObjects or other TWGRelationships (allowing a hierarchy), are referred to as down-links. A given TWGRelationship can have any number of down-links. TWGRelationship instances can also have zero or more up-links to other TWGRelationships. These links can be viewed as parents of the TWGRelationship.
Note: A down-link from one relationship to another implies an up-link from that relationship to the first.
If any up-links are defined, exactly one of them must be marked as the primary up-link. The primary up-link presents a simple tree representation of a set of TWGRelationships, called a TWGRelationshipSet. For a given console, all of the TWGRelationship instances created by the active TWGAssociation are stored in a TWGRelationshipSet instance. When an update occurs that causes the TWGAssociation to be notified, the TWGAssociation is supplied with the TWGRelationshipSet containing any existing TWGRelationships, which it is then expected to update. These updates can include:
These updates are then sent, along with any other object updates, to the IBM Director Management Console, which uses them to update the Group Contents window.
To implement a new TWGAssociation:
'void evaluateNewAndChangedObjects(TWGRelationshipSet, IntValueSet, IntValueSet, TWGManagedObjectSet)'
The following steps describe how to create a new TWGAssociation subclass and references the DomainWorkgroupAssociation sample code.
'public DomainWorkgroupAssociation() ...'
This constructor is used to instantiate the TWGAssociation subclass when it is first created and when it is restored. ( TWGAssociation Instances are persistent objects which are automatically restored.) For more information on persistent objects, refer to the TWGPersistentObject class.
'com.company_name.product_name.specific_name'
For example, the sample code uses the ID com.BobCo.domain_workgroup. This ID is used in the extension initialization code when the instance of the subclass is created.
The name string has to be translated to support different languages. To support translation, TWGAssociation supports the following methods:
'setName(String id, String resource_bundle)'
'setName(String name)'
The 'setName(String id, String resource_bundle)' method allows the name of the TWGAssociation instance to be specified as a Java ResourceBundle resource ID and as a ResourceBundle classname. Refer to the JDK V1.1 reference for information on using the java.util.ResourceBundle for language support. If translation text is not needed or is not available, the 'setName(String name)' method can be used to assign a literal string for the TWGAssociation's name. This string would be used for all languages.
The menu sort weight is an integer constant used to determine the order of the TWGAssociations presented in the Associations menu of the IBM Director Management Console. The TWGAssociations are ordered from lowest to highest sort weight. Equally weighted TWGAssociations are ordered alphabetically by name. The sort weight for a TWGAssociation defaults to 0, but can be set with the setMenuWeight(int) method. Sort weights below zero are reserved for TWGAssociations supplied with Director.
'public void evaluateNewAndChangedObjects(TWGRelationshipSet rel, IntValueSet add_set, IntValueSet chg_set, TWGManagedObjectSet mos)'
This method is the evaluation method for the TWGAssociation subclass. All notifications for updates to the TWGManagedObjectSets that the TWGAssociation instance evaluates are issued by invoking this method. The specific implementation of the method is particular to the given subclass, but most need to perform the following functions:
Often, as in the sample code, this evaluation includes querying the IBM Director database for records associated with the object ID of the TWGManagedObject. This data is then used to determine which TWGRelationships need to be created, if they do not exist already, and which TWGManagedObjects need to be down-linked from these TWGRelationships. In some cases, the data is used to determine which TWGManagedObjects are assigned to the is-a object for these relationships.
Refer to the TWGRelationship class for more information.
The registration can be part of the extension initialization for a larger set of extensions. If needed, the initial instances of the TWGAssociation subclass should be created from inside the 'TWGExtension.InitClassInstances()' method of the same TWGExtension subclass. The sample code includes a simple registration method, 'DomainWorkgroupAssociation.initializeDefault()', that is called by the extension to initialize the single instance needed for the DomainWorkgroupAssociation. This method uses the ID of the instance to check for its existence, and creates a new instance if the ID is not found.