Frequently Asked Questions


1.

Various qualifiers exist to allow me to specify, for example, that a particular numerical property has a maximum value of 10 or a string property has a maximum length of 23 characters . How can I encode constraints between properties, particularly properties in different classes (for example, this numeric property has a maximum value of 72 unless property X in class B has a value of "F" in which case the maximum value of this property is 97) ?

this cannot be done except by making an informal statement in the description of the property. it would, of course, be possible to use a formal definition of your own devising in the description and allow your own software to interpret it; for example: [description (`this property defines the size ``----maxvalue dependson(b.x == ;f' ? 72 : 97;`)] here i have assumed that you have defined your own escape sequence (----) and your own constraint language based on a sort of c++ syntax. descriptions are used informally at many points in the cim schema. one of the properties, for example, of the cim_ethernetport class is defined as follows: [description (`capabilities of the ethernetport.for example, the ``device may support alertonlan, wakeonlan, load ``balancing and/or failover.if failover or load ``balancing capabilities are listed, a sparegroup ``(failover) or extracapacitygroup (load balancing) ``should also be defined to completely describe the ``capability.`), valuemap {`0`, `1`, `2`, `3`, `4`, `5`}, values {`unknown` `other` `alertonlan` `wakeonlan`, `failover`, `loadbalancing`}, arraytype (`indexed`), modelcorrespondence { `cim_ethernetport.capabilitydescriptions`} ] uint16 capabilities[]; the informal description places a constraint on this property-if capabilities contains failover, then an instance of the cim_sparegroup class should also exist. there is currently no way to express this formally, but there is a movement within the dmtf to add a more powerful constraint language of this type to mof . note, however, that the presence of a qualifier stating that the maximum value of a particular numerical property is 56 does not mean that most wbem servers will enforce such a condition. the qualifier is there to be read by providers and clients which are expected to enforce the constraint.

2.

Can an association associate two associations?

i assume this question means, `can an association relate one association with another association?` if so, the answer is `yes.` this is clear from the dmtf's metamodel where it is stressed that: 1. an association is a normal class. 2. an association can connect any two classes.

3.

Can an association associate classes or instances in different namespaces or on different hosts ?

yes. the full object path is included within each reference.

4.

Can an association associate more than two classes?

again the answer is `yes.` the common information model specification (dsp0004), version 2.2, is very clear about this: the number of references in an association class defines the arity of the association. an association containing two references is a binary association. an association containing three references is a ternary association. unary associations (associations containing one reference) are not meaningful... when an association is subclassed its arity cannot change. having given the answer which is correct by the specification, i ought perhaps to give some advice: do not use more than two references in an association unless there is no other possibility because many wbem server implementations do not handle more than two references properly. often, you can avoid using a four-way association between classes a, b, c, and d by making an association, called assoc1, between class a and class b, and another association, assoc2, between class c and class d. you can then establish an association between assoc1 and assoc2 and end up with three binary associations rather than one four-way one. the choice is yours: perhaps the four-way association is more meaningful in your model, perhaps the three two-way ones are.

5.

I have searched the DMTF's UML diagrams that I downloaded from the Web for some of the classes you mention (e.g., CIM_RangesOfConfiguration) but cannot find them. Why?

probably because you are searching for the full name, including the cim_ schema prefix. in their uml diagrams, the dmtf does not include the schema if it is cim. yes, i agree, this is really annoying and you will notice that, whenever i have drawn dmtf uml in this book, i have added the prefix. the dmtf does, of course, use the prefix in the mof code.

6.

When coding a class definition in mof, how do I indicate that the superclass is in a different namespace?

