A "//" comment is terminated by an EOL or by the end of the MOF specification (whichever comes first).
For example:
A "/*" comment is terminated by the next "*/" sequence, or by the end of the MOF specification (whichever comes first). Comments are not recognized by the metamodel and as such will not be preserved across compilations, that is, the output of a MOF compilation is not required to include any comments.
CIM is a conceptual model that is not bound to a particular
implementation. This allows it to be used to exchange management
information in a variety of ways, examples of which are described in
All names are case insensitive, in that two schema item names are identical if they differ only in case. This is mandated so that scripting technologies that are case insensitive can leverage CIM technology. (Note however that string values assigned to properties and qualifiers are not covered by this rule, and should be treated in a case-sensitive manner.)
The case of a name is set by its defining occurrence and must be preserved by all implementations. This is mandated so that implementations can be built using case-sensitive technologies such as Java and object databases. (This also allows names to be consistently displayed using the same user-friendly mixed-case format).
For example, an implementation, if asked to create class "Disk", must reject the request if there is already a class "DISK" in the current schema. Otherwise, when returning the name of the class "Disk", it must return the name in mixed case as it was originally specified.
CIM does not currently require support for any particular query language. It is assumed that implementations will specify which query languages are supported by the implementation and will adhere to the case conventions that prevail in the specified language. That is, if the query language is case-insensitive, statements in the language will behave in a case-insensitive manner.
For the full rules for schema names, see
The following sample shows how to declare a class:
For example, if the class "Acme_Disk_v1" is derived from
the class "CIM_Media":
The terms Base class, Superclass and Supertype are used interchangeably, as are Derived class, Subclass and Subtype.
The Superclass declaration must appear at a prior point in the MOF specification or already be a registered class definition in the namespace in which the derived class is defined.
-
-
class Acme_Disk_v1 : CIM_Media
{
string Manufacturer = "Acme";
string ModelNumber = "123-AAL";
};
When new instances of the class are declared, then such a property is automatically assigned its default value unless the instance declaration explicitly assigns a value to the property.
Certain qualifiers are well known and cannot be redefined (see the description of the metaschema). Apart from these, arbitrary qualifiers may be used.
Qualifier declarations include an explicit type indicator, which must be one of the intrinsic types. A qualifier with an array-based parameter is assumed to have a type, which is a variable-length homogeneous array of one of the intrinsic types. Note that in the case of boolean arrays, each element in the array is either TRUE or FALSE.
Examples:
Qualifiers are applied to a class by preceding the class declaration by a qualifier list, comma-separated, and enclosed within square brackets. Qualifiers are applied to a property in a similar fashion.
For example:
Qualifiers can be automatically propagated from classes to derived classes, or from classes to instances subject to certain rules. The rules behind how the propagation occurs are attached to each qualifier and encapsulated in the concept of the qualifier flavor. For example, a qualifier may be designated in the base class as automatically propagating to all of its derived classes, or the qualifier could be designated as belonging specifically to that class and not to be propagated. This aspect of the flavor is referred to as the propagation rule. In addition, the qualifier flavor can be used to control whether or not derived classes can be override the qualifier value, or whether it must be fixed for an entire class hierarchy. This aspect of qualifier flavor is referred to as override permissions.
Qualifier flavors are indicated by an optional clause after the
qualifier and preceded by a colon. They consist of some combination of
the key words EnableOverride, DisableOverride, ToSubclass and
Restricted, indicating the applicable propagation and override rules.
The recognized flavor types are listed in
For example:
In this example, Handle is designated as writable for the Process class and for every subclass of this class.
When specifying a boolean qualifier in a class or property
declaration, the name of the qualifier can be used without
also specifying a value. From the previous example:
If only the qualifier name is listed for a boolean qualifier, it is implicitly set to TRUE.
In contrast, when a qualifier is not specified at all for a class or
property, the default value for the qualifier is assumed. Using
another example:
Parameter | Interpretation | Default |
---|---|---|
EnableOverride | The qualifier is overridable | yes |
DisableOverride | The qualifier cannot be overriden | no |
ToSubclass | The qualifier is inherited by any subclass | yes |
Restricted | The qualifier applies only to the class in which it is declared | no |
Translatable | Indicates the value of the qualifier can be specified
in multiple locales (language and country combination). When
Translatable(yes) is specified for a qualifier, it is legal to create
implicit qualifiers of the form:
where "label" is the name of the qualifier with Translatable(yes), and ll and cc are the language code and country code designation, respectively, for the translated string. In other words, a label_ll_cc qualifier is a clone, or derivative, of the "label" qualifier with a postfix to capture the translated value's locale. The locale of the original value (that is, the value specified using the qualifier with a name of "label") is determined by the locale pragma. When a label_ll_cc qualifier is implicitly defined, the values for the other flavor parameters are assumed to be the same as for the "label" qualifier. When a label_ll_cc qualifier is defined explicitly, the values for the other flavor parameters must also be the same. A "yes" for this parameter is only valid for string-type qualifiers.
Example:
| no |
For example, the following class has one property ("Volume") which
serves as its key.
In this case, instances of "Drive" are distinguished using the "Volume" property, which acts as the key for the class.
Compound keys are supported and are designated by marking all of the required properties with the key qualifier.
If a new subclass is defined from a superclass, and the superclass has key properties (including those inherited from other classes), the new subclass cannot define any additional key properties. New key properties in the subclass can be introduced only if all classes in the inheritance chain of the new subclass are keyless.
If any reference to the class has the Weak qualifier, the properties
that are qualified as Key in the other classes in the association are
propagated to the referenced class. The key properties are duplicated
in the referenced class using the name of the property, prefixed by
the name of the original declaring class. For example:
The default value for a declared qualifier is used when the qualifier is not explicitly specified for a given schema element (explicit specification includes when the qualifier specification is inherited).
The MOF syntax allows specifying a qualifier without an explicit value. In this case, the assumed value depends on the qualifier type: booleans are true, numeric types are null, strings are null and arrays are empty.
For example the alias qualifier is declared as
follows:
This declaration establishes a qualifier called alias. The type of the qualifier is string. It has a default value of null and may only be used with properties, references and methods.
The metaqualifiers are declared as follows:
See
Property initialization consists of an optional list of preceding qualifiers, the name of
the property and an optional value. Any properties not initialized will receive their
default values as specified in the class definition, or (if no default value has been
specified) the special value NULL to indicate "absence of value". For example, given
the class definition:
then an instance of the above class might be declared as follows:
The resultant instance would take the following property values:
For subclasses, all of the properties in the superclass must be initialized along with the properties in the subclass. Any properties not specifically assigned in the instance block will receive either the default value for the property if there is one, or else the value NULL (if there is not one).
The values of all key properties must be specified in order for an instance to be
identified and created. There is no requirement to explicitly initialize other
properties. See
Instances of Associations may also be defined, for example:
Instance of CIM_ServiceSAPDependency
{
Dependent = "cim://root/default/Service.Name = \"mail\"";
Antecedent = "cim://root/default/ServiceAccessPoint.Name = \"PostOffice\"";
}
-
-
instance of Acme_LogicalDisk as $Disk
{
// Body of instance definition here ...
};
Such an alias can later be used within the same MOF specification as a value for an
object reference property. For more information, see
Object reference properties are declared by "XXX ref", indicating a strongly typed reference to objects of the class with name "XXX" (or a derived class thereof).
For example:
In associations, object references have cardinalities - denoted using MIN and MAX qualifiers. Here are examples of UML cardinality notations and their respective combinations of MIN and MAX values:
UML | MIN | MAX | Required MOF Text* | Description |
---|---|---|---|---|
* | 0 | NULL | Many | |
1..* | 1 | NULL | Min(1) | At least one |
1 | 1 | 1 | Min(1), Max(1) | One |
0,1 (or 0..1) | 0 | 1 | Max(1) | At most one |
See also
Regarding each of the array types:
Note that for the Bag array type, no significance is defined for the array index other than a convenience for accessing the elements of the array. For example, there can be no assumption that the same index will return the same value for every access to the array. The only assumption is that a complete enumeration of the indices will return a complete set of values.
For the Ordered array type, the array index is significant as long as no array elements are added, deleted or changed. In this case the same index will return the same value for every access to the array. If an element is added, deleted or changed, the index of the elements might change according to the implementation-specific ordering algorithm.
The Indexed array maintains the correspondence between element position and value. Array elements can be overwritten, but not deleted.
This version of the CIM specification does not support n-dimensional arrays.
Arrays of any basic data type are legal. Arrays of references are not legal. Arrays must be homogeneous. Arrays of mixed types are not supported. In MOF, the data type of an array precedes the array name. Array size, if fixed length, is declared within square brackets, following the array name. If a variable length array is to be defined, empty square brackets follow the array name.
Arrays are declared using the following MOF syntax:
If default values are to be provided for the array elements, the
following syntax is used:
The following MOF presents further examples
of Bag, Ordered and Indexed array declarations:
In the following example, Start and Stop methods are defined on the Service
class. Each method returns an integer value:
In the following example, a
Configure method is defined on the Physical DiskDrive
class. It takes a DiskPartitionConfiguration object
as a parameter and returns a boolean value:
The current standard compiler directives are listed in the
following table:
Complier Directive | Interpretation |
---|---|
#pragma namespace() | Determines the current default namespace. |
#pragma source() | Defined in Chapter 5. |
#pragma nonlocal() | Defined in Chapter 5. |
#pragma include() | Has a file name as a parameter. The file is assumed to be a MOF file. The pragma has the effect of textually inserting the contents of the include file at the point where the include pragma is encountered. |
#pragma locale() | Declares the locale used for a particular MOF
file. The locale is specified as a parameter of the form ll_cc, where
ll is the language code based on ISO/IEC 639, and cc is the country
code based on ISO/IEC 3166. When the pragma is not specified, the
assumed locale is "en_US".
It is important to note that this pragma does not apply to the syntax structures of MOF. Keywords, such as "class" and "instance", are always in en_US. |
#pragma instancelocale() | Declares the locale used for instances described in a MOF file. This pragma specifies the locale when "INSTANCE OF" MOF statements include string or char16 properties, and the locale is not the same as the locale specified by a #pragma locale() statement. The locale is specified as a parameter of the form ll_cc where ll is the language code based on ISO/IEC 639, and cc is the country code based on ISO/IEC 3166. |
Additional pragma directives may be added as a MOF extension mechanism. Unless standardized in a future CIM specification, such new pragma definitions must be considered vendor-specific. Use of non-standard pragmas will affect interoperability of MOF import and export functions.
When a qualifier value is derived from either a qualifier or a pragma, the qualifier overrides the pragma.
A formal specification of the representation may be found in
For example:
Successive quoted strings are concatenated as long as only white space
or a comment intervenes:
The escape sequences \n, \t, and \r are recognized as legal characters within a string.
The complete set is:
The character set of the string depends on the character set supported by the local installation. While the MOF specification may be submitted in UCS-2 form (see UCS Transformation Format-8 - UTF-8 in Referenced Documents), the local implementation may only support ANSI, and vice-versa. Therefore, the string type is unspecified and dependent on the character set of the MOF specification itself. If a MOF specification is submitted using UCS-2 characters outside of the normal ASCII range, then the implementation may have to convert these characters to the locally equivalent character set.
-
-
"a"
"\en"
"1"
"\x32"
Note that trigraphs such as \020 are not supported.
Integer values can also be used as character constants, as long as they are within the numeric range of the character type. For example, wide-character constants must fall within the range 0 to 0xFFFF.
-
-
1000
-12310
0x100
01236
100101B
Note that binary constants have a series of 1 and 0 digits, with a "b" or "B" suffix to indicate that the value is binary.
The number of digits permitted depends on the current type of the expression. For example, it is not legal to assign the constant 0xFFFF to a property of type uint8.
For example, the following are legal:
The range for floating point constants depends on whether float or double properties are used and must fit within the range specified for IEEE 4-byte and 8-byte floating point values, respectively.
For example:
An object reference can also be an alias. See
For example, given the class definition:
then a valid instance declaration is:
Refer to
Classes and instances may be assigned an alias in the manner described in
Aliases are identifiers which begin with the "$" symbol. When a subsequent reference to that instance is needed for an object reference property, the identifier is used in place of an explicit initializer.
Assuming that $Alias1 and $Alias2 have been declared as aliases for
instances, and the obref1 and obref2 properties are object references,
this example shows how the object references could be assigned to
point to the aliased instances:
Forward-referencing and circular aliases are permitted.
Contents | Next section | Index |