Solaris WBEM SDK Developer's Guide

How CIM Maps to Java

The following table describes how CIM elements map to Java elements.

Table 2-2 How CIM Elements Map to Java Elements

CIM Element 

Java Element 

Class 

The CIM class name is used as the basis for the name of the generated Java source files. The generated Java classes follow the same inheritance as defined in the class-subclass relationships in the MOF. 

Property 

An accessor and a mutator method is created for each CIM property. The CIM property name is used as the basis for the related accessor and mutator methods. 

Method 

For each CIM method, a comparable Java method is created. The method name is used as the basis for the related Java method name. The return value is the same, accounting for the Java data type mapping. Input and output parameters are used as arguments to the Java method. Output parameters are not directly included in the method signature, but rather are encapsulated in an output container object which is included as a method parameter. 

Qualifier 

Qualifiers are described in Table 2–4 and Table 2–5.

Association 

Nothing specific required. 

Indication 

Nothing specific required. 

Reference 

For each CIM reference, a reference to a generated Java interface is created. 

Trigger 

Nothing specific required. 

Schema 

Nothing specific required. 

The following table describes how CIM data types map to Java data types.

Table 2-3 How CIM Data Types Map to Java Data Elements

CIM Data Type 

Java Data Type 

Accessor Method 

Mutator Method 

uint8 X 

UnsignedInt8 

UnsignedInt8 getX(); 

void setX(UnsignedInt8 x); 

sint8 X 

Byte 

Byte getX(); 

void setX(Byte x); 

uint16 X 

UnsignedInt16 

UnsignedInt16 getX(); 

void setX(UnsignedInt16 x); 

sint16 X 

Short 

Short getX(); 

void setX(Short x); 

uint32 X 

UnsignedInt32 

UnsignedInt32 getX(); 

void setX(UnsignedInt32 x); 

sint32 X 

Integer 

Integer getX(); 

void setX(Integer x); 

uint64 X 

UnsignedInt64 

UnsignedInt64 getX(); 

void setX(UnsignedInt64 x); 

sint64 X 

Long 

Long getX(); 

void setX(Long x); 

String X 

String 

String getX(); 

void setX(String x); 

Boolean X 

Boolean 

Boolean isX(); 

void setX(Boolean x); 

real32 X 

Float 

Float getX(); 

void setX(Float x); 

real64 X 

Double 

Double getX(); 

void setX(Double x); 

DateTime X 

CIMDateTime 

CIMDateTime getX(); 

void setX(CIMDateTime x); 

Reference X 

CIMObjectPath 

CIMObjectPath getX(); 

void setX(CIMObjectPath x); 

char16 X 

Character 

Character getX(); 

void setX(Character x); 

The following table lists the meta qualifiers that refine the definition of the meta constructs in the model. These qualifiers are mutually exclusive and are used to refine the actual usage of an object class or property declaration within the MOF syntax.

Table 2-4 Meta Qualifiers

Qualifier 

Scope 

Type 

Meaning 

Association 

class 

Boolean 

No affect on mapping 

Indication 

class 

Boolean 

Class is abstract 

The following table lists the standard qualifiers and the affect that they have on the mapping of a CIM object to a bean. There is no support for optional qualifiers. JavaDoc is produced for each interface and class based on this mapping.

Table 2-5 Standard Qualifiers

Qualifier 

Scope 

Meaning 

ABSTRACT 

Class, Association, Indication 

The class is abstract and has no effect on the Java interfaces 

DESCRIPTION 

Any 

The information provided generates JavaDoc comments in the source file 

DISPLAYNAME 

Property 

An accessor method for the display name is created: 

public String displayNameForProperty();

IN 

Parameter 

Determines the method signature 

OUT 

Parameter 

Determines the Method Parameter signature and return values 

TERMINAL 

Class 

Class or Interface is Final 

UNITS 

Property, Method, Parameter 

Another accessor method is created: 

public String getpropertyUnits();

VALUMAP 

Property, Method, Parameter 

Beans contain generated constants for each property in a CIM class that has a CIM ValueMap or a Values qualifier. How the constant name and constant value is obtained to generate these class variables depends on the data type of the property and which of the qualifiers the property possesses.  


Note -

The ValueMap and Values qualifiers as defined in the CIM specification have meanings contrary to what the qualifier names might imply. ValueMap defines the legal set of values for a property and Values provides translation between an integer value and a string.


VALUES 

Property, Method, Parameter 

Beans contain generated constants for each property in a CIM class that has a CIM ValueMap or a Values qualifier. How the constant name and constant value is obtained to generate these class variables depends on the data type of the property and which of these qualifiers the property possesses.  


Note -

The ValueMap and Values qualifiers as defined in the CIM specification have meanings contrary to what the qualifier names might imply. ValueMap defines the legal set of values for a property and Values provides translation between an integer value and a string.


VERSION 

Class, Schema, Association, Indication 

Class possesses a getClassVersion() method

The following table describes how MOF elements map to Java elements.

Table 2-6 How MOF Elements Map to Java Elements

MOF Element 

Java Element 

Description Qualifier 

Description of the class, property, or method 

Complete MOF representation of the class 

The class JavaDoc description for both the Java interface and the implementing bean