Sun WBEM SDK Developer's Guide

Client API Package (com.sun.wbem.client)

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 in the CIMClient class that are listed in the following table to transfer data to and from the CIM Object Manager.

Table 3–3 Client Methods

Method 

Description 

associators

Gets the CIM classes or instances that are associated with the specified CIM class or instance. 

associatorNames

Gets the names of the CIM classes or instances that are associated with the specified CIM class or instance. 

close

Close the client connection to the CIM Object Manager. This interface frees resources used for the client session. 

createClass

Adds the CIM class to the specified namespace. 

createInstance

Creates the specified instance if it does not exist. If the CIM instance already exists, throws CIMInstanceException with ID CIM_ERR_ALREADY_EXISTS.

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 

createQualifierType

Adds the specified CIM qualifier type to the specified namespace. 

deleteNameSpace

Deletes the specified namespace on the specified host. 

deleteClass

Deletes the specified class. 

deleteInstance

Deletes the specified instance. 

  

enumClass(CIMObjectPath path, boolean deep)

Enumerates the class specified by Path. This method returns the name of each class, not the class contents, as an enumeration of CIMObjectPath objects. If set to deep, the enumeration contains the names of all classes derived from the enumerated class. If set to shallow, the enumeration contains only the names of the first-level childeren of the enumerated class.

enumClass(CIMObjectPath path, boolean deep, boolean localonly)

Enumerates the class specified by Path. This method returns the entire class contents, not just the class name, as an enumeration of CIMClass objects. If set to deep, returns the classes derived from the enumerated class. If set to shallow, returns only the first-level children of the enumerated class. If localOnly is true, only the non-inherited properties and methods are returned. Otherwise, all proeprties and methods are returned.

enumInstances(CIMObjectPath path, boolean deep)

Enumerates the instances in the class specified by path. Returns the names of the instances for the class specified by path as an enumeration of CIMObjectPath objects. If deep is true, returns the names of all instances of the specified class and all classes derived from the class. Otherwise, returns only the names of instances belonging to the specified class.

enumInstances(CIMObjectPath path, boolean deep, boolean localOnly)

Enumerates the instances in the class specified by path. Returns the instances (the entire instance not just the name of the instance) for the specified class as an enumeration of CIMInstance objects.

enumNameSpace

Gets a list of namespaces. 

enumQualifierTypes

Gets a set of qualifier types for the specified class or classes. 

execQuery(CIMObjectPath relNS, java.lang.String query, int ql)

Returns an enumeration of instances containing properties that match the property value specified in the query, using the query language specified by ql. Currently, only WBEM Query Language (WQL) is supported. The query language maps the CIM object model to SQL tables. 

getClass

Gets the CIM class for the specified CIM object path. 

getInstance

Gets the CIM instance for the specified CIM object path. 

getProperty

Returns the value of the specified property. 

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. 

references

Gets the associations that refer to the specified CIM class or instance. 

referenceNames

Gets the names of the associations that refer to the specified CIM class or instance. 

setClass

Updates the specified CIM class if it exists. Returns an error if the CIM class does not exist. 

setInstance

Updates the specified CIM instance if it exists. Returns an error if the CIM instance does not exist. 

setProperty

Sets the specified property to the specified value. 

The following table describes the interfaces provided in the com.sun.wbem.client package.

Table 3–4 Interfaces in the com.sun.wbem.client Package

Interface 

Description 

CIMOMHandle

Provides to clients a reference to the CIM Object Manager. This interface contains methods that clients can use to transfer data to and from the CIM Object Manager.

ProviderCIMOMHandle

Provides to providers a reference to the CIM Object Manager. This interface contains methods that providers can use to transfer data to and from the CIM Object Manager. 

The following table describes the methods in the ProviderCIMOMHandle Interface.

Table 3–5 Methods in the ProviderCIMOMHandle Interface

Method 

Description 

decryptData

Decrypts the specified string value using the authentication sessionkey, if the value is encrypted. 

getCurrentAuditId

Returns a usually unique identifier for the session to be used in auditing records to identify the remote client connection 

getCurrentRole

Returns the current role assumed by the current authenticated user. 

getCurrentUser

Returns the current user on whose behalf the provider has been invoked. 

getInternalProvider

Returns a reference to an internal instance provider, which can be used to store static instance information for the provider.