you cannot! when your class is defined by a mof statement such as class myclass : yourclass { ...... and you pass it through a mof compiler for loading into the wbem server, the wbem server will expect to find yourclass already defined in the namespace. note, however, that an instance of an association in one namespace may refer to objects in other namespaces.

7.

Does the order of the keys matter in an Object Path ?

no. the following two object paths are identical: http://47.2.3.2/root/cimv2:acne_c1 ,key1=`fred`,key2=`joe` http://47.2.3.2/root/cimv2:acne_c1,key2=`joe`,key1=`fred`

8.

What is the plural of "schema"?

this is another source of friction within the modelling community. the correct plural is `schemata` in the same way that the plural of `lemma` is `lemmata.` many sources, however, use the abomination `schemas.`

9.

Why do associations not inherit from CIM_ManagedElement?

because an association can only be a subclass of another association. this means that two trees are necessary: one for classes which are not associations, rooted in cim_managedelement, and one for associations, which have no root.

10.

Within mof a class can only inherit from one other class. The concept of multiple inheritance, as in C++, is not supported. How can I work without multiple inheritance?

by using associations. inheritance is one way to move from one class to another, but a similar trick can be played (between instances) by using associations. there is one particular association, cim_logicalidentity, which associates two cim_managedelements (i.e., two anythings). it is designed to be used to indicate that two cim_managedelements represent different aspects of the same underlying entity.

11.

I understand that the WBEM server acts as a broker between the clients and providers, but how much checking does it do? Does it, for example, check the types and ranges of properties in an instance that a client is creating before it passes those parameters to the provider?

the specification does not give direction on whether or not the wbem server should check parameter values. most implementations do no checking at all for performance reasons, arguing that the providers will almost certainly need to do additional range checking anyway before they act on the properties. this means that if you define a property as follows: class myclass { [maxvalue(10)] uint8 myvalue; }; then a client could create an instance of this class with myvalue set to 12 (or even, given that the value will be passed in a string rather than as a uint8, 15345) and the wbem server would probably not notice. the argument is that the provider probably knows more about the actual allowed values of myvalue (perhaps it is only allowed to be as large as 10 on tuesdays, its maximum being 8 on all other days) and will be doing checking anyway-any additional checking in the wbem server would adversely affect performance. similarly, when an extrinsic method is invoked, the wbem server is unlikely to perform any checking on the parameter types-wbem is not corba.

12.

Why does the mof language not contain support for feature X, which would make my modelling very much easier?

this is a common question. why, for example, is there no standard qualifier for specifying that a particular property holds an ip address? this would make my life much easier. the dmtf is an open body. convince other people of the worth of your suggestion and participate in the discussions at the dmtf to get your ideas adopted. you are only allowed to complain if you have worked hard to get your ideas adopted and everyone else is too stupid to agree with you.

Answers

1.

This cannot be done except by making an informal statement in the description of the property. It would, of course, be possible to use a formal definition of your own devising in the description and allow your own software to interpret it; for example:

 [Description (      "This property defines the size "      "--->maxvalue dependsOn(B.X == ;F' ? 72 : 97;"      )] 

Here I have assumed that you have defined your own escape sequence (--->) and your own constraint language based on a sort of C++ syntax.

Descriptions are used informally at many points in the CIM schema. One of the properties, for example, of the CIM_EthernetPort class is defined as follows :

 [Description (  "Capabilities of the EthernetPort.  For example, the "  "Device may support AlertOnLan, WakeOnLan, Load "  "Balancing and/or FailOver.  If failover or load "  "balancing capabilities are listed, a SpareGroup "  "(failover) or ExtraCapacityGroup (load balancing) "  "should also be defined to completely describe the "  "capability."),     ValueMap {"0", "1", "2", "3", "4", "5"},     Values {"Unknown" "Other" "AlertOnLan" "WakeOnLan",           "FailOver", "LoadBalancing"},     ArrayType ("Indexed"),     ModelCorrespondence { "CIM_EthernetPort.CapabilityDescriptions"} ] uint16 Capabilities[]; 

The informal description places a constraint on this property ”if Capabilities contains Failover, then an instance of the CIM_SpareGroup class should also exist. There is currently no way to express this formally , but there is a movement within the DMTF to add a more powerful constraint language of this type to mof .

Note, however, that the presence of a qualifier stating that the maximum value of a particular numerical property is 56 does not mean that most WBEM servers will enforce such a condition. The qualifier is there to be read by providers and clients which are expected to enforce the constraint.

2.

I assume this question means, "Can an association relate one association with another association?" If so, the answer is "yes." This is clear from the DMTF's metamodel where it is stressed that:

  1. An association is a normal class.

  2. An association can connect any two classes.

3.

Yes. The full object path is included within each reference.

4.

Again the answer is "yes." The Common Information Model Specification (DSP0004), version 2.2, is very clear about this:

The number of references in an association class defines the arity of the association. An association containing two references is a binary association. An association containing three references is a ternary association. Unary associations (associations containing one reference) are not meaningful... When an association is subclassed its arity cannot change.

Having given the answer which is correct by the specification, I ought perhaps to give some advice: do not use more than two references in an association unless there is no other possibility because many WBEM server implementations do not handle more than two references properly.

Often, you can avoid using a four-way association between classes A, B, C, and D by making an association, called assoc1, between class A and class B, and another association, assoc2, between class C and class D. You can then establish an association between assoc1 and assoc2 and end up with three binary associations rather than one four-way one. The choice is yours: perhaps the four-way association is more meaningful in your model, perhaps the three two-way ones are.

5.

Probably because you are searching for the full name , including the CIM_ schema prefix. In their UML diagrams, the DMTF does not include the schema if it is CIM. Yes, I agree, this is really annoying and you will notice that, whenever I have drawn DMTF UML in this book, I have added the prefix. The DMTF does, of course, use the prefix in the mof code.

6.

You cannot! When your class is defined by a mof statement such as

 class myClass : yourClass { ...... 

and you pass it through a mof compiler for loading into the WBEM server, the WBEM server will expect to find yourClass already defined in the namespace. Note, however, that an instance of an association in one namespace may refer to objects in other namespaces.

7.

No. The following two object paths are identical:

http://47.2.3.2/root/cimv2:ACNE_C1 ,key1="fred",key2="joe"

http://47.2.3.2/root/cimv2:ACNE_C1,key2="joe",key1="fred"

8.

This is another source of friction within the modelling community. The correct plural is " schemata " in the same way that the plural of "lemma" is "lemmata." Many sources, however, use the abomination "schemas."

9.

Because an association can only be a subclass of another association. This means that two trees are necessary: one for classes which are not associations, rooted in CIM_ManagedElement, and one for associations, which have no root.

10.

By using associations. Inheritance is one way to move from one class to another, but a similar trick can be played (between instances) by using associations. There is one particular association, CIM_LogicalIdentity, which associates two CIM_ManagedElements (i.e., two anythings). It is designed to be used to indicate that two CIM_ManagedElements represent different aspects of the same underlying entity.

11.

The specification does not give direction on whether or not the WBEM server should check parameter values. Most implementations do no checking at all for performance reasons, arguing that the providers will almost certainly need to do additional range checking anyway before they act on the properties. This means that if you define a property as follows:

 class myClass     {     [maxValue(10)]     uint8   myValue;     }; 

then a client could create an instance of this class with myValue set to 12 (or even, given that the value will be passed in a string rather than as a uint8, 15345) and the WBEM server would probably not notice. The argument is that the provider probably knows more about the actual allowed values of myValue (perhaps it is only allowed to be as large as 10 on Tuesdays, its maximum being 8 on all other days) and will be doing checking anyway ”any additional checking in the WBEM server would adversely affect performance. Similarly, when an extrinsic method is invoked, the WBEM server is unlikely to perform any checking on the parameter types ”WBEM is not CORBA.

12.

This is a common question. Why, for example, is there no standard qualifier for specifying that a particular property holds an IP address? This would make my life much easier.

The DMTF is an open body. Convince other people of the worth of your suggestion and participate in the discussions at the DMTF to get your ideas adopted. You are only allowed to complain if you have worked hard to get your ideas adopted and everyone else is too stupid to agree with you.




A Practical Approach to WBEM[s]CIM Management
A Practical Approach to WBEM[s]CIM Management
ISBN: 849323061
EAN: N/A
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net