The Sun WBEM SDK applications request information or services from the Common Information Model (CIM) Object Manager through the application programming interfaces (APIs). This chapter describes the following topics.
For detailed information on the CIM and Client APIs, see the Javadoc reference pages.
The APIs represent and manipulate CIM objects. These APIs represent CIM objects as Java classes. An object is a computer representation or model of a managed resource, such as a printer, disk drive, or CPU. Because the CIM Object Manager enforces the Common Information Model (CIM) 2.1 Specification, the objects you model using the APIs conform to standard CIM objects.
Programmers can use these interfaces to describe managed objects and retrieve information about managed objects in a particular system environment. The advantage of modeling managed resources using CIM is that those objects can be shared across any system that is CIM compliant.
The API can be grouped into three categories:
CIM API - Common classes and methods that applications use to represent all basic CIM elements
Client API - Methods that applications use to transfer data to and from the CIM Object Manager
Provider API - Interfaces that the CIM Object Manager and object provider use to communicate with each other
The following table describes the interfaces in the CIM API package.
Table 5-1 CIM Classes
Class |
Description |
---|---|
CIMClass |
A CIM class, an object representing a collection of CIM instances, all of which support a common type (for example, a set of properties and methods). This interface creates a template that fills in the required CIM values for the group of objects you are creating. |
CIMDataType |
The CIM data types (as defined by the CIM specification). |
CIMDateTime |
The CIM date and time representation. |
CIMElement |
A CIM element. This is the base class for managed system elements. |
CIMFlavor |
A CIM qualifier flavor, a characteristic of a qualifier that describes rules that specify whether a qualifier can be propagated to derived classes and instances, and whether or not a derived class or instance can override the qualifier's original value. |
CIMInstance |
A unit of CIM data. Use this interface to describe a managed object that belongs to a particular class. Instances contain actual data. |
CIMMethod |
A declaration containing the method name, return type, and parameters. |
CIMNameSpace |
A CIM namespace, a directory-like structure, that can contain other namespaces, classes, instances, qualifier types, and qualifiers. |
CIMObjectPath |
A path name of a CIM object. The object names have two parts: namespace and a model path. The model path uniquely identifies an object in the namespace. |
CIMParameter |
A CIM parameter, a value passed to a CIM method from a calling method. |
CIMProperty |
A value that characterizes an instance of a CIM class. Properties can be thought of as a pair of functions, one to set the property value, and one to return the property value. A property has a name and one domain, the class that owns the property. |
CIMQualifier |
A modifier that describes a class, instance, method, or property. Use this class to modify an attribute of a managed object, for example, add read-only access to a disk. There are two categories of qualifiers: those defined by the Common Information Model (CIM) and those defined by developers. |
CIMQualifierType |
A CIM qualifier type, a template for creating CIM qualifiers. |
CIMQuery |
A CIM query, which specifies filters for indication subscription as well as for retrieval of CIM elements from the CIM Object Manager. |
CIMScope |
A CIM scope, a qualifier attribute that indicates the CIM objects with which the qualifier can be used. For example, the qualifier ABSTRACT has Scope(Class Association Indication), meaning that it can only be used with classes, associations, and indications. |
CIMValue |
A CIM value, a value that can be assigned to properties, references, and qualifiers. CIM values have a data type (CIMDataType) and the actual value(s). |
UnsignedInt8 |
An unsigned 8-bit integer. |
UnsignedInt16 |
An unsigned 16-bit integer. |
UnsignedInt32 |
An unsigned 32-bit integer. |
UnsignedInt64 |
An unsigned 64-bit integer. |
The Exception classes represent the error conditions that can occur in Sun WBEM SDK classes. The CIMException class is the base class for CIM exceptions. All other CIM exception classes extend from the CIMException class.
The following table describes the CIM exception classes.
Table 5-2 Exception Classes
Class |
Description |
---|---|
CIMClassException |
A semantic exception that occurs in a CIM class. The MOF Compiler (mofc) uses this class to handle semantic errors found during compilation. |
CIMException |
Exceptional CIM conditions. This is the base class for CIM exceptions. |
CIMInstanceException |
Semantic exceptions that occur in a CIM instance. |
CIMMethodException |
Semantic exceptions that occur in a CIM method. |
CIMNameSpaceException |
Semantic exceptions that occur in a CIM namespace. |
CIMPropertyException |
Semantic exceptions that occur in a CIM property. |
CIMProviderException |
Exceptional conditions that can occur in the CIM Object Manager's providers. |
CIMQualifierTypeException |
Exceptional conditions that can occur in a CIM qualifier type. |
CIMRepositoryException |
Exceptional conditions that can occur in the CIM repository. |
CIMSemanticException |
Semantic exceptions that can occur in a CIM element. These exceptions are generally thrown when the CIM Object Manager tries to add, modify, or delete a CIM element and encounters situations that are illegal according to the CIM Specification. |
CIMTransportException |
Exceptional conditions that occur in the CIM transport interfaces (RMI and XML). |
The Client API package contains classes and methods that transfer data between applications and the CIM Object Manager. Applications use the CIMClient class to connect to the CIM Object Manager, and they use the methods listed in the following table in the CIMClient class to transfer data to and from the CIM Object Manager.
Table 5-3 Client Methods
Method |
Description |
---|---|
close |
Close the client connection to the CIM Object Manager. This interface frees resources used for the client session. |
createNameSpace |
Creates a CIM namespace, a directory containing classes and instances. When a client application connects to the CIM Object Manager, it specifies a namespace. All subsequent operations occur within that namespace on the CIM Object Manager host |
deleteNameSpace |
Deletes the specified namespace on the specified host. |
deleteClass |
Deletes the specified class. |
deleteInstance |
Deletes the specified instance. |
deleteQualifierType |
Deletes the specified qualifier type. |
enumClass |
Retrieves the specified class or classes from the CIM Object Manager. |
enumInstances |
Gets a list of instances for the specified class or classes. |
enumNameSpace |
Gets a list of namespaces. |
enumQualifierTypes |
Gets a set of qualifier types for the specified class or classes. |
getClass |
Gets the CIM class for the specified CIM object path. |
getInstance |
Gets the CIM instance for the specified CIM object path. |
getQualifierType |
Gets the qualifier type for the specified CIM object path. |
invokeMethod |
Executes the specified method on the specified object. A method is a declaration containing the method name, return type, and parameters in the method. |
setClass |
Invokes the CIM Object Manager on this client to add the specified CIM class to the specified namespace. |
setInstance |
Invokes the CIM Object Manager to add or update the specified CIM instance to the specified namespace. |
setQualifierType |
Invokes the CIM Object Manager to add the specified qualifier type to the specified namespace. |
Provider APIs are interfaces the CIM Object Manager and object providers use to communicate with each other. Providers can use these interfaces to provide the CIM Object Manager dynamic data.
When an application requests dynamic data from the CIM Object Manager, the CIM Object Manager uses these interfaces to pass the request to the provider. Providers are classes that perform the following functions in response to a request from the CIM Object Manager:
Map information from a managed device to CIM Java classes
Get information from a device
Pass the information to the CIM Object Manager in the form of CIM Java classes
Map the information from CIM Java classes to managed device format
Get the required information from the CIM Java class
Pass the information to the device in native device format
The following table describes the interfaces in the Provider package.
Table 5-4 Provider Interfaces
Interface |
Description |
---|---|
CIMProvider |
Base interface implemented by all providers. |
InstanceProvider |
Base interface implemented by instance providers. Instance providers serve dynamic instances of classes. |
MethodProvider |
Interface implemented by method providers, which provide implementation for all methods of CIM classes. |
PropertyProvider |
Interface implemented by property providers, which are used to retrieve and update dynamic properties. Dynamic data is not stored in the CIM Object Manager Repository. |