Sun WBEM SDK Developer's Guide

Adding a Class

Adding a class to an existing class involves the following tasks:

Creating a Class

The first step in creating a class is to specify a name for the class. In CIM WorkShop, class names are displayed using standard CIM syntax: SchemaIndicator_ClassName. If you create a class of a CIM Schema class, the acronym CIM is used before the class name. If you create a class of a Solaris Schema class, the name Solaris is used before the class name. The underscore character (_) is required in the name of all classes that inherit a Key qualifier.

How to Add a class
  1. In the class inheritance tree of the CIM WorkShop window, select the class from which to create a class.

  2. Choose one of the following procedures for creating a class:

    • Click Action->Add Class.

      or

    • Click the Add New Class icon in the toolbar of the CIM WorkShop window.

      or

    • Right-click the selected class and click Add Class.

      The New Class dialog box is displayed.

  3. In the Class Name field, type the name of the new class.

    For example, you can create a class from the class Solaris_ComputerSystem titled Ultra1_ComputerSystem.

  4. To retain inherited properties and methods of the class, click OK. To add new properties, click Add Property.

    If you click OK, a class is created that uses inherited properties, methods, qualifiers, and their values. If you click Add Property, the Add Property dialog box is displayed, in which you can specify properties to add to the class. For information about how to add properties to a class, see Adding New Properties to a Class.

Adding Qualifiers

You can add qualifiers to a new class. You cannot change or reset the values of inherited qualifiers that modify the class. Also, you cannot delete inherited qualifiers.

How to Add Qualifiers
  1. In the New Class dialog box, after you provide a name for the new class, click Class Qualifiers.

  2. In the Qualifiers dialog box, right-click the Qualifier for which you want to set new values and click Add Qualifier.

  3. In the Add Qualifier dialog box, select the name of a qualifier in the list and click OK.

  4. To set the scope of the qualifier:

    1. Click Scope.

    2. In the Scope dialog box, select the scope of the qualifier and click OK.

  5. To set the flavor of the qualifier:

    1. Click Flavors.

    2. In the Flavors dialog box, select the flavor of the qualifier and click OK.

  6. Click OK in the Qualifiers dialog box to close it.

Adding New Properties to a Class

You can add new properties to a class and modify their values. You cannot change the values of inherited properties, and you cannot delete inherited properties.

How to Add a New Property to a Class
  1. After specifying a name for the new class, click Add Property in the New Class dialog box.

    The Add Property dialog box is displayed.

  2. In the Name field, type the name of the new property.

  3. Select a property type from the Type field and click OK.

    The new property is displayed in the Properties tab of the New Class dialog box. If the list of properties is long, click the scroll bar to view the newly added property.

  4. Click OK in the New Class dialog box.

    For information about how to add new qualifiers or set qualifier values for a new property or class, see the following sections.

Adding Qualifiers to a New Property

You can set the values of qualifiers for new properties of the class. You cannot change or reset the values of qualifiers that modify inherited properties or methods. You cannot delete inherited qualifiers.

How to Add Qualifiers to a New Property
  1. In the New Class dialog box, click the new property you created and click Property Qualifiers.

    The Qualifiers dialog box is displayed for the property that you created.

  2. Click Add Qualifier.

  3. In the Name field of the Add Qualifier dialog box, select a qualifier and click OK.

  4. Click OK in the Qualifiers dialog box and in the New Class dialog box.

    The qualifier and qualifier type are set for the selected property.