Client applications commonly use the getInstance method to retrieve CIM instances from the CIMOM. When an instance of a class is created, the class inherits the properties of all the parent classes in its class hierarchy. The getInstance method takes the Boolean argument localOnly.
If localOnly is true, getInstance returns only the noninherited properties in the specified instance. The noninherited properties are defined in the instance.
If localOnly is false, all properties in the class are returned. These properties include those properties that are defined in the instance, and all properties inherited from all parent classes in its class hierarchy.
Use the setInstance method to update an existing instance.
This example does the following:
Gets instances of an object path in an enumeration
Updates the property value of b to 10 in each instance
Passes the updated instances to the CIMOM
... { // Create an object path, an object that contains the CIM name for // "myclass" CIMObjectPath cop = new CIMObjectPath("myclass"); /* Get instances for each instance object path in an enumeration, update the property value of b to 10 in each instance, and pass the updated instance to the CIM Object Manager. */ while(e.hasMoreElements()) { CIMInstance ci = cc.getInstance((CIMObjectPath) (e.nextElement()),true, true, true, null); ci.setProperty("b", new CIMValue(new Integer(10))); cc.setInstance(new CIMObjectPath(),ci); } } ...